haive.core.schema.engine_io_mixinΒΆ

Engine I/O Schema Mixin for State Schemas.

This module provides a mixin to handle engine-related I/O logic separately from the core state schema functionality. This separation makes the code more modular and allows for optional engine capabilities.

ClassesΒΆ

EngineIOSchemaMixin

Mixin to add engine I/O management capabilities to state schemas.

Module ContentsΒΆ

class haive.core.schema.engine_io_mixin.EngineIOSchemaMixin(/, **data)[source]ΒΆ

Bases: pydantic.BaseModel

Mixin to add engine I/O management capabilities to state schemas.

This mixin provides: - Engine I/O field mappings - Engine validation and serialization - Convenience properties for engine access - Engine-related state operations

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_all_engine_input_fields()[source]ΒΆ

Get all input fields across all engines.

Return type:

set[str]

get_all_engine_output_fields()[source]ΒΆ

Get all output fields across all engines.

Return type:

set[str]

get_engine_input_fields(engine_name)[source]ΒΆ

Get input fields for a specific engine.

Parameters:

engine_name (str)

Return type:

list[str]

get_engine_io_mappings()[source]ΒΆ

Get engine I/O mappings for this state schema.

Return type:

dict[str, dict[str, list[str]]]

get_engine_output_fields(engine_name)[source]ΒΆ

Get output fields for a specific engine.

Parameters:

engine_name (str)

Return type:

list[str]

get_engines_for_field(field_name)[source]ΒΆ

Get list of engines that use a specific field.

Parameters:

field_name (str)

Return type:

list[str]

get_schema_summary()[source]ΒΆ

Get a summary of the engine I/O schema configuration.

Return type:

dict[str, Any]

prepare_engine_input(engine_name)[source]ΒΆ

Prepare input data for a specific engine.

Parameters:

engine_name (str)

Return type:

dict[str, Any]

update_from_engine_output(engine_name, output_data)[source]ΒΆ

Update state from engine output data.

Parameters:
Return type:

None

validate_engine_compatibility(engine_name, engine)[source]ΒΆ

Validate that an engine is compatible with expected I/O fields.

Parameters:
  • engine_name (str)

  • engine (Any)

Return type:

bool

property llm: Any | NoneΒΆ

Convenience property to access the LLM engine.

Return type:

Any | None

property main_engine: Any | NoneΒΆ

Convenience property to access the main engine.

Return type:

Any | None