ToolsAugmentation class

The 'tools' augmentation is for enabling server-side action/tools calling. In the Teams AI Library, the equivalent to OpenAI's 'tools' functionality is called an 'action'. More information about OpenAI's tools can be found at OpenAI API docs.

Therefore, tools/actions are defined in actions.json, and when 'tools' augmentation is set in config.json, the LLM model can specify which action(s) to call. To avoid using server-side tool-calling, do not set augmentation to 'tools' in config.json. Server-side tool-calling is not compatible with other augmentation types.

Methods

createPlanFromResponse(TurnContext, Memory, PromptResponse<string | ActionCall[]>)

Creates a plan given validated response value.

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

Validates a response to a prompt.

Method Details

createPlanFromResponse(TurnContext, Memory, PromptResponse<string | ActionCall[]>)

Creates a plan given validated response value.

function createPlanFromResponse(context: TurnContext, memory: Memory, response: PromptResponse<string | ActionCall[]>): Promise<Plan>

Parameters

context

TurnContext

Context for the current turn of conversation.

memory
Memory

An interface for accessing state variables.

response

PromptResponse<string | ActionCall[]>

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<any>>

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<any>>

A Validation object.