optimize_settings
TextEvolve optimization settings
Classes
AbstractBatchSampler
Bases: BaseDataModel
, ABC
Abstract training data sampling strategy
InferenceConfig
Bases: BaseDataModel
As part of the prompt optimization process, prompt inferencing needs to be conducted before evaluation. This configuration setting controls parameters used by the SimpleChainBuilder to create the inferencing chain.
Attributes
llm
class-attribute
instance-attribute
llm: str = Field(
...,
title="LLM",
description="The LLM to use for inference, must be registered by the backend configuration",
)
NBatchSampler
Bases: AbstractBatchSampler
Randomly sample N samples from the training data
OptimizeProfile
Bases: BaseDataModel
Profile settings and hyperparameters that govern the optimization process
Attributes
batch_sampler_factory
class-attribute
instance-attribute
batch_sampler_factory: IoCFactoryModel = Field(
...,
title="Batch Sampling Factory",
description="Factory for sampling training data batches",
)
beam_width
class-attribute
instance-attribute
beam_width: int = Field(
default=3,
title="Beam Width",
description="Controls the number of candidate prompts retained after each expansion, balancing exploration and computational efficiency.",
)
eval_profile
class-attribute
instance-attribute
eval_profile: str = Field(
...,
title="Eval Profile",
description="The evaluation profile to use for scoring",
)
gradient_chat_render_format
class-attribute
instance-attribute
gradient_chat_render_format: str = Field(
default="simple",
title="Gradient Chat Render Format",
description="Format used to render agent chat during an evaluation debate, eval chat is used as 'gradients'",
)
gradients_per_sample
class-attribute
instance-attribute
inference_config
class-attribute
instance-attribute
inference_config: InferenceConfig = Field(
..., title="Inference Config", description=__doc__
)
max_gradient_turns
class-attribute
instance-attribute
max_gradient_turns: int | None = Field(
default=None,
title="Max Gradient Turns",
description="Maximum number of evaluation chat history turns to use in gradient history. When null, use entire eval chat history.",
)
monte_carlo_successors
class-attribute
instance-attribute
monte_carlo_successors: int = Field(
default=5,
title="Monte Carlo Successors",
description="Number of random successors to to generate during expansion",
)
search_depth
class-attribute
instance-attribute
search_depth: int = Field(
default=3,
title="Search Depth",
description="The number of iterations the optimization algorithm will run. This controls how deep the search process goes, allowing the algorithm to explore the space of possible inputs progressively.",
)
OptimizeSettings
Bases: BaseDataModel
Settings for the optimize service.
Attributes
chains
class-attribute
instance-attribute
chains: Dict[str, IoCFactoryModel] = Field(
default_factory=dict,
title="Chains",
description="Chain definitions used by the TextEvolve optimization process",
)
profiles
class-attribute
instance-attribute
profiles: Dict[str, OptimizeProfile] = Field(
default_factory=dict,
title="Profile Factories",
description="Optimization profile settings",
)
PctBatchSampler
Bases: AbstractBatchSampler
Randomly sample a percentage of the training data