haive.core.graph.node.stateful_validation_nodeΒΆ

Stateful Validation Node - Tracks tool call validation results in state.

This node processes tool calls and stores validation results in state using computed fields. It separates validation logic from routing logic, enabling intelligent routing decisions based on validation history and patterns.

Key features: - Stores validation results in state with computed fields - Tracks valid vs invalid tool calls for routing decisions - Supports dynamic routing based on validation patterns - Maintains validation history for analysis - Integrates with ToolState for seamless tool tracking

ClassesΒΆ

StatefulValidationNode

Stateful validation node that tracks tool call validation results in state.

ToolCallValidationResult

Result of a tool call validation.

Module ContentsΒΆ

class haive.core.graph.node.stateful_validation_node.StatefulValidationNode(/, **data)ΒΆ

Bases: haive.core.graph.node.base_node_config.BaseNodeConfig

Stateful validation node that tracks tool call validation results in state.

This node processes tool calls and updates state with validation results, enabling intelligent routing decisions based on validation patterns.

The node: 1. Validates tool calls (Pydantic models, function signatures, etc.) 2. Creates ToolMessages for results 3. Stores validation results in state 4. Routes based on validation outcomes 5. Maintains validation history for analysis

Parameters:
  • engine_name – Name of the engine to get tool routes from

  • tool_node – Name of the tool execution node

  • parser_node – Name of the parser node

  • available_nodes – List of available nodes for routing

  • pydantic_models – Dict of model name -> model class for validation

  • validation_history_limit – Maximum number of validation results to keep

  • route_on_validation_pattern – Whether to route based on validation patterns

  • data (Any)

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.

class haive.core.graph.node.stateful_validation_node.ToolCallValidationResult(/, **data)ΒΆ

Bases: pydantic.BaseModel

Result of a tool call validation.

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)