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

Support text-multilingual-embedding-002 embedding model #209

Open
MrCsabaToth opened this issue Sep 3, 2024 · 4 comments
Open

Support text-multilingual-embedding-002 embedding model #209

MrCsabaToth opened this issue Sep 3, 2024 · 4 comments
Labels
component:dart sdk Issue/PR related to Dart SDK type:help Support-related issues

Comments

@MrCsabaToth
Copy link

Description of the feature request:

https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/text-embeddings-api lists text-multilingual-embedding-002, however https://ai.google.dev/gemini-api/docs/models/gemini#text-embedding does not. I can successfully instantiate a GenerativeModel, but when I call embedContent like I do with text-embedding-004 it errors out with:

models/text-multilingual-embedding-002 is not found for API version v1beta, or is not supported for embedContent. Call ListModels to see the list of available models and their supported methods.

What problem are you trying to solve with this feature?

I'd like an application to support multiple languages. I inspected embeddings of equivalent sentences on Vertex AI with the text-multilingual-embedding-002 and they were close. Unfortunately text-embedding-004 doesn't seem to be good with the language I tested.

Any other information you'd like to share?

My code:

    final model = GenerativeModel(
      model: 'text-multilingual-embedding-002',
      apiKey: preferences.geminiApiKey,
    );
    final content = Content.text(prompt);
    final embeddingResult = await model.embedContent(content);
@davidmigloz
Copy link
Contributor

davidmigloz commented Sep 3, 2024

Unfortunately, text-multilingual-embedding-002 is only available in VertexAI, not via the Google AI API (which is what this SDK is for). You can use firebase_vertexai package instead.

@MrCsabaToth
Copy link
Author

Unfortunately, text-multilingual-embedding-002 is only available in VertexAI, not via the Google AI API (which is what this SDK is for). You can use firebase_vertexai package instead.

Thanks, I'll get to the bottom of this. Interestingly with Firebase Vertex AI I could not use text-multilingual-embedding-002 and even text-embedding-004. It depends on generative-ai-dart package and the object hierarchy is similar (hence I created https://imgflip.com/i/92caxj). firebase/flutterfire#13269

@MrCsabaToth
Copy link
Author

@davidmigloz What's the best repository or issue tracker to advocate for inclusion of the multilingual embedding model into Google AI API?

@davidmigloz
Copy link
Contributor

(hence I created https://imgflip.com/i/92caxj)

🤣🤣 Yeah, both APIs are very similar (but not identical), so they reuse the client.

@davidmigloz What's the best repository or issue tracker to advocate for inclusion of the multilingual embedding model into Google AI API?

On the docs page, there's a feedback button in the top right corner, I normally use that channel. Otherwise, there's a gemini-api channel on the Google Developer Community Discord, which is monitored by people on the team. Last but not least, you can always ping Logan on X, he's pretty responsive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:dart sdk Issue/PR related to Dart SDK type:help Support-related issues
Projects
None yet
Development

No branches or pull requests

3 participants