You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.chat.complete(model="mistral-small-latest", messages=[
{
"content": "Trata de tomar una porción pequeña de la siguiente frase. Esta porción debe empezar por la primera palabra. Ten en cuenta que esta porción debe tener significado. La frase es: El consejo de Hershey, sin embargo, rechazó unánimemente la oferta.",
"role": "user",
},
])
assert res is not None
# Handle response
print(res)
Expected Behavior
raise models.SDKError(
mistralai.models.sdkerror.SDKError: API error occurred: Status 401
{
"message":"Unauthorized",
"request_id":"6f0f0d2acf22315ed83d8f6c2761b152"
}
Additional Context
No response
Suggested Solutions
No response
The text was updated successfully, but these errors were encountered:
Python -VV
Pip Freeze
Reproduction Steps
When I run this code:
from mistralai import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
Expected Behavior
mistralai.models.sdkerror.SDKError: API error occurred: Status 401
{
"message":"Unauthorized",
"request_id":"6f0f0d2acf22315ed83d8f6c2761b152"
}
Additional Context
No response
Suggested Solutions
No response
The text was updated successfully, but these errors were encountered: