Interface: ChatEngine
A ChatEngine is used to handle back and forth chats between the application and the LLM.
Implemented by
Methods
chat
▸ chat<T
, R
>(message
, chatHistory?
, streaming?
): Promise
<R
>
Send message along with the class's current chat history to the LLM.
Type parameters
Name | Type |
---|---|
T | extends undefined | boolean = undefined |
R | T extends true ? AsyncGenerator <string , void , unknown > : Response |
Parameters
Name | Type | Description |
---|---|---|
message | MessageContent | |
chatHistory? | ChatMessage [] | optional chat history if you want to customize the chat history |
streaming? | T | optional streaming flag, which auto-sets the return value if True. |
Returns
Promise
<R
>
Defined in
packages/core/src/ChatEngine.ts:29