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.
Hierarchy
-
↳
ContextChatEngine
Implements
Constructors
constructor
• new ContextChatEngine(init
): ContextChatEngine
Parameters
Name | Type |
---|---|
init | Object |
init.chatHistory? | ChatMessage [] |
init.chatModel? | LLM <object , object > |
init.contextSystemPrompt? | (__namedParameters : { context : undefined | string = "" }) => string |
init.nodePostprocessors? | BaseNodePostprocessor [] |
init.retriever | BaseRetriever |
Returns
Overrides
Defined in
packages/core/src/engines/chat/ContextChatEngine.ts:35
Properties
chatHistory
• chatHistory: ChatHistory
<object
>
Defined in
packages/core/src/engines/chat/ContextChatEngine.ts:32
chatModel
• chatModel: LLM
<object
, object
>
Defined in
packages/core/src/engines/chat/ContextChatEngine.ts:31
contextGenerator
• contextGenerator: ContextGenerator
Defined in
packages/core/src/engines/chat/ContextChatEngine.ts:33
Methods
_getPromptModules
▸ _getPromptModules(): Record
<string
, ContextGenerator
>
Returns
Record
<string
, ContextGenerator
>
Overrides
Defined in
packages/core/src/engines/chat/ContextChatEngine.ts:54
_getPrompts
▸ _getPrompts(): PromptsDict
Returns
PromptsDict
Inherited from
Defined in
packages/core/src/prompts/Mixin.ts:78
_updatePrompts
▸ _updatePrompts(promptsDict
): void
Parameters
Name | Type |
---|---|
promptsDict | PromptsDict |
Returns
void
Inherited from
Defined in
packages/core/src/prompts/Mixin.ts:86