Skip to content

Added Google GenAI Embeddings #124

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

yihyang
Copy link
Contributor

@yihyang yihyang commented Mar 2, 2025

@Dual-0
Copy link

Dual-0 commented May 4, 2025

the new gemini-embedding-exp-03-07 over Gemini API would be nice too
https://ai.google.dev/gemini-api/docs/models#gemini-embedding

@falkenbt
Copy link

This will only work with an API key and not via Vertex API, correct? Would be really nice to have this for Vertex as well.

@yihyang
Copy link
Contributor Author

yihyang commented May 28, 2025

@Dual-0 setting the environment variable EMBEDDINGS_MODEL to models/gemini-embedding-exp-03-07 will allow it to use gemini-embedding-exp-03-07 model

@yihyang
Copy link
Contributor Author

yihyang commented May 28, 2025

@falkenbt yes this works with Google GenAI, I can add VertexAI support in Subsequent PRs

@yihyang
Copy link
Contributor Author

yihyang commented May 28, 2025

@falkenbt I've implemented VertexAI support in this PR: #154

@falkenbt
Copy link

wow that was fast, thank you!

@Dual-0
Copy link

Dual-0 commented Jun 4, 2025

@Dual-0 setting the environment variable EMBEDDINGS_MODEL to models/gemini-embedding-exp-03-07 will allow it to use gemini-embedding-exp-03-07 model

with EMBEDDINGS_PROVIDER=google or and EMBEDDINGS_MODEL=models/gemini-embedding-exp-03-07:

  File "/app/app/config.py", line 234, in <module>
    EMBEDDINGS_PROVIDER = EmbeddingsProvider(
  File "/usr/local/lib/python3.10/enum.py", line 385, in __call__
    return cls.__new__(cls, value)
  File "/usr/local/lib/python3.10/enum.py", line 710, in __new__
    raise ve_exc
ValueError: 'google' is not a valid EmbeddingsProvider

or google_genai

...
ValueError: 'google_genai' is not a valid EmbeddingsProvider

only with EMBEDDINGS_MODEL=models/gemini-embedding-exp-03-07:

openai.BadRequestError: Error code: 400 - {'error': {'message': 'invalid model ID', 'type': 'invalid_request_error', 'param': None, 'code': None}}

I will wait for merge...

@danny-avila
Copy link
Owner

Thank you for the PR, please address merge conflicts.

@@ -26,6 +26,7 @@ class EmbeddingsProvider(Enum):
HUGGINGFACETEI = "huggingfacetei"
OLLAMA = "ollama"
BEDROCK = "bedrock"
GOOGLE_GENAI = "google_genai"
GOOGLE_VERTEXAI = "vertexai"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@danny-avila should I rename this to make the naming consistent, similar to google_genai?

Suggested change
GOOGLE_VERTEXAI = "vertexai"
GOOGLE_VERTEXAI = "google_vertexai"

@yihyang
Copy link
Contributor Author

yihyang commented Jun 11, 2025

@danny-avila thanks for merging the previous PR, I've resolved the conflict here: c2ca282

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

Successfully merging this pull request may close these issues.

4 participants