Share via


ToolSet class

Represents a set of tools with their definitions and resources.

Properties

toolDefinitions

A list of tool definitions that have been added to the tool set.

toolResources

A collection of resources associated with the tools in the tool set.

Methods

addAzureAISearchTool(string, string)

Adds an Azure AI search tool to the tool set.

addBingGroundingTool(BingGroundingSearchConfiguration[])

Adds a bing grounding search tool to the tool set.

addCodeInterpreterTool(string[], VectorStoreDataSource[])

Adds a code interpreter tool to the tool set.

addConnectedAgentTool(string, string, string)

Adds a connected agent tool to the tool set.

addConnectionTool(connectionToolType, string[])

Adds a connection tool to the tool set.

addFileSearchTool(string[], VectorStoreConfigurations[], FileSearchToolDefinitionDetails)

Adds a file search tool to the tool set.

addOpenApiTool(OpenApiFunctionDefinition)

Adds an OpenApi tool to the tool set.

Property Details

toolDefinitions

A list of tool definitions that have been added to the tool set.

toolDefinitions: ToolDefinition[]

Property Value

toolResources

A collection of resources associated with the tools in the tool set.

toolResources: ToolResources

Property Value

Method Details

addAzureAISearchTool(string, string)

Adds an Azure AI search tool to the tool set.

function addAzureAISearchTool(indexConnectionId: string, indexName: string): { definition: AzureAISearchToolDefinition, resources: ToolResources }

Parameters

indexConnectionId

string

The connection ID of the Azure AI search index.

indexName

string

The name of the Azure AI search index.

Returns

{ definition: AzureAISearchToolDefinition, resources: ToolResources }

An object containing the definition and resources for the Azure AI search tool

addBingGroundingTool(BingGroundingSearchConfiguration[])

Adds a bing grounding search tool to the tool set.

function addBingGroundingTool(searchConfigurations: BingGroundingSearchConfiguration[]): { definition: BingGroundingToolDefinition }

Parameters

searchConfigurations

BingGroundingSearchConfiguration[]

Returns

{ definition: BingGroundingToolDefinition }

An object containing the definition and resources for the bing grounding search tool

addCodeInterpreterTool(string[], VectorStoreDataSource[])

Adds a code interpreter tool to the tool set.

function addCodeInterpreterTool(fileIds?: string[], dataSources?: VectorStoreDataSource[]): { definition: CodeInterpreterToolDefinition, resources: ToolResources }

Parameters

fileIds

string[]

A list of file IDs made available to the code_interpreter tool. There can be a maximum of 20 files associated with the tool.

dataSources

VectorStoreDataSource[]

The data sources to be used. This option is mutually exclusive with fileIds.

Returns

{ definition: CodeInterpreterToolDefinition, resources: ToolResources }

An object containing the definition and resources for the code interpreter tool

addConnectedAgentTool(string, string, string)

Adds a connected agent tool to the tool set.

function addConnectedAgentTool(id: string, name: string, description: string): { definition: ConnectedAgentToolDefinition }

Parameters

id

string

The ID of the connected agent.

name

string

The name of the connected agent.

description

string

The description of the connected agent.

Returns

{ definition: ConnectedAgentToolDefinition }

An object containing the definition for the connected agent tool

addConnectionTool(connectionToolType, string[])

Adds a connection tool to the tool set.

function addConnectionTool(toolType: connectionToolType, connectionIds: string[]): { definition: ToolDefinition }

Parameters

toolType
connectionToolType

The type of the connection tool.

connectionIds

string[]

A list of the IDs of the connections to use.

Returns

{ definition: ToolDefinition }

An object containing the definition for the connection tool

addFileSearchTool(string[], VectorStoreConfigurations[], FileSearchToolDefinitionDetails)

Adds a file search tool to the tool set.

function addFileSearchTool(vectorStoreIds?: string[], vectorStores?: VectorStoreConfigurations[], definitionDetails?: FileSearchToolDefinitionDetails): { definition: FileSearchToolDefinition, resources: ToolResources }

Parameters

vectorStoreIds

string[]

The ID of the vector store attached to this agent. There can be a maximum of 1 vector store attached to the agent.

vectorStores

VectorStoreConfigurations[]

The list of vector store configuration objects from Azure. This list is limited to one element. The only element of this list contains the list of azure asset IDs used by the search tool.

definitionDetails
FileSearchToolDefinitionDetails

The input definition information for a file search tool as used to configure an agent.

Returns

{ definition: FileSearchToolDefinition, resources: ToolResources }

An object containing the definition and resources for the file search tool

addOpenApiTool(OpenApiFunctionDefinition)

Adds an OpenApi tool to the tool set.

function addOpenApiTool(openApiFunctionDefinition: OpenApiFunctionDefinition): { definition: OpenApiToolDefinition }

Parameters

openApiFunctionDefinition
OpenApiFunctionDefinition

The OpenApi function definition to use.

Returns

{ definition: OpenApiToolDefinition }

An object containing the definition for the OpenApi tool