MonologueAugmentation class

The 'monologue' augmentation.

Remarks

This augmentation adds support for an inner monologue to the prompt. The monologue helps the LLM to perform chain-of-thought reasoning across multiple turns of conversation.

Constructors

MonologueAugmentation(ChatCompletionAction[])

Creates a new MonologueAugmentation instance.

Methods

createPlanFromResponse(TurnContext, Memory, PromptResponse<undefined | InnerMonologue>)

Creates a plan given validated response value.

createPromptSection()
validateResponse(TurnContext, Memory, Tokenizer, PromptResponse<string>, number)

Validates a response to a prompt.

Constructor Details

MonologueAugmentation(ChatCompletionAction[])

Creates a new MonologueAugmentation instance.

new MonologueAugmentation(actions: ChatCompletionAction[])

Parameters

actions

ChatCompletionAction[]

List of actions supported by the prompt.

Method Details

createPlanFromResponse(TurnContext, Memory, PromptResponse<undefined | InnerMonologue>)

Creates a plan given validated response value.

function createPlanFromResponse(context: TurnContext, memory: Memory, response: PromptResponse<undefined | InnerMonologue>): Promise<Plan>

Parameters

context

TurnContext

Context for the current turn of conversation.

memory
Memory

An interface for accessing state variables.

response

PromptResponse<undefined | InnerMonologue>

The validated and transformed response for the prompt.

Returns

Promise<Plan>

The created plan.

createPromptSection()

function createPromptSection(): undefined | PromptSection

Returns

undefined | PromptSection

Returns an optional prompt section for the augmentation.

validateResponse(TurnContext, Memory, Tokenizer, PromptResponse<string>, number)

Validates a response to a prompt.

function validateResponse(context: TurnContext, memory: Memory, tokenizer: Tokenizer, response: PromptResponse<string>, remaining_attempts: number): Promise<Validation<undefined | InnerMonologue>>

Parameters

context

TurnContext

Context for the current turn of conversation with the user.

memory
Memory

An interface for accessing state values.

tokenizer
Tokenizer

Tokenizer to use for encoding and decoding text.

response

PromptResponse<string>

Response to validate.

remaining_attempts

number

Number of remaining attempts to validate the response.

Returns

Promise<Validation<undefined | InnerMonologue>>

A Validation object.