MCPcopy Index your code
hub / github.com/algorithmicsuperintelligence/optillm / remove_thinking_blocks

Function remove_thinking_blocks

scripts/eval_optillmbench.py:98–113  ·  view source on GitHub ↗

Remove ... blocks from the response. If there's a tag, only keep the content after it.

(text: str)

Source from the content-addressed store, hash-verified

96 return None
97
98def remove_thinking_blocks(text: str) -> str:
99 """
100 Remove <think>...</think> blocks from the response.
101 If there&#x27;s a </think> tag, only keep the content after it.
102 """
103 if not text:
104 return text
105
106 # Check if there's a thinking block
107 if '</think>' in text:
108 # Get everything after the last </think> tag
109 parts = text.split('</think>')
110 return parts[-1].strip()
111
112 # If no thinking blocks, return original text
113 return text
114
115def extract_choice_index_from_question(question: str, answer: str) -> int:
116 """

Callers 2

evaluate_responseFunction · 0.70
evaluate_modelFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected