agents.supervisor.models¶
Data models for Dynamic Supervisor V2.
This module contains all the Pydantic models and enums used by the dynamic supervisor for agent specifications, capabilities, and configuration.
Classes¶
Rich metadata describing an agent's capabilities. |
|
Agent discovery modes for the dynamic supervisor. |
|
Specification for creating an agent dynamically. |
|
Configuration for agent discovery mechanisms. |
Module Contents¶
- class agents.supervisor.models.AgentCapability(/, **data)¶
Bases:
pydantic.BaseModel
Rich metadata describing an agent’s capabilities.
This model captures comprehensive information about what an agent can do, enabling intelligent task-to-agent matching.
- Parameters:
data (Any)
- name¶
Unique identifier for the agent
- agent_type¶
Type of agent (e.g., SimpleAgentV3, ReactAgent)
- description¶
Human-readable description of agent’s purpose
- specialties¶
List of task domains the agent excels at
- tools¶
Names of tools available to this agent
- active¶
Whether the agent is currently active
- performance_score¶
Historical performance metric (0-1)
- usage_count¶
Number of times this agent has been used
- last_used¶
Timestamp of last usage (ISO format)
- metadata¶
Additional custom metadata
Examples
>>> capability = AgentCapability( ... name="research_expert", ... agent_type="ReactAgent", ... description="Expert at research and information gathering", ... specialties=["research", "analysis", "web search"], ... tools=["web_search", "document_reader"] ... )
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.
- matches_task(task, threshold=0.3)¶
Calculate match score between this agent’s capabilities and a task.
- class agents.supervisor.models.AgentDiscoveryMode¶
-
Agent discovery modes for the dynamic supervisor.
- MANUAL¶
Use manually provided agent specifications
- COMPONENT_DISCOVERY¶
Discover agents from installed components
- RAG_DISCOVERY¶
Use RAG to find relevant agent implementations
- MCP_DISCOVERY¶
Discover agents via Model Context Protocol
- HYBRID¶
Combine multiple discovery methods
Initialize self. See help(type(self)) for accurate signature.
- class agents.supervisor.models.AgentSpec(/, **data)¶
Bases:
pydantic.BaseModel
Specification for creating an agent dynamically.
This model defines everything needed to instantiate a new agent at runtime, including its type, configuration, and capabilities.
- Parameters:
data (Any)
- name¶
Unique identifier for the agent
- agent_type¶
Type of agent to create (e.g., “SimpleAgentV3”, “ReactAgent”)
- description¶
Human-readable description
- specialties¶
Task domains this agent should handle
- tools¶
Tool names or instances to provide to the agent
- config¶
Configuration dictionary for agent initialization
- priority¶
Priority level for agent selection (higher = preferred)
- enabled¶
Whether this spec can be used to create agents
Examples
>>> spec = AgentSpec( ... name="code_reviewer", ... agent_type="ReactAgent", ... description="Expert code reviewer and analyzer", ... specialties=["code review", "analysis", "best practices"], ... tools=["file_reader", "code_analyzer"], ... config={ ... "temperature": 0.2, ... "system_message": "You are an expert code reviewer." ... } ... )
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.
- to_capability()¶
Convert this spec to an AgentCapability.
- Return type:
- class agents.supervisor.models.DiscoveryConfig(/, **data)¶
Bases:
pydantic.BaseModel
Configuration for agent discovery mechanisms.
- Parameters:
data (Any)
- mode¶
Discovery mode to use
- component_paths¶
Paths to search for component discovery
- rag_collection¶
Collection name for RAG discovery
- mcp_endpoints¶
MCP server endpoints for discovery
- cache_discoveries¶
Whether to cache discovered agents
- discovery_timeout¶
Timeout for discovery operations (seconds)
- max_discoveries_per_request¶
Maximum agents to discover per request
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.