opto.optimizers.utils¶
extract_top_level_blocks ¶
Extract all top-level 
strip_nested_blocks ¶
Remove all nested 
extract_reasoning_and_remainder ¶
Extract reasoning and the remainder of the text after reasoning block (if closed). Strip whitespace only if properly closed.
extract_xml_like_data ¶
extract_xml_like_data(
    text: str,
    reasoning_tag: str = "reasoning",
    improved_variable_tag: str = "variable",
    name_tag: str = "name",
    value_tag: str = "value",
) -> Dict[str, Any]
Extract thinking content and improved variables from text containing XML-like tags.
Args:
    text (str): Text containing 
Returns:
    Dict containing:
    - 'reasoning': content of