update
Browse filesFiles changed (2)
221 unmodified lines222223224225226227228221 unmodified linesmessages.append({"role": "assistant", "content": assistant_msg})return messagesdef remove_code_block(text):# Try to match code blocks with language markerspatterns = [r'```(?:html|HTML)\n([\s\S]+?)\n```', # Match ```html or ```HTML221 unmodified lines222223224225226227228229230231232233234235236237238239240241242221 unmodified linesmessages.append({"role": "assistant", "content": assistant_msg})return messagesdef strip_tool_call_markers(text):"""Remove TOOL_CALL markers that some LLMs (like Qwen) add to their output."""if not text:return text# Remove [TOOL_CALL] and [/TOOL_CALL] markerstext = re.sub(r'\[/?TOOL_CALL\]', '', text, flags=re.IGNORECASE)# Remove standalone }} that appears with tool calls# Only remove if it's on its own line or at the endtext = re.sub(r'^\s*\}\}\s*$', '', text, flags=re.MULTILINE)return text.strip()def remove_code_block(text):# First strip any tool call markerstext = strip_tool_call_markers(text)# Try to match code blocks with language markerspatterns = [r'```(?:html|HTML)\n([\s\S]+?)\n```', # Match ```html or ```HTML
14 unmodified lines1516171819202114 unmodified lines# Type definitionsHistory = List[Dict[str, str]]def remove_code_block(text):# Try to match code blocks with language markerspatterns = [r'```(?:html|HTML)\n([\s\S]+?)\n```', # Match ```html or ```HTML14 unmodified lines15161718192021222324252627282930313233343514 unmodified lines# Type definitionsHistory = List[Dict[str, str]]def strip_tool_call_markers(text):"""Remove TOOL_CALL markers that some LLMs (like Qwen) add to their output."""if not text:return text# Remove [TOOL_CALL] and [/TOOL_CALL] markerstext = re.sub(r'\[/?TOOL_CALL\]', '', text, flags=re.IGNORECASE)# Remove standalone }} that appears with tool calls# Only remove if it's on its own line or at the endtext = re.sub(r'^\s*\}\}\s*$', '', text, flags=re.MULTILINE)return text.strip()def remove_code_block(text):# First strip any tool call markerstext = strip_tool_call_markers(text)# Try to match code blocks with language markerspatterns = [r'```(?:html|HTML)\n([\s\S]+?)\n```', # Match ```html or ```HTML
anycoder_app/models.py+14
anycoder_app/parsers.py+14