Module: LlmGateway::Adapters::Groq::OptionMapper

Defined in:
lib/llm_gateway/adapters/groq/option_mapper.rb

Class Method Summary collapse

Class Method Details

.map(options) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/llm_gateway/adapters/groq/option_mapper.rb', line 9

def map(options)
  mapped_options = options.dup
  mapped_options[:temperature] ||= 0
  mapped_options[:max_completion_tokens] ||= 20480
  mapped_options[:response_format] = normalize_response_format(mapped_options[:response_format] || "text")
  mapped_options
end

.normalize_response_format(response_format) ⇒ Object



17
18
19
20
21
22
23
# File 'lib/llm_gateway/adapters/groq/option_mapper.rb', line 17

def normalize_response_format(response_format)
  if response_format.is_a?(String)
    { type: response_format }
  else
    response_format
  end
end