agents.reflection.state

State schema for Reflection Agent.

Classes

ReflectionState

State for Reflection Agent.

Functions

add_improvement(state, improvement)

Add improvement to reflection state (module-level function).

finalize(state)

Finalize the reflection process (module-level function).

should_continue(state)

Check if reflection should continue (module-level function).

Module Contents

class agents.reflection.state.ReflectionState(/, **data)

Bases: haive.core.schema.prebuilt.multi_agent_state.MultiAgentState

State for Reflection Agent.

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)

add_improvement(improvement)

Add improvement and update current content.

Parameters:

improvement (haive.agents.reflection.models.Improvement)

Return type:

None

finalize()

Finalize the reflection process.

Return type:

str

should_continue()

Check if reflection should continue.

Return type:

bool

agents.reflection.state.add_improvement(state, improvement)

Add improvement to reflection state (module-level function).

Parameters:
  • state (ReflectionState)

  • improvement (haive.agents.reflection.models.Improvement)

Return type:

None

agents.reflection.state.finalize(state)

Finalize the reflection process (module-level function).

Parameters:

state (ReflectionState)

Return type:

str

agents.reflection.state.should_continue(state)

Check if reflection should continue (module-level function).

Parameters:

state (ReflectionState)

Return type:

bool