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]: vertex ai function calling #4192

Open
themrzmaster opened this issue Jun 14, 2024 · 7 comments
Open

[Bug]: vertex ai function calling #4192

themrzmaster opened this issue Jun 14, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@themrzmaster
Copy link
Contributor

What happened?

[{'role': 'system', 'content': "You are a polite and helpful digital assistant"}, {'role': 'user', 'content': 'hi'}, ChatCompletionMessage(content='Hi! how can I help you?', role='assistant', function_call=None, tool_calls=None), {'role': 'user', 'content': 'where is my order}, {'content': None, 'role': 'assistant', 'function_call': None, 'tool_calls': [{'id': 'call_2t6e', 'function': {'arguments': '{"order_id":""}', 'name': 'get_order_status'}, 'type': 'function'}]}, {'role': 'tool', 'content': 'Error: Invalid order number, 'tool_call_id': 'call_2t6e', 'name': 'get_order_status'}]

This message list, while processed to gemini-pro-1.5 in vertex ai integration gives error:
openai.BadRequestError: Error code: 400 - {'error': {'message': 'BadRequestError: GroqException - Error code: 400 - {\'error\': {\'message\': "\'messages.4\' : for \'role:assistant\' the following must be satisfied[(\'messages.4.function_call\' : Value is not nullable)]", \'type\': \'invalid_request_error\'}}', 'type': None, 'param': None, 'code': 400}}

other models like gpt-4 works great. It was working before the last vertex update.

Relevant log output

No response

Twitter / LinkedIn details

No response

@themrzmaster themrzmaster added the bug Something isn't working label Jun 14, 2024
@krrishdholakia
Copy link
Contributor

BadRequestError: GroqException - Error code: 400 - {'error': {'message': "'messages.4' : for 'role:assistant\

is this a vertex error @themrzmaster the error code seems to be for Groq

@krrishdholakia
Copy link
Contributor

bump on this @themrzmaster

@themrzmaster
Copy link
Contributor Author

sorry, wrong log.


Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/litellm/llms/vertex_ai.py", line 981, in async_completion
    getattr(response.candidates[0].content.parts[0], "function_call", None)
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^
IndexError: list index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/litellm/main.py", line 350, in acompletion
    response = await init_response
               ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/litellm/llms/vertex_ai.py", line 1149, in async_completion
    raise VertexAIError(status_code=500, message=str(e))

@krrishdholakia

@themrzmaster
Copy link
Contributor Author

just checked the latest litellm version. Now, its not even calling any function.. never

@krrishdholakia
Copy link
Contributor

ile "/usr/local/lib/python3.11/site-packages/litellm/llms/vertex_ai.py", line 981, in async_completion
getattr(response.candidates[0].content.parts[0], "function_call", None)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^
IndexError: list index out of range

This shows a function call isn't being received.

What do your server logs show with --detailed_debug @themrzmaster

@krrishdholakia
Copy link
Contributor

Can we actually do a debug call for this @themrzmaster

Will be quicker to fix what's happening - https://calendly.com/d/4mp-gd3-k5k/litellm-1-1-onboarding-chat

@krrishdholakia
Copy link
Contributor

cc: @Manouchehri are you seeing any issues with vertex ai function calling?

It works fine on my end

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

2 participants