Class: Ollama::Commands::Embed
- Inherits:
-
Object
- Object
- Ollama::Commands::Embed
- Includes:
- DTO
- Defined in:
- lib/ollama/commands/embed.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
writeonly
Sets the attribute client.
-
#input ⇒ Object
readonly
Returns the value of attribute input.
-
#keep_alive ⇒ Object
readonly
Returns the value of attribute keep_alive.
-
#model ⇒ Object
readonly
Returns the value of attribute model.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#stream ⇒ Object
readonly
Returns the value of attribute stream.
-
#truncate ⇒ Object
readonly
Returns the value of attribute truncate.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(model:, input:, options: nil, truncate: nil, keep_alive: nil) ⇒ Embed
constructor
A new instance of Embed.
- #perform(handler) ⇒ Object
Methods included from DTO
#as_array_of_hashes, #as_json, #empty?, #to_json
Constructor Details
#initialize(model:, input:, options: nil, truncate: nil, keep_alive: nil) ⇒ Embed
Returns a new instance of Embed.
8 9 10 11 12 |
# File 'lib/ollama/commands/embed.rb', line 8 def initialize(model:, input:, options: nil, truncate: nil, keep_alive: nil) @model, @input, @options, @truncate, @keep_alive = model, input, , truncate, keep_alive @stream = false end |
Instance Attribute Details
#client=(value) ⇒ Object (writeonly)
Sets the attribute client
16 17 18 |
# File 'lib/ollama/commands/embed.rb', line 16 def client=(value) @client = value end |
#input ⇒ Object (readonly)
Returns the value of attribute input.
14 15 16 |
# File 'lib/ollama/commands/embed.rb', line 14 def input @input end |
#keep_alive ⇒ Object (readonly)
Returns the value of attribute keep_alive.
14 15 16 |
# File 'lib/ollama/commands/embed.rb', line 14 def keep_alive @keep_alive end |
#model ⇒ Object (readonly)
Returns the value of attribute model.
14 15 16 |
# File 'lib/ollama/commands/embed.rb', line 14 def model @model end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
14 15 16 |
# File 'lib/ollama/commands/embed.rb', line 14 def @options end |
#stream ⇒ Object (readonly)
Returns the value of attribute stream.
14 15 16 |
# File 'lib/ollama/commands/embed.rb', line 14 def stream @stream end |
#truncate ⇒ Object (readonly)
Returns the value of attribute truncate.
14 15 16 |
# File 'lib/ollama/commands/embed.rb', line 14 def truncate @truncate end |
Class Method Details
.path ⇒ Object
4 5 6 |
# File 'lib/ollama/commands/embed.rb', line 4 def self.path '/api/embed' end |
Instance Method Details
#perform(handler) ⇒ Object
18 19 20 |
# File 'lib/ollama/commands/embed.rb', line 18 def perform(handler) @client.request(method: :post, path: self.class.path, body: to_json, stream:, handler:) end |