Class: Ollama::Params::Chat

Inherits:
Base
  • Object
show all
Defined in:
lib/ollama/params.rb

Overview

Chat completion parameters

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#merge, #to_h

Constructor Details

#initialize(messages:, model: nil, format: nil, tools: nil, stream: nil, think: nil, keep_alive: nil, options: nil, logprobs: nil, top_logprobs: nil, hooks: {}, profile: :auto, inputs: nil) ⇒ Chat

rubocop:disable Metrics/ParameterLists



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/ollama/params.rb', line 29

def initialize(messages:, model: nil, format: nil, tools: nil, stream: nil,
               think: nil, keep_alive: nil, options: nil, logprobs: nil,
               top_logprobs: nil, hooks: {}, profile: :auto, inputs: nil)
  # rubocop:enable Metrics/ParameterLists
  super()
  @messages = messages
  @model = model
  @format = format
  @tools = tools
  @stream = stream
  @think = think
  @keep_alive = keep_alive
  @options = options
  @logprobs = logprobs
  @top_logprobs = top_logprobs
  @hooks = hooks
  @profile = profile
  @inputs = inputs
end

Instance Attribute Details

#formatObject

Returns the value of attribute format.



24
25
26
# File 'lib/ollama/params.rb', line 24

def format
  @format
end

#hooksObject

Returns the value of attribute hooks.



24
25
26
# File 'lib/ollama/params.rb', line 24

def hooks
  @hooks
end

#inputsObject

Returns the value of attribute inputs.



24
25
26
# File 'lib/ollama/params.rb', line 24

def inputs
  @inputs
end

#keep_aliveObject

Returns the value of attribute keep_alive.



24
25
26
# File 'lib/ollama/params.rb', line 24

def keep_alive
  @keep_alive
end

#logprobsObject

Returns the value of attribute logprobs.



24
25
26
# File 'lib/ollama/params.rb', line 24

def logprobs
  @logprobs
end

#messagesObject

Returns the value of attribute messages.



24
25
26
# File 'lib/ollama/params.rb', line 24

def messages
  @messages
end

#modelObject

Returns the value of attribute model.



24
25
26
# File 'lib/ollama/params.rb', line 24

def model
  @model
end

#optionsObject

Returns the value of attribute options.



24
25
26
# File 'lib/ollama/params.rb', line 24

def options
  @options
end

#profileObject

Returns the value of attribute profile.



24
25
26
# File 'lib/ollama/params.rb', line 24

def profile
  @profile
end

#streamObject

Returns the value of attribute stream.



24
25
26
# File 'lib/ollama/params.rb', line 24

def stream
  @stream
end

#thinkObject

Returns the value of attribute think.



24
25
26
# File 'lib/ollama/params.rb', line 24

def think
  @think
end

#toolsObject

Returns the value of attribute tools.



24
25
26
# File 'lib/ollama/params.rb', line 24

def tools
  @tools
end

#top_logprobsObject

Returns the value of attribute top_logprobs.



24
25
26
# File 'lib/ollama/params.rb', line 24

def top_logprobs
  @top_logprobs
end