你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

ToolSet Class

A collection of tools that can be used by an synchronize agent.

Constructor

ToolSet()

Methods

add

Add a tool to the tool set.

execute_tool_calls

Execute a tool of the specified type with the provided tool calls.

get_definitions_and_resources

Get the definitions and resources for all tools in the tool set.

get_tool

Get a tool of the specified type from the tool set.

remove

Remove a tool of the specified type from the tool set.

validate_tool_type

Validate the type of the tool.

add

Add a tool to the tool set.

add(tool: Tool)

Parameters

Name Description
tool
Required

The tool to add.

Exceptions

Type Description

If a tool of the same type already exists.

execute_tool_calls

Execute a tool of the specified type with the provided tool calls.

execute_tool_calls(tool_calls: List[Any]) -> Any

Parameters

Name Description
tool_calls
Required

A list of tool calls to execute.

Returns

Type Description
Any

The output of the tool operations.

get_definitions_and_resources

Get the definitions and resources for all tools in the tool set.

get_definitions_and_resources() -> Dict[str, Any]

Returns

Type Description

A dictionary containing the tool resources and definitions.

get_tool

Get a tool of the specified type from the tool set.

get_tool(tool_type: Type[ToolT]) -> ToolT

Parameters

Name Description
tool_type
Required

The type of tool to get.

Returns

Type Description

The tool of the specified type.

Exceptions

Type Description

If a tool of the specified type is not found.

remove

Remove a tool of the specified type from the tool set.

remove(tool_type: Type[Tool]) -> None

Parameters

Name Description
tool_type
Required

The type of tool to remove.

Exceptions

Type Description

If a tool of the specified type is not found.

validate_tool_type

Validate the type of the tool.

validate_tool_type(tool: Tool) -> None

Parameters

Name Description
tool
Required

The type of the tool to validate.

Exceptions

Type Description

If the tool type is not a subclass of Tool.

Attributes

definitions

Get the definitions for all tools in the tool set.

Returns

Type Description

resources

Get the resources for all tools in the tool set.

Returns

Type Description