跳到主要内容

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

NameType
Textends undefined | boolean = undefined
RT extends true ? AsyncGenerator<string, void, unknown> : Response

Parameters

NameTypeDescription
messageMessageContent
chatHistory?ChatMessage[]optional chat history if you want to customize the chat history
streaming?Toptional streaming flag, which auto-sets the return value if True.

Returns

Promise<R>

Defined in

packages/core/src/ChatEngine.ts:29


reset

reset(): void

Resets the chat history so that it's empty.

Returns

void

Defined in

packages/core/src/ChatEngine.ts:41