Spaces:
Runtime error
Runtime error
Download agent/core/parser.py from TheAbyss99/abyss-api: direct link, hf CLI and curl.
- Browser
- Download file 279 Bytes
-
https://huggingface.co/spaces/TheAbyss99/abyss-api/resolve/main/agent/core/parser.py
- Command line
-
hf download hf://spaces/TheAbyss99/abyss-api/agent/core/parser.py
-
curl -L -o parser.py https://huggingface.co/spaces/TheAbyss99/abyss-api/resolve/main/agent/core/parser.py
279 Bytes
| import re | |
| TOOL_PATTERN = re.compile(r'\[([A-Z]+):\s*(.*?)\]', re.DOTALL) | |
| def extract_tool_call(text): | |
| """Return (tool_name, args_string) or None.""" | |
| m = TOOL_PATTERN.search(text) | |
| if m: | |
| return m.group(1).lower(), m.group(2).strip() | |
| return None |