Class: SimpleRag::Embed
- Inherits:
-
Object
- Object
- SimpleRag::Embed
- Defined in:
- lib/simple_rag/embed.rb
Class Method Summary collapse
Class Method Details
.embed_chunks(client, chunks) ⇒ Object
8 9 10 11 |
# File 'lib/simple_rag/embed.rb', line 8 def self.(client, chunks) = chunks.map { |chunk| (client, chunk) } Numo::DFloat[*] end |
.embed_text(client, input) ⇒ Object
3 4 5 6 |
# File 'lib/simple_rag/embed.rb', line 3 def self.(client, input) = client.({model: "mistral-embed", input: input}) .dig("data", 0, "embedding") end |