Class: ContextChatEngine
ContextChatEngine uses the Index to get the appropriate context for each query. The context is stored in the system prompt, and the chat history is preserved, ideally allowing the appropriate context to be surfaced for each query.
Implements
Constructors
constructor
• new ContextChatEngine(init
)
Parameters
Name | Type |
---|---|
init | Object |
init.chatHistory? | ChatMessage [] |
init.chatModel? | OpenAI |
init.retriever | BaseRetriever |
Defined in
ChatEngine.ts:133
Properties
chatHistory
• chatHistory: ChatMessage
[]
Defined in
ChatEngine.ts:131
chatModel
• chatModel: OpenAI
Defined in
ChatEngine.ts:130
retriever
• retriever: BaseRetriever
Defined in
ChatEngine.ts:129
Methods
chat
▸ chat(message
, chatHistory?
): Promise
<Response
>
Send message along with the class's current chat history to the LLM.
Parameters
Name | Type | Description |
---|---|---|
message | string | |
chatHistory? | ChatMessage [] | optional chat history if you want to customize the chat history |
Returns
Promise
<Response
>
Implementation of
Defined in
ChatEngine.ts:144
reset
▸ reset(): void
Resets the chat history so that it's empty.
Returns
void
Implementation of
Defined in
ChatEngine.ts:182