Skip to main content

Class: SimpleChatEngine

SimpleChatEngine is the simplest possible chat engine. Useful for using your own custom prompts.

Implements

Constructors

constructor

new SimpleChatEngine(init?)

Parameters

NameType
init?Partial<SimpleChatEngine>

Defined in

ChatEngine.ts:41

Properties

chatHistory

chatHistory: ChatMessage[]

Defined in

ChatEngine.ts:38


llm

llm: LLM

Defined in

ChatEngine.ts:39

Methods

chat

chat(message, chatHistory?): Promise<Response>

Send message along with the class's current chat history to the LLM.

Parameters

NameTypeDescription
messagestring
chatHistory?ChatMessage[]optional chat history if you want to customize the chat history

Returns

Promise<Response>

Implementation of

ChatEngine.chat

Defined in

ChatEngine.ts:46


reset

reset(): void

Resets the chat history so that it's empty.

Returns

void

Implementation of

ChatEngine.reset

Defined in

ChatEngine.ts:55