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

Error when using gemini-1.5-flash model #1987

Open
manyiw99 opened this issue Dec 25, 2024 · 3 comments
Open

Error when using gemini-1.5-flash model #1987

manyiw99 opened this issue Dec 25, 2024 · 3 comments

Comments

@manyiw99
Copy link

When I used gemini model following the instructions in "other provider" tag, there's an error of content generation.
here's my code:

lm = dspy.LM( "gemini/gemini-1.5-flash", api_key=GEMINI_API_KEY, api_base="https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash", )

and the problem is:

`ValueError                                Traceback (most recent call last)
[/usr/local/lib/python3.10/dist-packages/httpx/_urlparse.py](https://as5jcss98q5-496ff2e9c6d22116-0-colab.googleusercontent.com/outputframe.html?vrz=colab_20241219-060121_RC00_707879646#) in normalize_port(port, scheme)
    363     try:
--> 364         port_as_int = int(port)
    365     except ValueError:

ValueError: invalid literal for int() with base 10: 'generateContent'

During handling of the above exception, another exception occurred:`

I changed the api_base to https://generativelanguage.googleapis.com, the error remains the same as well.

@okhat
Copy link
Collaborator

okhat commented Dec 25, 2024

Check the providers page of LiteLLM. They have 2 different providers regarding Gemini and they have all the details there.

https://docs.litellm.ai/docs/providers

@manyiw99
Copy link
Author

Yes I have checked it, but I only found 1 provider which is gemini-google ai studio. When I changed provider to google/gemini-1.5-flash, there's also an error like "cannot find the provider". However, this error is no longer present when I use gemini/gemini-1.5-flash as provider.

@okhat
Copy link
Collaborator

okhat commented Dec 25, 2024

Check this page? https://docs.litellm.ai/docs/providers/vertex

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