MCPcopy Index your code
hub / github.com/geekcomputers/Python / clean_assistant_output

Function clean_assistant_output

JARVIS/text_utils.py:19–23  ·  view source on GitHub ↗
(text)

Source from the content-addressed store, hash-verified

17
18
19def clean_assistant_output(text):
20 cleaned = str(text).strip()
21 cleaned = re.sub(r"^(jarvis\s*:\s*)+", "", cleaned, flags=re.IGNORECASE).strip()
22 cleaned = re.sub(r"^(jarvis[,.! ]+){2,}", "Jarvis ", cleaned, flags=re.IGNORECASE).strip()
23 return cleaned
24

Callers 2

ask_modelFunction · 0.85
sayFunction · 0.85

Calls 1

subMethod · 0.80

Tested by

no test coverage detected