Przejdź do głównej zawartości

Class: DefaultContextGenerator

Implements

Constructors

constructor

new DefaultContextGenerator(init)

Parameters

NameType
initObject
init.contextSystemPrompt?(__namedParameters: Object) => string
init.nodePostprocessors?BaseNodePostprocessor[]
init.retrieverBaseRetriever

Defined in

packages/core/src/ChatEngine.ts:188

Properties

contextSystemPrompt

contextSystemPrompt: (__namedParameters: Object) => string

Type declaration

▸ («destructured»): string

Parameters
NameType
«destructured»Object
Returns

string

Defined in

packages/core/src/ChatEngine.ts:185


nodePostprocessors

nodePostprocessors: BaseNodePostprocessor[]

Defined in

packages/core/src/ChatEngine.ts:186


retriever

retriever: BaseRetriever

Defined in

packages/core/src/ChatEngine.ts:184

Methods

applyNodePostprocessors

Private applyNodePostprocessors(nodes): NodeWithScore<Metadata>[]

Parameters

NameType
nodesNodeWithScore<Metadata>[]

Returns

NodeWithScore<Metadata>[]

Defined in

packages/core/src/ChatEngine.ts:199


generate

generate(message, parentEvent?): Promise<Context>

Parameters

NameType
messagestring
parentEvent?Event

Returns

Promise<Context>

Implementation of

ContextGenerator.generate

Defined in

packages/core/src/ChatEngine.ts:206