Class: LLM::Clients::Gemini::Response
- Inherits:
-
Object
- Object
- LLM::Clients::Gemini::Response
- Defined in:
- lib/llm/clients/gemini/response.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(raw_response) ⇒ Response
constructor
A new instance of Response.
- #to_normalized_response ⇒ Object
Constructor Details
#initialize(raw_response) ⇒ Response
Returns a new instance of Response.
7 8 9 |
# File 'lib/llm/clients/gemini/response.rb', line 7 def initialize(raw_response) @raw_response = raw_response end |
Class Method Details
.normalize_stop_reason(stop_reason) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/llm/clients/gemini/response.rb', line 20 def self.normalize_stop_reason(stop_reason) case stop_reason when "STOP" LLM::StopReason::STOP when "MAX_TOKENS" LLM::StopReason::MAX_TOKENS when "SAFETY" LLM::StopReason::SAFETY else LLM::StopReason::OTHER end end |
Instance Method Details
#to_normalized_response ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/llm/clients/gemini/response.rb', line 11 def to_normalized_response LLM::Response.new( content: content, raw_response: parsed_response, stop_reason: translated_stop_reason, structured_output: structured_output ) end |