Class: Roseflow::OpenRouter::TextApiResponse

Inherits:
ApiResponse
  • Object
show all
Defined in:
lib/roseflow/open_router/response.rb

Direct Known Subclasses

ChatResponse

Instance Method Summary collapse

Methods inherited from ApiResponse

#initialize

Constructor Details

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

Instance Method Details

#bodyObject



20
21
22
# File 'lib/roseflow/open_router/response.rb', line 20

def body
  @body ||= FastJsonparser.parse(@response.body)
end

#choicesObject



24
25
26
# File 'lib/roseflow/open_router/response.rb', line 24

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