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

refactor(embeddings builder): update trait #88

Closed
marieaurore123 opened this issue Nov 6, 2024 · 1 comment
Closed

refactor(embeddings builder): update trait #88

marieaurore123 opened this issue Nov 6, 2024 · 1 comment
Assignees
Labels
Milestone

Comments

@marieaurore123
Copy link
Contributor

marieaurore123 commented Nov 6, 2024

  • Change ExtractEmbeddableTrait to:
pub trait Embed {
    fn embed(&self, embedder: &mut Embedder) -> Result<(), EmbedError>;
}

#[derive(Default)]
pub struct Embedder {
    pub texts: Vec<String>,
}

impl Embedder {
    pub fn embed(&mut self, text: String) {
        self.texts.push(text);
    }
}
  • Update macro accordingly
  • On build() method, catch errors about exceeding token limit
  • Add rig::to_embed(item: impl Embed) -> Vec<String> function
  • EmbeddingsBuilder.documents() must take an iterator
@marieaurore123 marieaurore123 self-assigned this Nov 6, 2024
@mateobelanger mateobelanger added this to the v0.5 milestone Nov 12, 2024
@0xMochan 0xMochan changed the title refactor(embbedings builder): update trait refactor(embeddings builder): update trait Dec 9, 2024
@cvauclair
Copy link
Contributor

Closed by #120

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants