Class: LLM::OpenAI::ResponseParser::RespondParser
- Inherits:
-
Object
- Object
- LLM::OpenAI::ResponseParser::RespondParser
- Defined in:
- lib/llm/providers/openai/response_parser/respond_parser.rb
Instance Method Summary collapse
- #format(response) ⇒ Object
-
#initialize(body) ⇒ RespondParser
constructor
A new instance of RespondParser.
Constructor Details
#initialize(body) ⇒ RespondParser
Returns a new instance of RespondParser.
7 8 9 |
# File 'lib/llm/providers/openai/response_parser/respond_parser.rb', line 7 def initialize(body) @body = LLM::Object.from_hash(body) end |
Instance Method Details
#format(response) ⇒ Object
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/llm/providers/openai/response_parser/respond_parser.rb', line 11 def format(response) { id:, model:, input_tokens:, output_tokens:, total_tokens:, outputs: [(response)] } end |