opto.optimizers.textgrad.get_short_value

opto.optimizers.textgrad.get_short_value#

get_short_value(text, n_words_offset: int = 10) str[source]#

Returns a short version of the value of the variable. We sometimes use it during optimization, when we want to see the value of the variable, but don’t want to see the entire value. This is sometimes to save tokens, sometimes to reduce repeating very long variables, such as code or solutions to hard problems. :param n_words_offset: The number of words to show from the beginning and the end of the value. :type n_words_offset: int