hap.typesΒΆ
SubmodulesΒΆ
AttributesΒΆ
ClassesΒΆ
Request to execute an agent with validation. |
|
Result from agent execution with validation. |
|
Agent metadata for HAP with enhanced validation. |
|
Base class for all HAP info types. |
|
Graph edge metadata with validation. |
|
Standard error codes. |
|
Agent execution status values. |
|
Request to execute a graph with validation. |
|
Result from graph execution with validation. |
|
Graph execution status values. |
|
Graph metadata for HAP with validation. |
|
Error structure for HAP protocol with enhanced validation. |
|
Base request structure for HAP protocol with JSON-RPC 2.0 compliance. |
|
Base response structure for HAP protocol with validation. |
|
Graph node metadata with validation. |
|
Graph node types. |
|
Prompt argument definition with validation. |
|
Prompt metadata with enhanced validation. |
|
Resource metadata with validation. |
|
Server capabilities. |
|
Registration info for a HAP server. |
|
Tool metadata with enhanced validation. |
Package ContentsΒΆ
- class hap.types.AgentExecutionRequest(/, **data: Any)ΒΆ
Bases:
pydantic.BaseModel
Request to execute an agent with validation.
- Parameters:
data (Any)
- model_configΒΆ
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class hap.types.AgentExecutionResult(/, **data: Any)ΒΆ
Bases:
pydantic.BaseModel
Result from agent execution with validation.
- Parameters:
data (Any)
- validate_result_consistency() AgentExecutionResult ΒΆ
Ensure result/error fields are consistent with status.
- Return type:
- model_configΒΆ
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- status: ExecutionStatus = NoneΒΆ
- class hap.types.AgentInfo(/, **data: Any)ΒΆ
Bases:
BaseInfo
Agent metadata for HAP with enhanced validation.
- Parameters:
data (Any)
- model_configΒΆ
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class hap.types.BaseInfo(/, **data: Any)ΒΆ
Bases:
pydantic.BaseModel
Base class for all HAP info types.
- Parameters:
data (Any)
- model_configΒΆ
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class hap.types.EdgeInfo(/, **data: Any)ΒΆ
Bases:
pydantic.BaseModel
Graph edge metadata with validation.
- Parameters:
data (Any)
- model_configΒΆ
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class hap.types.ErrorCodeΒΆ
-
Standard error codes.
- AGENT_NOT_FOUND = -32001ΒΆ
- AUTHENTICATION_ERROR = -32007ΒΆ
- EXECUTION_ERROR = -32005ΒΆ
- GRAPH_NOT_FOUND = -32002ΒΆ
- INTERNAL_ERROR = -32603ΒΆ
- INVALID_PARAMS = -32602ΒΆ
- INVALID_REQUEST = -32600ΒΆ
- METHOD_NOT_FOUND = -32601ΒΆ
- PARSE_ERROR = -32700ΒΆ
- RESOURCE_NOT_FOUND = -32004ΒΆ
- TOOL_NOT_FOUND = -32003ΒΆ
- VALIDATION_ERROR = -32006ΒΆ
- class hap.types.ExecutionStatusΒΆ
-
Agent execution status values.
- CANCELLED = 'cancelled'ΒΆ
- ERROR = 'error'ΒΆ
- SUCCESS = 'success'ΒΆ
- TIMEOUT = 'timeout'ΒΆ
- class hap.types.GraphExecutionRequest(/, **data: Any)ΒΆ
Bases:
pydantic.BaseModel
Request to execute a graph with validation.
- Parameters:
data (Any)
- classmethod validate_input_not_empty(v: Dict[str, Any]) Dict[str, Any] ΒΆ
Ensure input data is not empty.
- model_configΒΆ
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class hap.types.GraphExecutionResult(/, **data: Any)ΒΆ
Bases:
pydantic.BaseModel
Result from graph execution with validation.
- Parameters:
data (Any)
- classmethod validate_path_items(v: List[str]) List[str] ΒΆ
Validate all path items are valid node IDs.
- validate_result_consistency() GraphExecutionResult ΒΆ
Ensure result fields are consistent with status.
- Return type:
- model_configΒΆ
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- status: GraphExecutionStatus = NoneΒΆ
- class hap.types.GraphExecutionStatusΒΆ
-
Graph execution status values.
- CANCELLED = 'cancelled'ΒΆ
- ERROR = 'error'ΒΆ
- PARTIAL = 'partial'ΒΆ
- SUCCESS = 'success'ΒΆ
- TIMEOUT = 'timeout'ΒΆ
- class hap.types.GraphInfo(/, **data: Any)ΒΆ
Bases:
BaseInfo
Graph metadata for HAP with validation.
- Parameters:
data (Any)
- classmethod validate_unique_node_ids(v: List[NodeInfo]) List[NodeInfo] ΒΆ
Ensure node IDs are unique.
- model_configΒΆ
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class hap.types.HAPError(/, **data: Any)ΒΆ
Bases:
pydantic.BaseModel
Error structure for HAP protocol with enhanced validation.
- Parameters:
data (Any)
- model_configΒΆ
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class hap.types.HAPRequest(/, **data: Any)ΒΆ
Bases:
pydantic.BaseModel
Base request structure for HAP protocol with JSON-RPC 2.0 compliance.
- Parameters:
data (Any)
- model_configΒΆ
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class hap.types.HAPResponse(/, **data: Any)ΒΆ
Bases:
pydantic.BaseModel
Base response structure for HAP protocol with validation.
- Parameters:
data (Any)
- validate_result_or_error() HAPResponse ΒΆ
Ensure response has either result or error, not both.
- Return type:
- model_configΒΆ
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class hap.types.NodeInfo(/, **data: Any)ΒΆ
Bases:
pydantic.BaseModel
Graph node metadata with validation.
- Parameters:
data (Any)
- model_configΒΆ
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class hap.types.NodeTypeΒΆ
-
Graph node types.
- AGENT = 'agent'ΒΆ
- DECISION = 'decision'ΒΆ
- END = 'end'ΒΆ
- MERGE = 'merge'ΒΆ
- PARALLEL = 'parallel'ΒΆ
- START = 'start'ΒΆ
- TOOL = 'tool'ΒΆ
- class hap.types.PromptArgument(/, **data: Any)ΒΆ
Bases:
pydantic.BaseModel
Prompt argument definition with validation.
- Parameters:
data (Any)
- model_configΒΆ
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class hap.types.PromptInfo(/, **data: Any)ΒΆ
Bases:
BaseInfo
Prompt metadata with enhanced validation.
- Parameters:
data (Any)
- classmethod validate_unique_arguments(v: List[PromptArgument]) List[PromptArgument] ΒΆ
Ensure argument names are unique.
- Parameters:
v (List[PromptArgument])
- Return type:
List[PromptArgument]
- arguments: List[PromptArgument] = NoneΒΆ
- model_configΒΆ
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class hap.types.ResourceInfo(/, **data: Any)ΒΆ
Bases:
pydantic.BaseModel
Resource metadata with validation.
- Parameters:
data (Any)
- model_configΒΆ
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class hap.types.ServerCapabilityΒΆ
-
Server capabilities.
- AUTHENTICATION = 'authentication'ΒΆ
- PROMPTS = 'prompts'ΒΆ
- RESOURCES = 'resources'ΒΆ
- STATE_PERSISTENCE = 'state_persistence'ΒΆ
- STREAMING = 'streaming'ΒΆ
- TOOLS = 'tools'ΒΆ
- class hap.types.ServerRegistration(/, **data: Any)ΒΆ
Bases:
pydantic.BaseModel
Registration info for a HAP server.
- Parameters:
data (Any)
- capabilities: List[ServerCapability] = NoneΒΆ
- registered_at: datetime.datetime = NoneΒΆ
- class hap.types.ToolInfo(/, **data: Any)ΒΆ
Bases:
BaseInfo
Tool metadata with enhanced validation.
- Parameters:
data (Any)
- classmethod validate_json_schema(v: Dict[str, Any] | None) Dict[str, Any] | None ΒΆ
Validate that schema is a valid JSON Schema structure.
- model_configΒΆ
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- hap.types.AgentIdΒΆ
- hap.types.EntrypointΒΆ
- hap.types.JSONMapΒΆ