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