agents.experiments.supervisor.tools

Tools for supervisor agents.

This module provides the tools that supervisor agents can use to manage other agents, delegate tasks, and coordinate multi-agent workflows.

Classes

AgentCreationInput

Input model for agent creation tool.

AgentHandoffInput

Input model for agent handoff tool.

ListAgentsInput

Input model for listing agents.

Functions

build_supervisor_tools(supervisor)

Build all standard supervisor tools.

create_agent_creation_tool(supervisor)

Create a tool for dynamic agent creation.

create_execution_status_tool(supervisor)

Create a tool for checking execution status.

create_list_agents_tool(supervisor)

Create a tool for listing available agents.

create_supervisor_handoff_tool(supervisor)

Create a tool for delegating tasks to agents.

sync_tools_with_state(supervisor, tools)

Synchronize tools with supervisor state.

Module Contents

class agents.experiments.supervisor.tools.AgentCreationInput(/, **data)

Bases: pydantic.BaseModel

Input model for agent creation tool.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:

data (Any)

class agents.experiments.supervisor.tools.AgentHandoffInput(/, **data)

Bases: pydantic.BaseModel

Input model for agent handoff tool.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:

data (Any)

class agents.experiments.supervisor.tools.ListAgentsInput(/, **data)

Bases: pydantic.BaseModel

Input model for listing agents.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:

data (Any)

agents.experiments.supervisor.tools.build_supervisor_tools(supervisor)

Build all standard supervisor tools.

Parameters:

supervisor – The supervisor instance

Returns:

List of supervisor tools

Return type:

list[langchain_core.tools.Tool]

agents.experiments.supervisor.tools.create_agent_creation_tool(supervisor)

Create a tool for dynamic agent creation.

Parameters:

supervisor – The supervisor instance (must support dynamic creation)

Returns:

Tool for creating new agents

Return type:

langchain_core.tools.Tool

agents.experiments.supervisor.tools.create_execution_status_tool(supervisor)

Create a tool for checking execution status.

Parameters:

supervisor – The supervisor instance

Returns:

Tool for checking execution status

Return type:

langchain_core.tools.Tool

agents.experiments.supervisor.tools.create_list_agents_tool(supervisor)

Create a tool for listing available agents.

Parameters:

supervisor – The supervisor instance

Returns:

Tool for listing agents

Return type:

langchain_core.tools.Tool

agents.experiments.supervisor.tools.create_supervisor_handoff_tool(supervisor)

Create a tool for delegating tasks to agents.

Parameters:

supervisor – The supervisor instance

Returns:

Tool for agent task delegation

Return type:

langchain_core.tools.Tool

agents.experiments.supervisor.tools.sync_tools_with_state(supervisor, tools)

Synchronize tools with supervisor state.

This function updates the supervisor’s tool mappings based on available tools.

Parameters:
  • supervisor – The supervisor instance

  • tools (list[langchain_core.tools.Tool]) – List of tools to synchronize

Return type:

None