import { Component } from '@angular/core';
import { TestChatCompletion,TestChatMessage } from '../class-chat-completion';
import { Router } from '@angular/router';

@Component({
  selector: 'app-page-chat-panel',
  templateUrl: './page-chat-panel.component.html',
  styleUrls: ['./page-chat-panel.component.scss']
})
export class PageChatPanelComponent {
  messageList:Array<TestChatMessage> = []
  userInput:string = " "

  
  
  completion:TestChatCompletion
  constructor(private router: Router){
    this.completion = new TestChatCompletion(this.messageList);

  }
  send(){
    this.messageList.push({
      role:"user",
      content: this.userInput
    })
    this.userInput = ""
    this.completion.createCompletionByStream()
  }

  backIconClicked() {
    this.router.navigate(['/discover']);
}
}
