Module: Legion::Extensions::Ollama::Runners::Embeddings
- Extended by:
- Helpers::Client
- Includes:
- Helpers::Lex
- Included in:
- Client
- Defined in:
- lib/legion/extensions/ollama/runners/embeddings.rb
Constant Summary
Constants included from Helpers::Client
Instance Method Summary collapse
Methods included from Helpers::Client
Instance Method Details
#embed(model:, input:, truncate: nil, options: nil, keep_alive: nil, dimensions: nil) ⇒ Object
13 14 15 16 17 18 |
# File 'lib/legion/extensions/ollama/runners/embeddings.rb', line 13 def (model:, input:, truncate: nil, options: nil, keep_alive: nil, dimensions: nil, **) body = { model: model, input: input, truncate: truncate, options: , keep_alive: keep_alive, dimensions: dimensions }.compact response = Helpers::Errors.with_retry { client(**).post('/api/embed', body) } { result: response.body, status: response.status } end |