Spaces:
Running
Running
Pulastya B
commited on
Commit
·
fed3e24
1
Parent(s):
50f9263
Fix: Add Mistral tool extraction support
Browse files- Extract tool_name, tool_args from Mistral responses
- Mistral uses OpenAI-compatible format (same as Groq)
- Fixes UnboundLocalError when accessing tool_name
- src/orchestrator.py +2 -2
src/orchestrator.py
CHANGED
|
@@ -1928,12 +1928,12 @@ You are a DOER. Complete workflows based on user intent."""
|
|
| 1928 |
return result
|
| 1929 |
|
| 1930 |
# Execute tool calls (provider-specific format)
|
| 1931 |
-
if self.provider
|
| 1932 |
messages.append(response_message)
|
| 1933 |
|
| 1934 |
for tool_call in tool_calls:
|
| 1935 |
# Extract tool name and args (provider-specific)
|
| 1936 |
-
if self.provider
|
| 1937 |
tool_name = tool_call.function.name
|
| 1938 |
tool_args = json.loads(tool_call.function.arguments)
|
| 1939 |
tool_call_id = tool_call.id
|
|
|
|
| 1928 |
return result
|
| 1929 |
|
| 1930 |
# Execute tool calls (provider-specific format)
|
| 1931 |
+
if self.provider in ["groq", "mistral"]:
|
| 1932 |
messages.append(response_message)
|
| 1933 |
|
| 1934 |
for tool_call in tool_calls:
|
| 1935 |
# Extract tool name and args (provider-specific)
|
| 1936 |
+
if self.provider in ["groq", "mistral"]:
|
| 1937 |
tool_name = tool_call.function.name
|
| 1938 |
tool_args = json.loads(tool_call.function.arguments)
|
| 1939 |
tool_call_id = tool_call.id
|