Spaces:
Running
Running
Pulastya B
commited on
Commit
·
9ae6bf4
1
Parent(s):
2d15e4f
Fix Mistral import and API method
Browse files- Import: MistralClient from mistralai.client (not Mistral)
- API: Use .chat() instead of .chat.complete()
- Matches mistralai package v0.0.7 API structure
- src/orchestrator.py +3 -3
src/orchestrator.py
CHANGED
|
@@ -171,8 +171,8 @@ class DataScienceCopilot:
|
|
| 171 |
if not api_key:
|
| 172 |
raise ValueError("Mistral API key must be provided or set in MISTRAL_API_KEY env var")
|
| 173 |
|
| 174 |
-
from mistralai import
|
| 175 |
-
self.mistral_client =
|
| 176 |
self.model = os.getenv("MISTRAL_MODEL", "mistral-large-latest")
|
| 177 |
self.reasoning_effort = reasoning_effort
|
| 178 |
self.gemini_model = None
|
|
@@ -1789,7 +1789,7 @@ You are a DOER. Complete workflows based on user intent."""
|
|
| 1789 |
# Call LLM with function calling (provider-specific)
|
| 1790 |
if self.provider == "mistral":
|
| 1791 |
try:
|
| 1792 |
-
response = self.mistral_client.chat
|
| 1793 |
model=self.model,
|
| 1794 |
messages=messages,
|
| 1795 |
tools=tools_to_use,
|
|
|
|
| 171 |
if not api_key:
|
| 172 |
raise ValueError("Mistral API key must be provided or set in MISTRAL_API_KEY env var")
|
| 173 |
|
| 174 |
+
from mistralai.client import MistralClient
|
| 175 |
+
self.mistral_client = MistralClient(api_key=api_key)
|
| 176 |
self.model = os.getenv("MISTRAL_MODEL", "mistral-large-latest")
|
| 177 |
self.reasoning_effort = reasoning_effort
|
| 178 |
self.gemini_model = None
|
|
|
|
| 1789 |
# Call LLM with function calling (provider-specific)
|
| 1790 |
if self.provider == "mistral":
|
| 1791 |
try:
|
| 1792 |
+
response = self.mistral_client.chat(
|
| 1793 |
model=self.model,
|
| 1794 |
messages=messages,
|
| 1795 |
tools=tools_to_use,
|