haive.core.graph.branches.dynamicΒΆ

Dynamic output mapping based on state.

ClassesΒΆ

DynamicMapping

Configuration for dynamic output mapping.

OutputMapping

Output mapping configuration.

Module ContentsΒΆ

class haive.core.graph.branches.dynamic.DynamicMapping(/, **data)[source]ΒΆ

Bases: pydantic.BaseModel

Configuration for dynamic output mapping.

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

Determine which mapping to use based on state.

Parameters:

state (haive.core.graph.common.types.StateLike) – State object

Returns:

Tuple of (node_name, output_mapping)

Return type:

tuple[str, dict[str, str] | None]

validate_mappings()[source]ΒΆ

Validate Mappings.

Returns:

Add return description]

Return type:

[TODO

model_configΒΆ

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class haive.core.graph.branches.dynamic.OutputMapping(/, **data)[source]ΒΆ

Bases: pydantic.BaseModel

Output mapping configuration.

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_configΒΆ

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].