agents.reasoning_and_critique.self_discover.self_discover_sequential_v2¶
Self-Discover Sequential Agent V2 - Proper implementation following CLAUDE.md patterns.
This implementation: 1. Uses SimpleAgentV3 for enhanced features 2. No custom __init__ overrides 3. Uses MultiAgent for sequential composition 4. Consolidates Pydantic models to avoid conflicts 5. Follows “no mocks” testing philosophy
Classes¶
An adapted version of a reasoning module for a specific task. |
|
A completed step in the reasoning process. |
|
Result of the module adaptation stage. |
|
Result of the module selection stage. |
|
Complete reasoning execution with all steps and final answer. |
|
A step in the reasoning plan. |
|
A structured reasoning plan. |
|
A reasoning module selected for a specific problem. |
Functions¶
Create the adapter agent with proper configuration. |
|
Create the executor agent with proper configuration. |
|
Create the selector agent with proper configuration. |
|
Create the complete Self-Discover sequential workflow. |
|
Create the structurer agent with proper configuration. |
|
|
Example of using the Self-Discover sequential agent. |
Module Contents¶
- class agents.reasoning_and_critique.self_discover.self_discover_sequential_v2.AdaptedModule(/, **data)¶
Bases:
pydantic.BaseModel
An adapted version of a reasoning module for a 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_sequential_v2.ExecutionStep(/, **data)¶
Bases:
pydantic.BaseModel
A completed step in the reasoning process.
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_sequential_v2.ModuleAdaptationResult(/, **data)¶
Bases:
pydantic.BaseModel
Result of the module adaptation stage.
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_sequential_v2.ModuleSelectionResult(/, **data)¶
Bases:
pydantic.BaseModel
Result of the module selection stage.
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)
- classmethod validate_modules(modules)¶
Ensure we have 3-5 modules.
- Parameters:
modules (list[SelectedModule])
- Return type:
- class agents.reasoning_and_critique.self_discover.self_discover_sequential_v2.ReasoningExecution(/, **data)¶
Bases:
pydantic.BaseModel
Complete reasoning execution with all steps and final answer.
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_sequential_v2.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_sequential_v2.ReasoningStructure(/, **data)¶
Bases:
pydantic.BaseModel
A structured 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)
- classmethod validate_steps(steps)¶
Ensure steps are properly numbered.
- Parameters:
steps (list[ReasoningStep])
- Return type:
- class agents.reasoning_and_critique.self_discover.self_discover_sequential_v2.SelectedModule(/, **data)¶
Bases:
pydantic.BaseModel
A reasoning module selected for a specific problem.
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.reasoning_and_critique.self_discover.self_discover_sequential_v2.create_adapter_agent()¶
Create the adapter agent with proper configuration.
- Return type:
haive.agents.simple.agent.SimpleAgent
- agents.reasoning_and_critique.self_discover.self_discover_sequential_v2.create_executor_agent()¶
Create the executor agent with proper configuration.
- Return type:
haive.agents.simple.agent.SimpleAgent
- agents.reasoning_and_critique.self_discover.self_discover_sequential_v2.create_selector_agent()¶
Create the selector agent with proper configuration.
- Return type:
haive.agents.simple.agent.SimpleAgent
- agents.reasoning_and_critique.self_discover.self_discover_sequential_v2.create_self_discover_sequential()¶
Create the complete Self-Discover sequential workflow.
This follows the proper pattern from CLAUDE.md: - Uses MultiAgent for composition - No custom classes or __init__ overrides - Clear sequential execution - Proper state handling between agents
- Returns:
MultiAgent configured for Self-Discover workflow
- Return type:
haive.agents.multi.agent.MultiAgent
- agents.reasoning_and_critique.self_discover.self_discover_sequential_v2.create_structurer_agent()¶
Create the structurer agent with proper configuration.
- Return type:
haive.agents.simple.agent.SimpleAgent
- async agents.reasoning_and_critique.self_discover.self_discover_sequential_v2.main()¶
Example of using the Self-Discover sequential agent.