Share via


ToolUtility class

Utility class for creating various tools.

Methods

createAzureAISearchTool(string, string, CreateAzureAISearchToolOptions)

Creates an Azure AI search tool

createAzureFunctionTool(string, string, unknown, AzureFunctionStorageQueue, AzureFunctionStorageQueue, AzureFunctionDefinition)

Creates an Azure Function tool

createBingCustomSearchTool(SearchConfigurationOutput[])

Creates a bing custom search tool

createCodeInterpreterTool(string[], VectorStoreDataSource[])

Creates a code interpreter tool

createConnectionTool(connectionToolType, string[])

Creates a connection tool

createFabricTool(string)

Creates a Microsoft Fabric tool

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

Creates a file search tool

createFunctionTool(FunctionDefinition)

Creates a function tool

createOpenApiTool(OpenApiFunctionDefinition)

Creates an OpenApi tool

Method Details

createAzureAISearchTool(string, string, CreateAzureAISearchToolOptions)

Creates an Azure AI search tool

static function createAzureAISearchTool(indexConnectionId: string, indexName: string, options?: CreateAzureAISearchToolOptions): { 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.

createAzureFunctionTool(string, string, unknown, AzureFunctionStorageQueue, AzureFunctionStorageQueue, AzureFunctionDefinition)

Creates an Azure Function tool

static function createAzureFunctionTool(name: string, description: string, parameters: unknown, inputQueue: AzureFunctionStorageQueue, outputQueue: AzureFunctionStorageQueue, definitionDetails: AzureFunctionDefinition): { definition: AzureFunctionToolDefinition, resources: ToolResources }

Parameters

name

string

The name of the Azure Function.

description

string

The description of the Azure Function.

parameters

unknown

The parameters of the Azure Function.

inputQueue
AzureFunctionStorageQueue

The input queue configuration.

outputQueue
AzureFunctionStorageQueue

The output queue configuration.

definitionDetails
AzureFunctionDefinition

Returns

{ definition: AzureFunctionToolDefinition, resources: ToolResources }

An object containing the definition and resources for the Azure Function tool.

createBingCustomSearchTool(SearchConfigurationOutput[])

Creates a bing custom search tool

static function createBingCustomSearchTool(searchConfigurations: SearchConfigurationOutput[]): { definition: ToolDefinition }

Parameters

searchConfigurations

SearchConfigurationOutput[]

The ID of bing search connection and instanceName.

Returns

{ definition: ToolDefinition }

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

createCodeInterpreterTool(string[], VectorStoreDataSource[])

Creates a code interpreter tool

static function createCodeInterpreterTool(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.

createConnectionTool(connectionToolType, string[])

Creates a connection tool

static function createConnectionTool(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

createFabricTool(string)

Creates a Microsoft Fabric tool

static function createFabricTool(connectionId: string): { definition: ToolDefinition }

Parameters

connectionId

string

Returns

{ definition: ToolDefinition }

An object containing the definition for the Microsoft Fabric tool

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

Creates a file search tool

static function createFileSearchTool(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

createFunctionTool(FunctionDefinition)

Creates a function tool

static function createFunctionTool(functionDefinition: FunctionDefinition): { definition: FunctionToolDefinition }

Parameters

functionDefinition
FunctionDefinition

The function definition to use.

Returns

{ definition: FunctionToolDefinition }

An object containing the definition for the function tool.

createOpenApiTool(OpenApiFunctionDefinition)

Creates an OpenApi tool

static function createOpenApiTool(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.