agents.base.types¶
Core type system for the Haive agent framework.
Defines type variables, constraints, and base protocols for type-safe agent design.
Classes¶
Complete agent protocol combining all capabilities. |
|
Default input schema for agents. |
|
Default output schema for agents. |
|
Default state schema for agents. |
|
Protocol for objects that provide engines. |
|
Protocol for objects that provide graphs. |
|
Represents a segment of a graph that can be composed. |
|
Context passed to hooks. |
|
Standard hook points in agent lifecycle. |
|
Protocol for objects that can be invoked. |
|
Represents a connection between nodes in a graph. |
|
Protocol for objects that provide state schemas. |
Module Contents¶
- class agents.base.types.Agent¶
Bases:
GraphProvider
[TState
],StateProvider
[TState
],Invokable
[TInput
,TOutput
],EngineProvider
[TEngine
],Protocol
[TEngine
,TInput
,TOutput
,TState
]Complete agent protocol combining all capabilities.
- class agents.base.types.AgentInput(/, **data)¶
Bases:
pydantic.BaseModel
Default input schema for 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)
- class agents.base.types.AgentOutput(/, **data)¶
Bases:
pydantic.BaseModel
Default output schema for 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)
- class agents.base.types.AgentState(/, **data)¶
Bases:
pydantic.BaseModel
Default state schema for 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)
- class agents.base.types.EngineProvider¶
Bases:
Protocol
[TEngine
]Protocol for objects that provide engines.
- property engine: TEngine¶
Get the primary engine.
- Return type:
TEngine
- class agents.base.types.GraphProvider¶
Bases:
Protocol
[TState
]Protocol for objects that provide graphs.
- build_graph()¶
Build and return the graph.
- Return type:
Any
- class agents.base.types.GraphSegment(/, **data)¶
Bases:
pydantic.BaseModel
,Generic
[TState
]Represents a segment of a graph that can be composed.
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.base.types.HookContext(/, **data)¶
Bases:
pydantic.BaseModel
,Generic
[TState
]Context passed to hooks.
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.base.types.HookPoint¶
-
Standard hook points in agent lifecycle.
Initialize self. See help(type(self)) for accurate signature.
- class agents.base.types.Invokable¶
Bases:
Protocol
[TInput
,TOutput
]Protocol for objects that can be invoked.
- async ainvoke(input_data, config=None)¶
Async invoke with input data.
- class agents.base.types.NodeConnection(/, **data)¶
Bases:
pydantic.BaseModel
,Generic
[TState
]Represents a connection between nodes in a graph.
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)