hap.types.agentsΒΆ

HAP type definitions for Haive agents.

This module defines HAP protocol types for exposing Haive agents, which are the primary building blocks of AI systems.

ClassesΒΆ

AgentConfigUpdate

Request to update agent configuration.

AgentExecutionRequest

Request to execute an agent.

AgentExecutionResult

Result from agent execution.

AgentInfo

Information about a Haive agent exposed through HAP.

AgentReasoningStep

A step in agent reasoning (for agents that support it).

AgentStateSnapshot

Snapshot of agent state at a point in time.

AgentStatistics

Statistics about agent usage.

AgentToolCall

Information about a tool call made by an agent.

MultiAgentInfo

Information about multi-agent systems.

RAGAgentInfo

Information specific to RAG agents.

ReactAgentInfo

Information specific to ReactAgent.

SimpleAgentInfo

Information specific to SimpleAgent.

Module ContentsΒΆ

class hap.types.agents.AgentConfigUpdate(/, **data: Any)ΒΆ

Bases: pydantic.BaseModel

Request to update agent configuration.

Parameters:

data (Any)

max_tokens: int | None = NoneΒΆ
structured_output_enabled: bool | None = NoneΒΆ
system_message: str | None = NoneΒΆ
temperature: float | None = NoneΒΆ
tool_names: list[str] | None = NoneΒΆ
tools_enabled: bool | None = NoneΒΆ
class hap.types.agents.AgentExecutionRequest(/, **data: Any)ΒΆ

Bases: pydantic.BaseModel

Request to execute an agent.

This is the primary tool for agent execution through HAP.

Parameters:

data (Any)

checkpoint_id: str | None = NoneΒΆ
config: dict[str, Any] | None = NoneΒΆ
include_state: bool = NoneΒΆ
input_data: str | dict[str, Any] | list[dict[str, Any]] = NoneΒΆ
save_checkpoint: bool = NoneΒΆ
stream: bool = NoneΒΆ
class hap.types.agents.AgentExecutionResult(/, **data: Any)ΒΆ

Bases: pydantic.BaseModel

Result from agent execution.

Parameters:

data (Any)

checkpoint_id: str | None = NoneΒΆ
duration_ms: float | None = NoneΒΆ
error: str | None = NoneΒΆ
metadata: dict[str, Any] = NoneΒΆ
result: Any | None = NoneΒΆ
state: dict[str, Any] | None = NoneΒΆ
status: Literal['success', 'error', 'interrupted'] = NoneΒΆ
token_usage: dict[str, int] | None = NoneΒΆ
class hap.types.agents.AgentInfo(/, **data: Any)ΒΆ

Bases: haive.hap.types.BaseInfo

Information about a Haive agent exposed through HAP.

Agents are workflow + engine combinations that provide intelligent behavior through LLMs or other AI models.

Parameters:

data (Any)

agent_class: str = NoneΒΆ
agent_type: str = NoneΒΆ
capabilities: list[str] = NoneΒΆ
engine_class: str | None = NoneΒΆ
engine_type: str | None = NoneΒΆ
graph_info: dict[str, Any] | None = NoneΒΆ
has_structured_output: bool = NoneΒΆ
has_tools: bool = NoneΒΆ
input_schema: str | None = NoneΒΆ
metadata: dict[str, Any] = NoneΒΆ
output_schema: str | None = NoneΒΆ
state_schema: str | None = NoneΒΆ
structured_output_model: str | None = NoneΒΆ
tool_count: int = NoneΒΆ
tool_names: list[str] = NoneΒΆ
class hap.types.agents.AgentReasoningStep(/, **data: Any)ΒΆ

Bases: pydantic.BaseModel

A step in agent reasoning (for agents that support it).

Parameters:

data (Any)

action: str | None = NoneΒΆ
action_input: Any | None = NoneΒΆ
metadata: dict[str, Any] = NoneΒΆ
observation: str | None = NoneΒΆ
step_number: int = NoneΒΆ
thought: str = NoneΒΆ
class hap.types.agents.AgentStateSnapshot(/, **data: Any)ΒΆ

Bases: pydantic.BaseModel

Snapshot of agent state at a point in time.

Parameters:

data (Any)

agent_name: str = NoneΒΆ
context: dict[str, Any] | None = NoneΒΆ
messages: list[dict[str, Any]] | None = NoneΒΆ
metadata: dict[str, Any] = NoneΒΆ
state: dict[str, Any] = NoneΒΆ
timestamp: str = NoneΒΆ
class hap.types.agents.AgentStatistics(/, **data: Any)ΒΆ

Bases: pydantic.BaseModel

Statistics about agent usage.

Parameters:

data (Any)

average_duration_ms: float = NoneΒΆ
error_types: dict[str, int] = NoneΒΆ
failed_executions: int = NoneΒΆ
last_execution: str | None = NoneΒΆ
successful_executions: int = NoneΒΆ
total_duration_ms: float = NoneΒΆ
total_executions: int = NoneΒΆ
total_tokens: int = NoneΒΆ
class hap.types.agents.AgentToolCall(/, **data: Any)ΒΆ

Bases: pydantic.BaseModel

Information about a tool call made by an agent.

Parameters:

data (Any)

arguments: dict[str, Any] = NoneΒΆ
duration_ms: float | None = NoneΒΆ
error: str | None = NoneΒΆ
result: Any | None = NoneΒΆ
tool_name: str = NoneΒΆ
class hap.types.agents.MultiAgentInfo(/, **data: Any)ΒΆ

Bases: AgentInfo

Information about multi-agent systems.

Parameters:

data (Any)

agent_type: Literal['MultiAgent'] = 'MultiAgent'ΒΆ
coordination_mode: Literal['sequential', 'parallel', 'hierarchical', 'collaborative'] = NoneΒΆ
routing_strategy: str | None = NoneΒΆ
sub_agents: list[str] = NoneΒΆ
class hap.types.agents.RAGAgentInfo(/, **data: Any)ΒΆ

Bases: AgentInfo

Information specific to RAG agents.

Parameters:

data (Any)

agent_type: Literal['RAGAgent'] = 'RAGAgent'ΒΆ
chunk_size: int | None = NoneΒΆ
embedding_model: str | None = NoneΒΆ
retriever_type: str | None = NoneΒΆ
top_k: int | None = NoneΒΆ
vector_store: str | None = NoneΒΆ
class hap.types.agents.ReactAgentInfo(/, **data: Any)ΒΆ

Bases: AgentInfo

Information specific to ReactAgent.

Parameters:

data (Any)

agent_type: Literal['ReactAgent'] = 'ReactAgent'ΒΆ
max_iterations: int = NoneΒΆ
reasoning_style: Literal['react', 'cot', 'tot'] = NoneΒΆ
supports_reasoning: bool = NoneΒΆ
class hap.types.agents.SimpleAgentInfo(/, **data: Any)ΒΆ

Bases: AgentInfo

Information specific to SimpleAgent.

Parameters:

data (Any)

agent_type: Literal['SimpleAgent'] = 'SimpleAgent'ΒΆ
prompt_template: str | None = NoneΒΆ
system_message: str | None = NoneΒΆ