Class: Durable::Llm::Providers::Mistral::MistralStreamResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/durable/llm/providers/mistral.rb

Overview

Response object for streaming Mistral AI API responses

Wraps streaming response chunks and provides access to streaming choices.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(parsed) ⇒ MistralStreamResponse

Initializes a new streaming response object

Parameters:

  • parsed (Hash)

    The parsed streaming response data



339
340
341
# File 'lib/durable/llm/providers/mistral.rb', line 339

def initialize(parsed)
  @choices = MistralStreamChoice.new(parsed['choices'])
end

Instance Attribute Details

#choicesObject (readonly)

Returns the value of attribute choices.



334
335
336
# File 'lib/durable/llm/providers/mistral.rb', line 334

def choices
  @choices
end

Instance Method Details

#to_sString

Returns the text content of the streaming response

Returns:

  • (String)

    The text content from the streaming choice



346
347
348
# File 'lib/durable/llm/providers/mistral.rb', line 346

def to_s
  @choices.to_s
end