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

ChatCompletionResponse Pydantic Enum Error #62

Open
sploithunter opened this issue Mar 1, 2024 · 1 comment
Open

ChatCompletionResponse Pydantic Enum Error #62

sploithunter opened this issue Mar 1, 2024 · 1 comment

Comments

@sploithunter
Copy link

Code I had yesterday that functioned quit working today. This could be an inference endpoint change for mistral-large-latest but I figured I would list it here as well as it is probably easier (as in $$$) to fix the client rather than the endpoint.

This is easily reproduced with the function calling example in this repository. A simple cut and paste will do. That example and other function calling code produces:

"
pydantic_core._pydantic_core.ValidationError: 1 validation error for ChatCompletionResponse
choices.0.finish_reason
Input should be 'stop', 'length', 'error' or 'tool_calls' [type=enum, input_value='tool_call', input_type=str]
"

Where the endpoint is sending "tool_call" (singular) and the client is expecting an enum of "tool_calls" (plural) . Yesterday, (29 Feb 2024) all was well and the code worked fine. Was there an endpoint update?

@aanaseer
Copy link

aanaseer commented Mar 3, 2024

I was unable to reproduce the error. I believe this was resolved with PR #59, where tool_calls enum value was added to the FinishReason class.

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

2 participants