haive.core.graph.node.engine_node_generic¶

Generic Engine Node Configuration with Type Safety and Field Registry Integration.

This module provides generic engine node configurations that can distinguish between different engine types (LLM, RAG, etc.) while maintaining backwards compatibility. It integrates with the field registry for standardized field definitions.

Classes¶

GenericEngineNodeConfig

Generic engine node with type-safe input/output schemas.

LLMNodeConfig

Specialized node configuration for LLM engines.

NodeFactory

Factory for creating specialized node configurations.

RAGNodeConfig

Specialized node configuration for RAG engines.

Module Contents¶

class haive.core.graph.node.engine_node_generic.GenericEngineNodeConfig(/, **data)¶

Bases: haive.core.graph.node.base_config.NodeConfig, Generic[TInput, TOutput]

Generic engine node with type-safe input/output schemas.

This base class provides the foundation for type-safe engine nodes that can declare their input and output schemas explicitly.

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)

extract_input_from_state(state)¶

Extract input fields from state using engine-aware logic (like EngineNodeConfig).

Parameters:

state (Any)

Return type:

dict[str, Any]

get_input_fields_for_state()¶

Get input fields that should be included in state schema.

Return type:

dict[str, Any]

get_output_fields_for_state()¶

Get output fields that should be included in state schema.

Return type:

dict[str, Any]

model_post_init(__context)¶

Post-initialization to setup schemas from field definitions.

Return type:

None

class haive.core.graph.node.engine_node_generic.LLMNodeConfig(**kwargs)¶

Bases: GenericEngineNodeConfig[pydantic.BaseModel, pydantic.BaseModel]

Specialized node configuration for LLM engines.

class haive.core.graph.node.engine_node_generic.NodeFactory¶

Factory for creating specialized node configurations.

classmethod llm_node(engine, name, custom_input_fields=None, custom_output_fields=None, **kwargs)¶

Create an LLM node with optional custom fields.

Parameters:
Return type:

LLMNodeConfig

classmethod rag_node(engine, name, custom_input_fields=None, custom_output_fields=None, **kwargs)¶

Create a RAG node with optional custom fields.

Parameters:
Return type:

RAGNodeConfig

class haive.core.graph.node.engine_node_generic.RAGNodeConfig(**kwargs)¶

Bases: GenericEngineNodeConfig[pydantic.BaseModel, pydantic.BaseModel]

Specialized node configuration for RAG engines.