ToolUtility class
Utility class for creating various tools.
Methods
create |
Creates an Azure AI search tool |
create |
Creates a bing custom search tool |
create |
Creates a bing grounding search tool |
create |
Creates a code interpreter tool |
create |
Creates a connected agent tool |
create |
Creates a connection tool |
create |
Creates a Microsoft Fabric tool |
create |
Creates a file search tool |
create |
Creates a function tool |
create |
Creates an OpenApi tool |
create |
Creates a sharepoint grounding search tool |
Method Details
createAzureAISearchTool(string, string, AISearchIndexResource)
Creates an Azure AI search tool
static function createAzureAISearchTool(indexConnectionId: string, indexName: string, options?: AISearchIndexResource): { 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.
- options
- AISearchIndexResource
Returns
{ definition: AzureAISearchToolDefinition, resources: ToolResources }
An object containing the definition and resources for the Azure AI search tool.
createBingCustomSearchTool(BingCustomSearchConfiguration[])
Creates a bing custom search tool
static function createBingCustomSearchTool(searchConfigurations: BingCustomSearchConfiguration[]): { definition: BingCustomSearchToolDefinition }
Parameters
- searchConfigurations
The ID of bing search connection and instanceName.
Returns
{ definition: BingCustomSearchToolDefinition }
An object containing the definition and resources for the bing custom search tool
createBingGroundingTool(BingGroundingSearchConfiguration[])
Creates a bing grounding search tool
static function createBingGroundingTool(searchConfigurations: BingGroundingSearchConfiguration[]): { definition: BingGroundingToolDefinition }
Parameters
- searchConfigurations
Returns
{ definition: BingGroundingToolDefinition }
An object containing the definition and resources for the bing grounding 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
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.
createConnectedAgentTool(string, string, string)
Creates a connected agent tool
static function createConnectedAgentTool(id: string, name: string, description: string): { definition: ConnectedAgentToolDefinition }
Parameters
- id
-
string
- name
-
string
- description
-
string
Returns
{ definition: ConnectedAgentToolDefinition }
An object containing the definition for the connected agent tool.
createConnectionTool(connectionToolType, string[])
Creates a connection tool
static function createConnectionTool(toolType: connectionToolType, connectionIds: string[]): { definition: ToolDefinitionUnion }
Parameters
- toolType
- connectionToolType
The type of the connection tool.
- connectionIds
-
string[]
A list of the IDs of the connections to use.
Returns
{ definition: ToolDefinitionUnion }
An object containing the definition for the connection tool
createFabricTool(string)
Creates a Microsoft Fabric tool
static function createFabricTool(connectionId: string): { definition: MicrosoftFabricToolDefinition }
Parameters
- connectionId
-
string
Returns
{ definition: MicrosoftFabricToolDefinition }
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
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.
createSharepointGroundingTool(string)
Creates a sharepoint grounding search tool
static function createSharepointGroundingTool(connectionId: string): { definition: SharepointToolDefinition }
Parameters
- connectionId
-
string
The ID of the sharepoint search connection.
Returns
{ definition: SharepointToolDefinition }
An object containing the definition and resources for the sharepoint grounding search tool