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]: Support to Google AI Studio #8467

Closed
Vidit-Ostwal opened this issue Feb 11, 2025 · 2 comments
Closed

[Bug]: Support to Google AI Studio #8467

Vidit-Ostwal opened this issue Feb 11, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@Vidit-Ostwal
Copy link

What happened?

I am trying to call litellm with google studio api, but got this error.

Here is the code

import litellm

from litellm import completion
import os

# litellm._turn_on_debug()
response = completion(
  model="gemini/gemini-1.5-pro",
  messages=[{'role': 'system', 'content': 'Determine if the following feedback indicates that the user is satisfied or if further changes are needed. Respond with \'True\' if further changes are needed, or \'False\' if the user is satisfied. **Important** Do not include any additional commentary outside of your \'True\' or \'False\' response.\n\nFeedback: "Yellow"'}],
  api_key=''
)

the error I am getting

BadRequestError: litellm.BadRequestError: VertexAIException BadRequestError - {
  "error": {
    "code": 400,
    "message": "* GenerateContentRequest.contents: contents is not specified\n",
    "status": "INVALID_ARGUMENT"
  }
}

Relevant log output

Are you a ML Ops Team?

No

What LiteLLM version are you on ?

1.60.2

Twitter / LinkedIn details

No response

@Vidit-Ostwal Vidit-Ostwal added the bug Something isn't working label Feb 11, 2025
@keenranger
Copy link

    messages=[
        {
            "role": "system",
            "content": "Determine if the following feedback indicates that the user is satisfied or if further changes are needed. Respond with 'True' if further changes are needed, or 'False' if the user is satisfied. **Important** Do not include any additional commentary outside of your 'True' or 'False' response.\n\nFeedback: \"Yellow\"",
        },
        {
            "role": "user",
            "content": "What is the color of the sky?",
        },
    ]

Why don't you add user message.

@Vidit-Ostwal
Copy link
Author

Thanks @keenranger, this works, this was pretty dumb from my side.

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