ContextChatEngine
Defined in: .build/typescript/packages/core/src/chat-engine/context-chat-engine.ts:38
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 chunk, allowing the appropriate context to be surfaced for each query.
Extends
Section titled “Extends”Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ContextChatEngine(
init
):ContextChatEngine
Defined in: .build/typescript/packages/core/src/chat-engine/context-chat-engine.ts:48
Parameters
Section titled “Parameters”Returns
Section titled “Returns”ContextChatEngine
Overrides
Section titled “Overrides”Properties
Section titled “Properties”chatModel
Section titled “chatModel”chatModel:
LLM
Defined in: .build/typescript/packages/core/src/chat-engine/context-chat-engine.ts:39
memory
Section titled “memory”memory:
Memory
Defined in: .build/typescript/packages/core/src/chat-engine/context-chat-engine.ts:40
contextGenerator
Section titled “contextGenerator”contextGenerator:
ContextGenerator
&PromptMixin
Defined in: .build/typescript/packages/core/src/chat-engine/context-chat-engine.ts:41
systemPrompt?
Section titled “systemPrompt?”
optional
systemPrompt:string
Defined in: .build/typescript/packages/core/src/chat-engine/context-chat-engine.ts:42
Accessors
Section titled “Accessors”chatHistory
Section titled “chatHistory”Get Signature
Section titled “Get Signature”get chatHistory():
Promise
<ChatMessage
[]>
Defined in: .build/typescript/packages/core/src/chat-engine/context-chat-engine.ts:44
Returns
Section titled “Returns”Promise
<ChatMessage
[]>
Implementation of
Section titled “Implementation of”Methods
Section titled “Methods”_getPrompts()
Section titled “_getPrompts()”
protected
_getPrompts():PromptsRecord
Defined in: .build/typescript/packages/core/src/chat-engine/context-chat-engine.ts:65
Returns
Section titled “Returns”Overrides
Section titled “Overrides”_updatePrompts()
Section titled “_updatePrompts()”
protected
_updatePrompts(prompts
):void
Defined in: .build/typescript/packages/core/src/chat-engine/context-chat-engine.ts:71
Parameters
Section titled “Parameters”prompts
Section titled “prompts”contextSystemPrompt
Section titled “contextSystemPrompt”Returns
Section titled “Returns”void
Overrides
Section titled “Overrides”_getPromptModules()
Section titled “_getPromptModules()”
protected
_getPromptModules():ModuleRecord
Defined in: .build/typescript/packages/core/src/chat-engine/context-chat-engine.ts:77
Return a dictionary of sub-modules within the current module that also implement PromptMixin (so that their prompts can also be get/set).
Can be blank if no sub-modules.
Returns
Section titled “Returns”Overrides
Section titled “Overrides”chat()
Section titled “chat()”Call Signature
Section titled “Call Signature”chat(
params
):Promise
<EngineResponse
>
Defined in: .build/typescript/packages/core/src/chat-engine/context-chat-engine.ts:83
Parameters
Section titled “Parameters”params
Section titled “params”Returns
Section titled “Returns”Promise
<EngineResponse
>
Implementation of
Section titled “Implementation of”Call Signature
Section titled “Call Signature”chat(
params
):Promise
<AsyncIterable
<EngineResponse
,any
,any
>>
Defined in: .build/typescript/packages/core/src/chat-engine/context-chat-engine.ts:84
Parameters
Section titled “Parameters”params
Section titled “params”Returns
Section titled “Returns”Promise
<AsyncIterable
<EngineResponse
, any
, any
>>
Implementation of
Section titled “Implementation of”reset()
Section titled “reset()”reset():
Promise
<void
>
Defined in: .build/typescript/packages/core/src/chat-engine/context-chat-engine.ts:127
Returns
Section titled “Returns”Promise
<void
>
validatePrompts()
Section titled “validatePrompts()”validatePrompts(
promptsDict
,moduleDict
):void
Defined in: .build/typescript/packages/core/src/prompts/mixin.ts:8
Parameters
Section titled “Parameters”promptsDict
Section titled “promptsDict”moduleDict
Section titled “moduleDict”Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”getPrompts()
Section titled “getPrompts()”getPrompts():
PromptsRecord
Defined in: .build/typescript/packages/core/src/prompts/mixin.ts:22
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”updatePrompts()
Section titled “updatePrompts()”updatePrompts(
prompts
):void
Defined in: .build/typescript/packages/core/src/prompts/mixin.ts:39
Parameters
Section titled “Parameters”prompts
Section titled “prompts”Returns
Section titled “Returns”void