Added Google GenAI Embeddings
Added Google GenAI Embeddings
- Langchain Google GenAI Embeddings doc: https://python.langchain.com/api_reference/google_genai/embeddings/langchain_google_genai.embeddings.GoogleGenerativeAIEmbeddings.html#langchain_google_genai.embeddings.GoogleGenerativeAIEmbeddings
the new gemini-embedding-exp-03-07 over Gemini API would be nice too
https://ai.google.dev/gemini-api/docs/models#gemini-embedding
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.
@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
@falkenbt yes this works with Google GenAI, I can add VertexAI support in Subsequent PRs
@falkenbt I've implemented VertexAI support in this PR: https://github.com/danny-avila/rag_api/pull/154
wow that was fast, thank you!
@Dual-0 setting the environment variable
EMBEDDINGS_MODELtomodels/gemini-embedding-exp-03-07will allow it to usegemini-embedding-exp-03-07model
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...
Thank you for the PR, please address merge conflicts.
@danny-avila thanks for merging the previous PR, I've resolved the conflict here: https://github.com/danny-avila/rag_api/pull/124/commits/c2ca2828205e4e59a3c5bcbe65412638a505d420
having this merged would be the only reason to use LibreChat for me right now :) can it be merged @danny-avila ?
I resolved conflicts, bumped packages here: https://github.com/danny-avila/rag_api/pull/202
Thanks for your work on this