Class: Durable::Llm::Providers::AzureOpenai::AzureOpenaiResponse
- Inherits:
-
Object
- Object
- Durable::Llm::Providers::AzureOpenai::AzureOpenaiResponse
- Defined in:
- lib/durable/llm/providers/azure_openai.rb
Overview
Response wrapper for Azure OpenAI completion API responses
Instance Attribute Summary collapse
-
#raw_response ⇒ Object
readonly
Returns the value of attribute raw_response.
Instance Method Summary collapse
- #choices ⇒ Object
- #data ⇒ Object
-
#initialize(response) ⇒ AzureOpenaiResponse
constructor
A new instance of AzureOpenaiResponse.
- #to_s ⇒ Object
Constructor Details
#initialize(response) ⇒ AzureOpenaiResponse
243 244 245 |
# File 'lib/durable/llm/providers/azure_openai.rb', line 243 def initialize(response) @raw_response = response end |
Instance Attribute Details
#raw_response ⇒ Object (readonly)
Returns the value of attribute raw_response.
241 242 243 |
# File 'lib/durable/llm/providers/azure_openai.rb', line 241 def raw_response @raw_response end |
Instance Method Details
#choices ⇒ Object
247 248 249 |
# File 'lib/durable/llm/providers/azure_openai.rb', line 247 def choices @raw_response['choices'].map { |choice| AzureOpenaiChoice.new(choice) } end |
#data ⇒ Object
251 252 253 |
# File 'lib/durable/llm/providers/azure_openai.rb', line 251 def data @raw_response['data'] end |
#to_s ⇒ Object
255 256 257 |
# File 'lib/durable/llm/providers/azure_openai.rb', line 255 def to_s choices.map(&:to_s).join(' ') end |