MCPcopy Create free account
hub / github.com/CoopReason/TESSY / post_process_text

Function post_process_text

utils.py:109–118  ·  view source on GitHub ↗
(text, enable_think)

Source from the content-addressed store, hash-verified

107
108
109def post_process_text(text, enable_think):
110 text = text.replace('assistantfinal', '</think>')
111 text = text.replace('\n\n</think>', '\n</think>')
112 if enable_think:
113 if "<think>" in text:
114 return "<think>" + text.split("<think>")[-1]
115 else:
116 return "<think>\n" + text.strip()
117 else:
118 return text.strip()
119
120
121def append_jsonl(path: str, data: dict) -> None:

Callers 1

async_mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected