Class: Durable::Llm::Providers::AzureOpenai::AzureOpenaiStreamChoice
- Inherits:
-
Object
- Object
- Durable::Llm::Providers::AzureOpenai::AzureOpenaiStreamChoice
- Defined in:
- lib/durable/llm/providers/azure_openai.rb
Overview
Stream choice wrapper for Azure OpenAI streaming responses
Instance Attribute Summary collapse
-
#delta ⇒ Object
readonly
Returns the value of attribute delta.
-
#finish_reason ⇒ Object
readonly
Returns the value of attribute finish_reason.
Instance Method Summary collapse
-
#initialize(choice) ⇒ AzureOpenaiStreamChoice
constructor
A new instance of AzureOpenaiStreamChoice.
- #to_s ⇒ Object
Constructor Details
#initialize(choice) ⇒ AzureOpenaiStreamChoice
Returns a new instance of AzureOpenaiStreamChoice.
318 319 320 321 322 |
# File 'lib/durable/llm/providers/azure_openai.rb', line 318 def initialize(choice) @choice = [choice].flatten.first @delta = AzureOpenaiStreamDelta.new(@choice['delta']) @finish_reason = @choice['finish_reason'] end |
Instance Attribute Details
#delta ⇒ Object (readonly)
Returns the value of attribute delta.
316 317 318 |
# File 'lib/durable/llm/providers/azure_openai.rb', line 316 def delta @delta end |
#finish_reason ⇒ Object (readonly)
Returns the value of attribute finish_reason.
316 317 318 |
# File 'lib/durable/llm/providers/azure_openai.rb', line 316 def finish_reason @finish_reason end |
Instance Method Details
#to_s ⇒ Object
324 325 326 |
# File 'lib/durable/llm/providers/azure_openai.rb', line 324 def to_s @delta.to_s end |