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¶
Generic engine node with type-safe input/output schemas. |
|
Specialized node configuration for LLM engines. |
|
Factory for creating specialized node configurations. |
|
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).
- get_input_fields_for_state()¶
Get input fields that should be included in state schema.
- get_output_fields_for_state()¶
Get output fields that should be included in state schema.
- 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:
engine (haive.core.engine.base.Engine)
name (str)
custom_input_fields (list[haive.core.schema.field_definition.FieldDefinition] | None)
custom_output_fields (list[haive.core.schema.field_definition.FieldDefinition] | None)
- Return type:
- classmethod rag_node(engine, name, custom_input_fields=None, custom_output_fields=None, **kwargs)¶
Create a RAG node with optional custom fields.
- Parameters:
engine (haive.core.engine.base.Engine)
name (str)
custom_input_fields (list[haive.core.schema.field_definition.FieldDefinition] | None)
custom_output_fields (list[haive.core.schema.field_definition.FieldDefinition] | None)
- Return type:
- class haive.core.graph.node.engine_node_generic.RAGNodeConfig(**kwargs)¶
Bases:
GenericEngineNodeConfig[pydantic.BaseModel,pydantic.BaseModel]Specialized node configuration for RAG engines.