feat(function call): complete utility method for KimiK2Detector and enhance documentation (#8043)

This commit is contained in:
Chang Su
2025-07-23 17:37:31 -07:00
committed by GitHub
parent 0e7a5b2694
commit 01079e174f
8 changed files with 205 additions and 56 deletions

View File

@@ -17,9 +17,17 @@ logger = logging.getLogger(__name__)
class MistralDetector(BaseFormatDetector):
"""
Detector for Mistral models.
Assumes function call format:
[TOOL_CALLS] [{"name":"func1", "arguments":{...}}, {"name":"func2", "arguments":{...}}]
Detector for Mistral model function call format.
The Mistral format uses a simple bracket-delimited structure with JSON arrays
containing function call objects.
Format Structure:
```
[TOOL_CALLS] [{"name": "function_name", "arguments": {json_args}}, ...]
```
Reference: https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.3?chat_template=default
"""
def __init__(self):