haive.core.graph.node.validation_node_v2¶

Validation Node V2 - Regular node that updates state with ToolMessages.

This is a proper node (not conditional edge) that can update state by adding ToolMessages for Pydantic model validation and errors. It works with a separate validation router function for routing decisions.

Flow: 1. V2 Validation Node: Processes tool calls, adds ToolMessages to state 2. V2 Validation Router: Reads updated state, makes routing decisions

Classes¶

ValidationNodeV2

V2 Validation node that updates state with ToolMessages using schema-aware I/O.

Module Contents¶

class haive.core.graph.node.validation_node_v2.ValidationNodeV2(/, **data)¶

Bases: haive.core.graph.node.base_config.NodeConfig, haive.core.common.mixins.tool_route_mixin.ToolRouteMixin

V2 Validation node that updates state with ToolMessages using schema-aware I/O.

This node processes AIMessages with tool calls and: 1. Validates Pydantic models and creates ToolMessages 2. Handles errors by creating error ToolMessages 3. Updates state.messages with new ToolMessages 4. Returns Command to route to validation router

Schema Features: - Uses enhanced MessageList for input/output - Supports engine attribution in tool messages - Selective field extraction from state

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)

model_post_init(__context)¶

Setup default field definitions for validation node.

Return type:

None