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]: Groq - Tool / Function Calling Example throws function_call is not nullable error #5839

Open
timlrx opened this issue Sep 23, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@timlrx
Copy link

timlrx commented Sep 23, 2024

What happened?

Following the example provided in the docs for groq tool usage throws the following error:

litellm.exceptions.BadRequestError: litellm.BadRequestError: GroqException - Error code: 400 - {'error': {'message': "'messages.2' : for 'role:assistant' the following must be satisfied[('messages.2.function_call' : Value is not nullable)]", 'type': 'invalid_request_error'}}

Simple work around is to just update the docs pass back a dict without function_call. E.g:

d = response_message.model_dump()
message.append({"role": d.get("role"), "tool_calls": d.get("tool_calls")})

Or you could consider modifying Message and not add function_call by default.

Relevant log output

No response

Twitter / LinkedIn details

No response

@timlrx timlrx added the bug Something isn't working label Sep 23, 2024
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

No branches or pull requests

1 participant