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: Embed Derive and Embedding Documents #277

Open
1 task done
Wilson13 opened this issue Feb 6, 2025 · 3 comments
Open
1 task done

bug: Embed Derive and Embedding Documents #277

Wilson13 opened this issue Feb 6, 2025 · 3 comments
Labels
wontfix This will not be worked on

Comments

@Wilson13
Copy link

Wilson13 commented Feb 6, 2025

  • I have looked for existing issues (including closed) about this

Bug Report

After following the examples for a while, correct me if I'm wrong, it seems like a lot of the code is either outdated or no longer working.

  1. Embed derive macro is not available.
  2. Providing more than one Document for EmbeddingsBuilder resulted in panic.

Reproduction

Run this example: https://github.com/0xPlaygrounds/rig/blob/main/rig-core/examples/gemini_embeddings.rs

Expected behavior

Able to run without errors and get embedding results.

Screenshots

  1. Image
  2. Image

Additional context

It works only if a single document is provided.

This works.

let embeddings = client
  .embeddings(gemini::embedding::EMBEDDING_004)
  .document(Greetings {
      message: "Hello, world!".to_string(),
  })?
  // .document(Greetings {
  //    message: "Goodbye, world!".to_string(),
  // })?
  .build()
  .await
  .expect("Failed to embed documents");

This doesn't work.

let embeddings = client
  .embeddings(gemini::embedding::EMBEDDING_004)
  .document(Greetings {
      message: "Hello, world!".to_string(),
  })?
  .document(Greetings {
      message: "Goodbye, world!".to_string(),
  })?
  .build()
  .await
  .expect("Failed to embed documents");

Thanks for the amazing work. 🙇

@0xMochan
Copy link
Contributor

0xMochan commented Feb 6, 2025

I'm fairly certain you need to have derive trait enabled but I'll ping the author, @marieaurore123

@Wilson13
Copy link
Author

Wilson13 commented Feb 7, 2025

Ok, indeed I just needed to add the derive feature, might have been confused by the different examples. Still looking for a solution for the multiple documents issue.

@joshua-mo-143 joshua-mo-143 added the wontfix This will not be worked on label Feb 24, 2025
@joshua-mo-143
Copy link
Contributor

Marked wontfix because there isn't a specific code change that needs to be made - if you're still having an issue with this please let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants