opto.optimizers.textgrad

opto.optimizers.textgrad#

Module attributes

GRADIENT_MULTIPART_TEMPLATE

//github.com/zou-group/textgrad/blob/main/textgrad/autograd/llm_ops.py zou-group/textgrad

GRADIENT_OF_RESULTS_INSTRUCTION

reduce / sum

Functions

construct_reduce_prompt

Construct a prompt that reduces the gradients.

construct_tgd_prompt

Construct the textual gradient descent prompt.

get_short_value

Returns a short version of the value of the variable.

rm_node_attrs

Removes trace node attributes (text inside square brackets) from a string.

Classes

GradientInfo

GradientInfo(gradient: str, gradient_context: Optional[Dict[str, str]])

TextGrad