Class: Durable::Llm::Providers::Xai::XaiStreamResponse
- Inherits:
-
Object
- Object
- Durable::Llm::Providers::Xai::XaiStreamResponse
- Defined in:
- lib/durable/llm/providers/xai.rb
Overview
Represents a streaming response chunk from xAI’s API.
Instance Attribute Summary collapse
-
#choices ⇒ Object
readonly
Returns the value of attribute choices.
Instance Method Summary collapse
-
#initialize(parsed) ⇒ XaiStreamResponse
constructor
Initializes the stream response with parsed chunk data.
-
#to_s ⇒ String
Converts the stream response to a string by returning the choice content.
Constructor Details
#initialize(parsed) ⇒ XaiStreamResponse
Initializes the stream response with parsed chunk data.
279 280 281 |
# File 'lib/durable/llm/providers/xai.rb', line 279 def initialize(parsed) @choices = XaiStreamChoice.new(parsed['choices']) end |
Instance Attribute Details
#choices ⇒ Object (readonly)
Returns the value of attribute choices.
274 275 276 |
# File 'lib/durable/llm/providers/xai.rb', line 274 def choices @choices end |
Instance Method Details
#to_s ⇒ String
Converts the stream response to a string by returning the choice content.
286 287 288 |
# File 'lib/durable/llm/providers/xai.rb', line 286 def to_s @choices.to_s end |