Class: DefaultContextGenerator
Extends
Implements
ContextGenerator
Constructors
new DefaultContextGenerator()
new DefaultContextGenerator(
init
):DefaultContextGenerator
Parameters
• init
• init.contextRole?: MessageType
• init.contextSystemPrompt?: ContextSystemPrompt
• init.metadataMode?: MetadataMode
• init.nodePostprocessors?: BaseNodePostprocessor
[]
• init.retriever: BaseRetriever
Returns
Overrides
Defined in
packages/core/chat-engine/dist/index.d.ts:76
Properties
contextRole
contextRole:
MessageType
Defined in
packages/core/chat-engine/dist/index.d.ts:74
contextSystemPrompt
contextSystemPrompt:
ContextSystemPrompt
Defined in
packages/core/chat-engine/dist/index.d.ts:72
metadataMode?
optional
metadataMode:MetadataMode
Defined in
packages/core/chat-engine/dist/index.d.ts:75
nodePostprocessors
nodePostprocessors:
BaseNodePostprocessor
[]
Defined in
packages/core/chat-engine/dist/index.d.ts:73
retriever
retriever:
BaseRetriever
Defined in
packages/core/chat-engine/dist/index.d.ts:71
Methods
_getPromptModules()
protected
_getPromptModules():ModuleRecord
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
Overrides
Defined in
packages/core/chat-engine/dist/index.d.ts:83
_getPrompts()
protected
_getPrompts():object
Returns
object
contextSystemPrompt
contextSystemPrompt:
ContextSystemPrompt
Overrides
Defined in
packages/core/chat-engine/dist/index.d.ts:84
_updatePrompts()
protected
_updatePrompts(promptsDict
):void
Parameters
• promptsDict
• promptsDict.contextSystemPrompt: ContextSystemPrompt
Returns
void
Overrides
Defined in
packages/core/chat-engine/dist/index.d.ts:87
generate()
generate(
message
):Promise
<Context
>
Parameters
• message: MessageContent
Returns
Promise
<Context
>
Implementation of
ContextGenerator.generate
Defined in
packages/core/chat-engine/dist/index.d.ts:91
getPrompts()
getPrompts():
PromptsRecord
Returns
Inherited from
Defined in
packages/core/prompts/dist/index.d.ts:58
updatePrompts()
updatePrompts(
prompts
):void
Parameters
• prompts: PromptsRecord
Returns
void
Inherited from
Defined in
packages/core/prompts/dist/index.d.ts:59