agents.reasoning_and_critique.self_discover.self_discover_v4¶
Self-Discover V4 - Using SimpleAgentV3 and MultiAgent.
Clean implementation following CLAUDE.md patterns: - SimpleAgentV3 for individual agents - MultiAgent for orchestration - No custom __init__ overrides - Proper state handling
Classes¶
Result from the adapter agent. |
|
A module adapted for the specific task. |
|
Result from the executor agent. |
|
Result from the selector agent. |
|
Result from the structurer agent. |
|
A step in the reasoning plan. |
|
A reasoning module selected for the task. |
|
Self-Discover agent using V4 architecture. |
Functions¶
Create the module adapter agent. |
|
Create the plan executor agent. |
|
Create the module selector agent. |
|
Create a ready-to-use Self-Discover V4 agent. |
|
Create the plan structurer agent. |
|
|
Example of using Self-Discover V4. |
Module Contents¶
- class agents.reasoning_and_critique.self_discover.self_discover_v4.AdaptationResult(/, **data)¶
Bases:
pydantic.BaseModel
Result from the adapter agent.
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.reasoning_and_critique.self_discover.self_discover_v4.AdaptedModule(/, **data)¶
Bases:
pydantic.BaseModel
A module adapted for the specific task.
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.reasoning_and_critique.self_discover.self_discover_v4.FinalAnswer(/, **data)¶
Bases:
pydantic.BaseModel
Result from the executor agent.
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.reasoning_and_critique.self_discover.self_discover_v4.ModuleSelection(/, **data)¶
Bases:
pydantic.BaseModel
Result from the selector agent.
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.reasoning_and_critique.self_discover.self_discover_v4.ReasoningPlan(/, **data)¶
Bases:
pydantic.BaseModel
Result from the structurer agent.
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.reasoning_and_critique.self_discover.self_discover_v4.ReasoningStep(/, **data)¶
Bases:
pydantic.BaseModel
A step in the reasoning plan.
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.reasoning_and_critique.self_discover.self_discover_v4.SelectedModule(/, **data)¶
Bases:
pydantic.BaseModel
A reasoning module selected for the task.
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.reasoning_and_critique.self_discover.self_discover_v4.SelfDiscoverV4(name='self_discover_v4', **kwargs)¶
Bases:
haive.agents.multi.agent.MultiAgent
Self-Discover agent using V4 architecture.
This is a clean implementation that: 1. Uses SimpleAgentV3 for all agents 2. Uses MultiAgent for orchestration 3. Properly handles state between agents 4. No custom __init__ overrides
Initialize with the four agents in sequence.
- Parameters:
name (str)
- prepare_initial_state(task, modules=None)¶
Prepare the initial state for execution.
- async solve(task, modules=None)¶
Convenience method to solve a task.
- Parameters:
- Returns:
FinalAnswer with the solution
- Return type:
- agents.reasoning_and_critique.self_discover.self_discover_v4.create_adapter()¶
Create the module adapter agent.
- Return type:
haive.agents.simple.agent.SimpleAgent
- agents.reasoning_and_critique.self_discover.self_discover_v4.create_executor()¶
Create the plan executor agent.
- Return type:
haive.agents.simple.agent.SimpleAgent
- agents.reasoning_and_critique.self_discover.self_discover_v4.create_selector()¶
Create the module selector agent.
- Return type:
haive.agents.simple.agent.SimpleAgent
- agents.reasoning_and_critique.self_discover.self_discover_v4.create_self_discover_v4()¶
Create a ready-to-use Self-Discover V4 agent.
- Return type:
- agents.reasoning_and_critique.self_discover.self_discover_v4.create_structurer()¶
Create the plan structurer agent.
- Return type:
haive.agents.simple.agent.SimpleAgent
- async agents.reasoning_and_critique.self_discover.self_discover_v4.main()¶
Example of using Self-Discover V4.