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


@Component({
  selector: 'app-page-chat',
  templateUrl: './page-chat.component.html',
  styleUrls: ['./page-chat.component.scss']
})
export class PageChatComponent {
  oldMessage:boolean=true;
  title: string ='高级AI';
  userId: string = '';
  userImg: string = ''
  public userInput: string = '';
  messageList: Array<TestChatMessage> = [];
  completion: TestChatCompletion;
 
  

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

}
