opto.optimizers.textgrad.construct_tgd_prompt#
- construct_tgd_prompt(do_momentum: bool = False, do_constrained: bool = False, do_in_context_examples: bool = False, **optimizer_kwargs)[source]#
Construct the textual gradient descent prompt.
- Parameters:
do_momentum (bool, optional) – Whether to include momentum in the prompt.
do_constrained (bool, optional) – Whether to include constraints in the prompt.
do_in_context_examples (bool, optional) – Whether to include in-context examples in the prompt.
optimizer_kwargs – Additional keyword arguments for formatting the prompt. These will be things like the variable description, gradient, past values, constraints, and in-context examples.
- Returns:
The TGD update prompt.
- Return type:
str