Spaces:
Sleeping
Sleeping
Download backend/src/services/text_processing.py from pikamomo/Deep_Research_Agent: direct link, hf CLI and curl.
- Browser
- Download file 318 Bytes
-
https://huggingface.co/spaces/pikamomo/Deep_Research_Agent/resolve/main/backend/src/services/text_processing.py
- Command line
-
hf download hf://spaces/pikamomo/Deep_Research_Agent/backend/src/services/text_processing.py
-
curl -L -o text_processing.py https://huggingface.co/spaces/pikamomo/Deep_Research_Agent/resolve/main/backend/src/services/text_processing.py
318 Bytes
| """Utility helpers for normalizing agent generated text.""" | |
| from __future__ import annotations | |
| import re | |
| def strip_tool_calls(text: str) -> str: | |
| """Remove tool call markers from text.""" | |
| if not text: | |
| return text | |
| pattern = re.compile(r"\[TOOL_CALL:[^\]]+\]") | |
| return pattern.sub("", text) | |