MCPcopy Create free account
hub / github.com/THESIS-AGENT/AIRouter / remove_thinking

Function remove_thinking

LLMwrapper.py:62–76  ·  view source on GitHub ↗

Remove thinking chains from text content. Args: text (str): Input text that may contain thinking chains. Returns: str: Text with thinking chains removed. Example: "A B C" -> "AC"

(text)

Source from the content-addressed store, hash-verified

60
61
62def remove_thinking(text):
63 """
64 Remove thinking chains from text content.
65
66 Args:
67 text (str): Input text that may contain thinking chains.
68
69 Returns:
70 str: Text with thinking chains removed.
71
72 Example:
73 "A<think>B</think>C" -> "AC"
74 """
75
76 return re.sub(r'<think>.*?</think>', '', text, flags=re.DOTALL)
77
78class LLM_Wrapper:
79 @staticmethod

Callers 5

generateMethod · 0.85
generate_mmMethod · 0.85
generate_fromTHEbestMethod · 0.85
generate_docMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected