Remove ... blocks from the response. If there's a tag, only keep the content after it.
(text: str)
| 96 | return None |
| 97 | |
| 98 | def remove_thinking_blocks(text: str) -> str: |
| 99 | """ |
| 100 | Remove <think>...</think> blocks from the response. |
| 101 | If there'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 | |
| 115 | def extract_choice_index_from_question(question: str, answer: str) -> int: |
| 116 | """ |
no outgoing calls
no test coverage detected