Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG CLIENT]: API error occurred: Status 401 #170

Open
rjzevallos opened this issue Jan 10, 2025 · 0 comments
Open

[BUG CLIENT]: API error occurred: Status 401 #170

rjzevallos opened this issue Jan 10, 2025 · 0 comments

Comments

@rjzevallos
Copy link

Python -VV

Python 3.12.3 (main, Nov  6 2024, 18:32:19) [GCC 13.2.0]

Pip Freeze

alembic==1.14.0
amqp==5.3.1
annotated-types==0.7.0
anyio==4.8.0
attrs==24.3.0
bcrypt==4.2.1
cachetools==5.5.0
certifi==2024.12.14
cffi==1.17.1
charset-normalizer==3.4.1
croniter==6.0.0
cryptography==44.0.0
debtcollector==3.0.0
decorator==5.1.1
distro==1.9.0
dnspython==2.7.0
dogpile.cache==1.3.3
eval_type_backport==0.2.2
eventlet==0.38.2
fasteners==0.19
futurist==3.0.0
greenlet==3.1.1
h11==0.14.0
httpcore==1.0.7
httpx==0.27.2
idna==3.10
importlib_metadata==8.5.0
iso8601==2.1.0
Jinja2==3.1.5
jiter==0.8.2
jsonpath-python==1.0.6
jsonschema==4.23.0
jsonschema-specifications==2024.10.1
keystoneauth1==5.9.1
keystonemiddleware==10.8.0
kombu==5.4.2
logutils==0.3.5
Mako==1.3.8
MarkupSafe==3.0.2
mistral==19.0.0
mistral-lib==3.0.0
mistralai==1.2.6
msgpack==1.1.0
mypy-extensions==1.0.0
netaddr==1.3.0
networkx==3.4.2
numpy==2.2.1
openai==1.59.4
os-service-types==1.7.0
oslo.cache==3.9.0
oslo.concurrency==6.2.0
oslo.config==9.7.0
oslo.context==5.7.0
oslo.db==17.1.0
oslo.i18n==6.5.0
oslo.log==6.2.0
oslo.messaging==15.0.0
oslo.metrics==0.10.0
oslo.middleware==6.3.0
oslo.policy==4.5.0
oslo.serialization==5.6.0
oslo.service==3.6.0
oslo.utils==8.0.0
osprofiler==4.2.0
packaging==24.2
pandas==2.2.3
paramiko==3.5.0
Paste==3.10.1
PasteDeploy==3.1.0
pbr==6.1.0
pecan==1.5.1
ply==3.11
prettytable==3.12.0
prometheus_client==0.21.1
psutil==6.1.1
pycadf==4.0.0
pycparser==2.22
pydantic==2.10.4
pydantic_core==2.27.2
PyJWT==2.10.1
PyNaCl==1.5.0
pyparsing==3.2.1
python-dateutil==2.9.0.post0
python-keystoneclient==5.5.0
pytz==2024.2
PyYAML==6.0.2
referencing==0.35.1
repoze.lru==0.7
requests==2.32.3
rfc3986==2.0.0
Routes==2.5.1
rpds-py==0.22.3
setuptools==75.7.0
simplegeneric==0.8.1
six==1.17.0
sniffio==1.3.1
SQLAlchemy==2.0.36
statsd==4.0.1
stevedore==5.4.0
tenacity==9.0.0
testresources==2.0.1
testscenarios==0.5.0
testtools==2.7.2
tooz==6.3.0
tqdm==4.67.1
typing-inspect==0.9.0
typing_extensions==4.12.2
tzdata==2024.2
urllib3==2.3.0
vine==5.1.0
voluptuous==0.15.2
wcwidth==0.2.13
WebOb==1.8.9
wrapt==1.17.0
WSME==0.12.1
yappi==1.6.10
yaql==3.0.0
zipp==3.21.0

Reproduction Steps

When I run this code:

from mistralai import Mistral
import os

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant