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

Status code of HTTP error messages is not 4xx or 5xx #97

Closed
lucasavila00 opened this issue Apr 9, 2024 · 1 comment · Fixed by #101
Closed

Status code of HTTP error messages is not 4xx or 5xx #97

lucasavila00 opened this issue Apr 9, 2024 · 1 comment · Fixed by #101
Labels
bug Something isn't working

Comments

@lucasavila00
Copy link
Contributor

lucasavila00 commented Apr 9, 2024

I can fix that. It's similar to #80

Here: https://github.com/EricLBuehler/mistral.rs/blob/master/mistralrs-server/src/main.rs#L140

e.to_string().into_response() does not carry the information that string is of an error, thus we get wrong HTTP status code

In the end this makes the OpenAI client return an unhelpful message:

Traceback (most recent call last):
  File "/home/lucas/oss/mistral.rs/examples/server/chat.py", line 25, in <module>
    resp = completion.choices[0].message.content
AttributeError: 'str' object has no attribute 'choices'
@EricLBuehler
Copy link
Owner

Thanks for raising this! If you can submit a PR that would be great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants