haive.core.schema.base_state_schemasΒΆ
Base state schemas with clear inheritance hierarchy.
This module provides a cleaner inheritance structure for state schemas, separating concerns between different types of agents and workflows.
ClassesΒΆ
State for a single agent with a primary engine (usually LLM). |
|
State for data processing workflows. |
|
State that can hold engines (serializable components). |
|
State for hierarchical agent systems (parent-child relationships). |
|
State that includes message handling. |
|
State for meta-agents that can spawn and manage other agents. |
|
Absolute minimal state - just data, no engines or agents. |
|
State for multi-agent systems with proper isolation. |
|
Specialized state for pure tool execution workflows. |
|
State that includes tool management. |
|
State for workflow agents that can modify their own execution graph. |
FunctionsΒΆ
|
Factory to create appropriate agent state class. |
|
Factory to create appropriate multi-agent state class. |
Module ContentsΒΆ
- class haive.core.schema.base_state_schemas.AgentState(/, **data)[source]ΒΆ
Bases:
ToolState
State for a single agent with a primary engine (usually LLM).
This is the base for traditional agents that have a main decision-making engine.
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 haive.core.schema.base_state_schemas.DataProcessingState(/, **data)[source]ΒΆ
Bases:
EngineState
State for data processing workflows.
Focuses on data transformation engines rather than LLMs.
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 haive.core.schema.base_state_schemas.EngineState(/, **data)[source]ΒΆ
Bases:
MessagingState
State that can hold engines (serializable components).
This is the base for states that need engines but arenβt necessarily βagentsβ in the LLM sense.
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)
- get_engine(name)[source]ΒΆ
Get an engine, deserializing if needed.
- Parameters:
name (str)
- Return type:
haive.core.engine.base.Engine | None
- class haive.core.schema.base_state_schemas.HierarchicalAgentState(/, **data)[source]ΒΆ
Bases:
MultiAgentState
State for hierarchical agent systems (parent-child relationships).
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 haive.core.schema.base_state_schemas.MessagingState(/, **data)[source]ΒΆ
Bases:
MinimalState
State that includes message handling.
For workflows that need conversation/message tracking but not necessarily LLM capabilities (e.g., routing, logging, monitoring).
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 haive.core.schema.base_state_schemas.MetaAgentState(/, **data)[source]ΒΆ
Bases:
WorkflowState
State for meta-agents that can spawn and manage other agents.
This is for advanced scenarios where agents create and coordinate other agents dynamically.
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 haive.core.schema.base_state_schemas.MinimalState(/, **data)[source]ΒΆ
Bases:
pydantic.BaseModel
Absolute minimal state - just data, no engines or agents.
Use this for simple data transformations, validations, or workflows that donβt need LLM or other engine capabilities.
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 haive.core.schema.base_state_schemas.MultiAgentState(/, **data)[source]ΒΆ
Bases:
MessagingState
State for multi-agent systems with proper isolation.
This provides a clean separation between shared state and per-agent private state.
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 haive.core.schema.base_state_schemas.ToolExecutorState(/, **data)[source]ΒΆ
Bases:
ToolState
Specialized state for pure tool execution workflows.
No LLM needed - just tool orchestration based on rules or configs.
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 haive.core.schema.base_state_schemas.ToolState(/, **data)[source]ΒΆ
Bases:
EngineState
State that includes tool management.
For workflows that use tools but might not have a primary LLM (e.g., pure tool orchestration, data processing pipelines).
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 haive.core.schema.base_state_schemas.WorkflowState(/, **data)[source]ΒΆ
Bases:
AgentState
State for workflow agents that can modify their own execution graph.
This enables meta-programming where agents can inspect and modify their own workflow based on results.
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)
- get_compiled_graph()[source]ΒΆ
Get compiled graph, recompiling if needed.
- Return type:
haive.core.graph.BaseGraph | None
- haive.core.schema.base_state_schemas.create_agent_state(agent_type, with_workflow=False, with_meta=False)[source]ΒΆ
Factory to create appropriate agent state class.
- Parameters:
- Returns:
Appropriate state class
- Return type: