haive.core.graph.branches.send_mapping¶

Send mapping functionality for routing and state transformation.

Classes¶

SendGenerator

Generator for Send objects based on lists or collections.

SendMapping

Mapping configuration for generating Send objects.

SendMappingList

Collection of send mappings.

Module Contents¶

class haive.core.graph.branches.send_mapping.SendGenerator(/, **data)[source]¶

Bases: pydantic.BaseModel

Generator for Send objects based on lists or collections.

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)

create_sends(state)[source]¶

Create multiple Send objects from a collection in state.

Parameters:

state (haive.core.graph.common.types.StateLike)

Return type:

list[Any]

model_config¶

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

class haive.core.graph.branches.send_mapping.SendMapping(/, **data)[source]¶

Bases: pydantic.BaseModel

Mapping configuration for generating Send objects.

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)

create_send(state)[source]¶

Create a Send object from state using this mapping.

Parameters:

state (haive.core.graph.common.types.StateLike)

Return type:

Any | None

model_config¶

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

class haive.core.graph.branches.send_mapping.SendMappingList(/, **data)[source]¶

Bases: pydantic.BaseModel

Collection of send mappings.

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)

create_sends(state)[source]¶

Apply all mappings and generators to state.

Parameters:

state (haive.core.graph.common.types.StateLike)

Return type:

list[Any]

model_config¶

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