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]: Error when streaming a response #168

Open
yelboudouri opened this issue Dec 26, 2024 · 0 comments
Open

[BUG CLIENT]: Error when streaming a response #168

yelboudouri opened this issue Dec 26, 2024 · 0 comments

Comments

@yelboudouri
Copy link

Python -VV

Python 3.10.12 (main, Nov  6 2024, 20:22:13) [GCC 11.4.0]

Pip Freeze

aenum==3.1.15
aiofiles==24.1.0
aiohappyeyeballs==2.4.4
aiohttp==3.11.11
aiolimiter==1.2.1
aiosignal==1.3.2
alabaster==1.0.0
annotated-types==0.7.0
anthropic==0.40.0
anyio==4.7.0
async-timeout==5.0.1
attrs==24.3.0
babel==2.16.0
backports.tarfile==1.2.0
beautifulsoup4==4.12.3
build==1.2.2.post1
cachetools==5.5.0
certifi==2024.8.30
cffi==1.17.1
charset-normalizer==3.4.0
cryptography==44.0.0
dataclasses-json==0.6.7
deepgram-sdk==3.7.7
deprecation==2.1.0
distro==1.9.0
docutils==0.21.2
eval_type_backport==0.2.0
exceptiongroup==1.2.2
filelock==3.16.1
frozenlist==1.5.0
fsspec==2024.12.0
furo==2024.8.6
google-ai-generativelanguage==0.6.10
google-api-core==2.24.0
google-api-python-client==2.155.0
google-auth==2.37.0
google-auth-httplib2==0.2.0
google-generativeai==0.8.3
googleapis-common-protos==1.66.0
grpcio==1.68.1
grpcio-status==1.68.1
h11==0.14.0
httpcore==1.0.7
httplib2==0.22.0
httpx==0.27.2
huggingface-hub==0.27.0
idna==3.10
imagesize==1.4.1
importlib_metadata==8.5.0
iniconfig==2.0.0
jaraco.classes==3.4.0
jaraco.context==6.0.1
jaraco.functools==4.1.0
jeepney==0.8.0
Jinja2==3.1.4
jiter==0.8.2
jsonpath-python==1.0.6
keyring==25.5.0
markdown-it-py==3.0.0
MarkupSafe==3.0.2
marshmallow==3.23.2
mdurl==0.1.2
mistralai==1.2.5
more-itertools==10.5.0
multidict==6.1.0
mypy-extensions==1.0.0
nh3==0.2.19
numpy==2.2.0
openai==1.57.2
packaging==24.2
pillow==11.0.0
pkginfo==1.12.0
pluggy==1.5.0
propcache==0.2.1
proto-plus==1.25.0
protobuf==5.29.1
pyasn1==0.6.1
pyasn1_modules==0.4.1
pycparser==2.22
pydantic==2.10.3
pydantic_core==2.27.1
Pygments==2.18.0
pyparsing==3.2.0
pyproject_hooks==1.2.0
pytest==8.3.4
pytest-mock==3.14.0
python-dateutil==2.9.0.post0
python-dotenv==1.0.1
PyYAML==6.0.2
readme_renderer==44.0
replicate==1.0.4
requests==2.32.3
requests-toolbelt==1.0.0
rfc3986==2.0.0
rich==13.9.4
rsa==4.9
ruff==0.8.2
SecretStorage==3.3.3
six==1.17.0
sniffio==1.3.1
snowballstemmer==2.2.0
soupsieve==2.6
Sphinx==8.1.3
sphinx-autodoc-typehints==2.5.0
sphinx-basic-ng==1.0.0b2
sphinx-copybutton==0.5.2
sphinxcontrib-applehelp==2.0.0
sphinxcontrib-devhelp==2.0.0
sphinxcontrib-htmlhelp==2.1.0
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==2.0.0
sphinxcontrib-serializinghtml==2.0.0
sphinxext-opengraph==0.9.1
hai
tenacity==9.0.0
tokenizers==0.21.0
tomli==2.2.1
tqdm==4.67.1
twine==6.0.1
typing-inspect==0.9.0
typing_extensions==4.12.2
uritemplate==4.1.1
urllib3==2.2.3
voyageai==0.3.2
websockets==13.1
yarl==1.18.3
zipp==3.21.0

Reproduction Steps

from mistralai import Mistral

client = Mistral()
client.chat.complete(
    model=model_name,
    messages=messages,
    stream=True
)

Expected Behavior

Expacted response:
data=CompletionChunk(id='46230b1e187746a386e70340b2ab9297', model='mistral-small-latest', choices=[CompletionResponseStreamChoice(index=0, delta=DeltaMessage(role='assistant', content='', tool_calls=Unset()), finish_reason=None)], object='chat.completion.chunk', created=1735207005, usage=None)

Additional Context

But this error is shown:
mistralai.models.sdkerror.SDKError: Unexpected response received (code: 200, type: text/event-stream; charset=utf-8): Status 200

I know that client.chat.stream() exists, but client.chat.complete() has also a param called stream, meaning that it could be used to stream a 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