agents.sequential.config

Configuration for SequentialAgent that connects components in a linear workflow.

from typing import Any This module defines the configuration class for SequentialAgent, which automates the process of connecting multiple engine components in a sequence.

Classes

SequentialAgentConfig

Configuration for a SequentialAgent that connects components linearly.

StepConfig

Configuration for a single step in a sequential workflow.

Functions

build_agent(config)

Build a SequentialAgent from configuration.

from_aug_llms(aug_llms[, name, id, state_schema])

Create a SequentialAgentConfig from a list of AugLLMConfig instances.

from_components(components[, name, id, state_schema])

Create a SequentialAgentConfig from a list of components.

from_steps(steps[, name, id, entry_point, state_schema])

Create a SequentialAgentConfig from a list of steps.

get_step_by_name(config, name)

Get a step configuration by name.

setup_components(config)

Setup components for a configuration.

validate_steps(steps)

Validate that steps list is not empty.

Module Contents

class agents.sequential.config.SequentialAgentConfig

Bases: haive.core.engine.agent.config.AgentConfig

Configuration for a SequentialAgent that connects components linearly.

This agent automates the process of connecting engine components in a sequence, handling the data flow between them through the state schema.

Components can be any engine types, particularly AugLLMConfig instances for chaining language model steps.

build_agent()

Build and return a SequentialAgent instance.

Return type:

Any

classmethod from_aug_llms(aug_llms, name=None, id=None, state_schema=None, **kwargs)

Create a SequentialAgentConfig from a list of AugLLMConfig instances.

Convenience method for the common case of chaining LLM steps.

Parameters:
  • aug_llms (list[haive.core.engine.aug_llm.AugLLMConfig]) – List of AugLLMConfig instances

  • name (str | None) – Optional agent name

  • id (str | None) – Optional unique identifier

  • state_schema (type[haive.core.schema.state_schema.StateSchema] | None) – Optional state schema

  • **kwargs – Additional configuration parameters

Returns:

SequentialAgentConfig instance

Return type:

SequentialAgentConfig

classmethod from_components(components, name=None, id=None, state_schema=None, step_names=None, **kwargs)

Create a SequentialAgentConfig from a list of components.

This automatically creates step configurations for each component.

Parameters:
  • components (list[Any]) – List of components to use as steps (AugLLMConfig, Engine, etc.)

  • name (str | None) – Optional agent name

  • id (str | None) – Optional unique identifier

  • state_schema (type[haive.core.schema.state_schema.StateSchema] | None) – Optional state schema

  • step_names (list[str] | None) – Optional list of step names (must match length of components)

  • **kwargs – Additional configuration parameters

Returns:

SequentialAgentConfig instance

Return type:

SequentialAgentConfig

classmethod from_steps(steps, name=None, id=None, entry_point=None, state_schema=None, **kwargs)

Create a SequentialAgentConfig from a list of steps.

Parameters:
  • steps (list[StepConfig]) – List of step configurations

  • name (str | None) – Optional agent name

  • id (str | None) – Optional unique identifier

  • entry_point (str | None) – Optional entry point step name

  • state_schema (type[haive.core.schema.state_schema.StateSchema] | None) – Optional state schema

  • **kwargs – Additional configuration parameters

Returns:

SequentialAgentConfig instance

Return type:

SequentialAgentConfig

get_step_by_name(name)

Get a step configuration by name.

Parameters:

name (str)

Return type:

StepConfig | None

setup_components()

Collect all step components into the components list for schema derivation.

Return type:

SequentialAgentConfig

classmethod validate_steps(v)

Ensure we have at least one step.

Return type:

Any

class agents.sequential.config.StepConfig(/, **data)

Bases: pydantic.BaseModel

Configuration for a single step in a sequential workflow.

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].

agents.sequential.config.build_agent(config)

Build a SequentialAgent from configuration.

Parameters:

config (SequentialAgentConfig)

Return type:

haive.agents.sequential.agent.SequentialAgent

agents.sequential.config.from_aug_llms(aug_llms, name=None, id=None, state_schema=None, **kwargs)

Create a SequentialAgentConfig from a list of AugLLMConfig instances.

Parameters:
  • aug_llms (list[haive.core.engine.aug_llm.AugLLMConfig])

  • name (str | None)

  • id (str | None)

  • state_schema (type[haive.core.schema.state_schema.StateSchema] | None)

Return type:

SequentialAgentConfig

agents.sequential.config.from_components(components, name=None, id=None, state_schema=None, **kwargs)

Create a SequentialAgentConfig from a list of components.

Parameters:
  • components (list[Any])

  • name (str | None)

  • id (str | None)

  • state_schema (type[haive.core.schema.state_schema.StateSchema] | None)

Return type:

SequentialAgentConfig

agents.sequential.config.from_steps(steps, name=None, id=None, entry_point=None, state_schema=None, **kwargs)

Create a SequentialAgentConfig from a list of steps.

Parameters:
  • steps (list[StepConfig])

  • name (str | None)

  • id (str | None)

  • entry_point (str | None)

  • state_schema (type[haive.core.schema.state_schema.StateSchema] | None)

Return type:

SequentialAgentConfig

agents.sequential.config.get_step_by_name(config, name)

Get a step configuration by name.

Parameters:
Return type:

StepConfig | None

agents.sequential.config.setup_components(config)

Setup components for a configuration.

Parameters:

config (SequentialAgentConfig)

Return type:

SequentialAgentConfig

agents.sequential.config.validate_steps(steps)

Validate that steps list is not empty.

Parameters:

steps (list[StepConfig])

Return type:

bool