Sha256: 823e06f18fe52f8684f49a1776e6da12a17f6aa80c7f5f4789b6cff3d654b729

Contents?: true

Size: 488 Bytes

Versions: 19

Compression:

Stored size: 488 Bytes

Contents

class Ollama::Commands::Embeddings
  include Ollama::DTO

  def self.path
    '/api/embeddings'
  end

  def initialize(model:, prompt:, options: nil, keep_alive: nil)
    @model, @prompt, @options, @keep_alive, @stream =
      model, prompt, options, keep_alive, false
  end

  attr_reader :model, :prompt, :options, :keep_alive, :stream

  attr_writer :client

  def perform(handler)
    @client.request(method: :post, path: self.class.path, body: to_json, stream:, handler:)
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
ollama-ruby-0.12.0 lib/ollama/commands/embeddings.rb
ollama-ruby-0.11.0 lib/ollama/commands/embeddings.rb
ollama-ruby-0.10.0 lib/ollama/commands/embeddings.rb
ollama-ruby-0.9.3 lib/ollama/commands/embeddings.rb
ollama-ruby-0.9.2 lib/ollama/commands/embeddings.rb
ollama-ruby-0.9.1 lib/ollama/commands/embeddings.rb
ollama-ruby-0.9.0 lib/ollama/commands/embeddings.rb
ollama-ruby-0.8.0 lib/ollama/commands/embeddings.rb
ollama-ruby-0.7.0 lib/ollama/commands/embeddings.rb
ollama-ruby-0.6.0 lib/ollama/commands/embeddings.rb
ollama-ruby-0.5.0 lib/ollama/commands/embeddings.rb
ollama-ruby-0.4.0 lib/ollama/commands/embeddings.rb
ollama-ruby-0.3.2 lib/ollama/commands/embeddings.rb
ollama-ruby-0.3.1 lib/ollama/commands/embeddings.rb
ollama-ruby-0.3.0 lib/ollama/commands/embeddings.rb
ollama-ruby-0.2.0 lib/ollama/commands/embeddings.rb
ollama-ruby-0.1.0 lib/ollama/commands/embeddings.rb
ollama-ruby-0.0.1 lib/ollama/commands/embeddings.rb
ollama-ruby-0.0.0 lib/ollama/commands/embeddings.rb