agents.reflection.models

Models for reflection agent outputs and configurations.

Classes

Critique

Structured critique of an output (for structured output pattern).

ExpertiseConfig

Configuration for expert agents.

GradingResult

Comprehensive grading result for a response.

Improvement

An improvement to a response based on reflection.

ImprovementSuggestion

A specific improvement suggestion.

QualityScore

Simple quality score for respo, field_validatorses.

ReflectionConfig

Configuration for reflection process.

ReflectionOutput

Output from reflection process (unstructured).

ReflectionResult

Complete reflection analysis (for structured output pattern).

Functions

to_prompt(obj)

Convert object to prompt string.

validate_grade_matches_score(*args, **kwargs)

Validate grade matches score (compatibility function).

Module Contents

class agents.reflection.models.Critique(/, **data)

Bases: pydantic.BaseModel

Structured critique of an output (for structured output pattern).

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)

class agents.reflection.models.ExpertiseConfig(/, **data)

Bases: pydantic.BaseModel

Configuration for expert agents.

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)

to_prompt()

Convert to prompt string.

Return type:

str

class agents.reflection.models.GradingResult(/, **data)

Bases: pydantic.BaseModel

Comprehensive grading result for a response.

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)

classmethod validate_grade_matches_score(v)

Ensure letter grade matches overall score.

Return type:

Any

class agents.reflection.models.Improvement(/, **data)

Bases: pydantic.BaseModel

An improvement to a response based on reflection.

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)

class agents.reflection.models.ImprovementSuggestion(/, **data)

Bases: pydantic.BaseModel

A specific improvement suggestion.

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)

class agents.reflection.models.QualityScore(/, **data)

Bases: pydantic.BaseModel

Simple quality score for respo, field_validatorses.

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)

class agents.reflection.models.ReflectionConfig(/, **data)

Bases: pydantic.BaseModel

Configuration for reflection process.

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)

class agents.reflection.models.ReflectionOutput(/, **data)

Bases: pydantic.BaseModel

Output from reflection process (unstructured).

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)

class agents.reflection.models.ReflectionResult(/, **data)

Bases: pydantic.BaseModel

Complete reflection analysis (for structured output pattern).

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)

agents.reflection.models.to_prompt(obj)

Convert object to prompt string.

Return type:

str

agents.reflection.models.validate_grade_matches_score(*args, **kwargs)

Validate grade matches score (compatibility function).