PromptCompletionModelEvents interface

Events emitted by a PromptCompletionModel.

Properties

beforeCompletion

Triggered before the model is called to complete a prompt.

chunkReceived

Triggered when a chunk is received from the model via streaming.

responseReceived

Triggered after the model finishes returning a response.

Property Details

beforeCompletion

Triggered before the model is called to complete a prompt.

beforeCompletion: (context: TurnContext, memory: Memory, functions: PromptFunctions, tokenizer: Tokenizer, template: PromptTemplate, streaming: boolean) => void

Property Value

(context: TurnContext, memory: Memory, functions: PromptFunctions, tokenizer: Tokenizer, template: PromptTemplate, streaming: boolean) => void

chunkReceived

Triggered when a chunk is received from the model via streaming.

chunkReceived: (context: TurnContext, memory: Memory, chunk: PromptChunk) => void

Property Value

(context: TurnContext, memory: Memory, chunk: PromptChunk) => void

responseReceived

Triggered after the model finishes returning a response.

responseReceived: (context: TurnContext, memory: Memory, response: PromptResponse<string>, streamer: StreamingResponse) => void

Property Value

(context: TurnContext, memory: Memory, response: PromptResponse<string>, streamer: StreamingResponse) => void