hap.types.schemasΒΆ

HAP type definitions for Haive state schemas.

This module defines HAP protocol types for exposing Haive state schemas, which are the foundation of agent state management.

ClassesΒΆ

DocumentStateInfo

Information about document-oriented state schemas.

FieldInfo

Information about a field in a state schema.

MessagesStateInfo

Information about the common MessagesState schema.

MetaStateSchemaInfo

Information about meta-capable state schemas.

SchemaCompositionRequest

Request to compose multiple schemas.

SchemaCreationRequest

Request to create a new state schema dynamically.

SchemaDiffResult

Result of comparing two schemas.

SchemaField

Detailed field definition for schema operations.

SchemaValidationRequest

Request to validate data against a schema.

SchemaValidationResult

Result of schema validation.

StateSchemaInfo

Information about a StateSchema exposed through HAP.

Module ContentsΒΆ

class hap.types.schemas.DocumentStateInfo(/, **data: Any)ΒΆ

Bases: StateSchemaInfo

Information about document-oriented state schemas.

Parameters:

data (Any)

document_fields: list[str] = NoneΒΆ
supports_chunking: bool = NoneΒΆ
supports_embeddings: bool = NoneΒΆ
class hap.types.schemas.FieldInfo(/, **data: Any)ΒΆ

Bases: pydantic.BaseModel

Information about a field in a state schema.

Parameters:

data (Any)

default: Any | None = NoneΒΆ
description: str | None = NoneΒΆ
has_reducer: bool = NoneΒΆ
is_shared: bool = NoneΒΆ
name: str = NoneΒΆ
reducer_name: str | None = NoneΒΆ
required: bool = NoneΒΆ
type: str = NoneΒΆ
validation_rules: list[str] = NoneΒΆ
class hap.types.schemas.MessagesStateInfo(/, **data: Any)ΒΆ

Bases: StateSchemaInfo

Information about the common MessagesState schema.

Parameters:

data (Any)

has_memory_integration: bool = NoneΒΆ
message_field_name: str = NoneΒΆ
schema_class: Literal['MessagesState'] = 'MessagesState'ΒΆ
supports_message_operations: bool = NoneΒΆ
class hap.types.schemas.MetaStateSchemaInfo(/, **data: Any)ΒΆ

Bases: StateSchemaInfo

Information about meta-capable state schemas.

Parameters:

data (Any)

embedded_agent_type: str | None = NoneΒΆ
execution_tracking: bool = NoneΒΆ
schema_class: Literal['MetaStateSchema'] = 'MetaStateSchema'ΒΆ
supports_agent_embedding: bool = NoneΒΆ
supports_recompilation: bool = NoneΒΆ
class hap.types.schemas.SchemaCompositionRequest(/, **data: Any)ΒΆ

Bases: pydantic.BaseModel

Request to compose multiple schemas.

Parameters:

data (Any)

composition_type: Literal['merge', 'union', 'intersection'] = NoneΒΆ
conflict_resolution: Literal['first', 'last', 'error'] = NoneΒΆ
name: str | None = NoneΒΆ
schemas: list[str] = NoneΒΆ
class hap.types.schemas.SchemaCreationRequest(/, **data: Any)ΒΆ

Bases: pydantic.BaseModel

Request to create a new state schema dynamically.

Parameters:

data (Any)

base_class: str = NoneΒΆ
engine_io_mappings: dict[str, dict[str, list[str]]] | None = NoneΒΆ
fields: list[SchemaField] = NoneΒΆ
name: str = NoneΒΆ
reducer_fields: dict[str, str] | None = NoneΒΆ
shared_fields: list[str] | None = NoneΒΆ
class hap.types.schemas.SchemaDiffResult(/, **data: Any)ΒΆ

Bases: pydantic.BaseModel

Result of comparing two schemas.

Parameters:

data (Any)

added_fields: list[str] = NoneΒΆ
breaking_changes: list[str] = NoneΒΆ
compatible: bool = NoneΒΆ
modified_fields: dict[str, dict[str, Any]] = NoneΒΆ
removed_fields: list[str] = NoneΒΆ
class hap.types.schemas.SchemaField(/, **data: Any)ΒΆ

Bases: pydantic.BaseModel

Detailed field definition for schema operations.

Parameters:

data (Any)

default_factory: str | None = NoneΒΆ
json_schema_extra: dict[str, Any] | None = NoneΒΆ
name: str = NoneΒΆ
serializer: str | None = NoneΒΆ
type: str = NoneΒΆ
validator: str | None = NoneΒΆ
class hap.types.schemas.SchemaValidationRequest(/, **data: Any)ΒΆ

Bases: pydantic.BaseModel

Request to validate data against a schema.

Parameters:

data (Any)

data: dict[str, Any] = NoneΒΆ
schema_name: str = NoneΒΆ
strict: bool = NoneΒΆ
class hap.types.schemas.SchemaValidationResult(/, **data: Any)ΒΆ

Bases: pydantic.BaseModel

Result of schema validation.

Parameters:

data (Any)

coerced_data: dict[str, Any] | None = NoneΒΆ
errors: list[dict[str, Any]] = NoneΒΆ
valid: bool = NoneΒΆ
warnings: list[str] = NoneΒΆ
class hap.types.schemas.StateSchemaInfo(/, **data: Any)ΒΆ

Bases: haive.hap.types.BaseInfo

Information about a StateSchema exposed through HAP.

Parameters:

data (Any)

base_class: str = NoneΒΆ
engine_io_mappings: dict[str, dict[str, list[str]]] = NoneΒΆ
fields: list[FieldInfo] = NoneΒΆ
metadata: dict[str, Any] = NoneΒΆ
reducer_fields: dict[str, str] = NoneΒΆ
schema_class: str = NoneΒΆ
shared_fields: list[str] = NoneΒΆ
structured_models: dict[str, str] = NoneΒΆ