Class: Roseflow::OpenAI::TextApiResponse

Inherits:
ApiResponse show all
Defined in:
lib/roseflow/openai/response.rb

Overview

ApiResponse

Direct Known Subclasses

ChatResponse, CompletionResponse, EditResponse

Instance Method Summary collapse

Methods inherited from ApiResponse

#initialize, #status, #success?

Constructor Details

This class inherits a constructor from Roseflow::OpenAI::ApiResponse

Instance Method Details

#bodyObject



30
31
32
# File 'lib/roseflow/openai/response.rb', line 30

def body
  @body ||= ApiResponseBody.new(JSON.parse(@response.body))
end

#choicesObject



34
35
36
# File 'lib/roseflow/openai/response.rb', line 34

def choices
  body.choices.map { |choice| Choice.new(choice) }
end