Class: Ollama::Parsers::Embeddings
- Defined in:
- lib/ollama/parsers/embeddings.rb
Overview
Parses embeddings responses
Instance Method Summary collapse
- #call(transport_response) ⇒ Object
-
#initialize(provider: nil) ⇒ Embeddings
constructor
A new instance of Embeddings.
Constructor Details
#initialize(provider: nil) ⇒ Embeddings
Returns a new instance of Embeddings.
11 12 13 14 |
# File 'lib/ollama/parsers/embeddings.rb', line 11 def initialize(provider: nil) super() @provider = provider end |
Instance Method Details
#call(transport_response) ⇒ Object
16 17 18 19 20 |
# File 'lib/ollama/parsers/embeddings.rb', line 16 def call(transport_response) data = json(transport_response) data = @provider.(data) if @provider.respond_to?(:normalize_embeddings_response) Responses::Embeddings.new(data) end |