Class: Durable::Llm::Providers::DeepSeek::DeepSeekResponse

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

Overview

Response wrapper for DeepSeek API responses

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ DeepSeekResponse

Returns a new instance of DeepSeekResponse.



129
130
131
# File 'lib/durable/llm/providers/deepseek.rb', line 129

def initialize(response)
  @raw_response = response
end

Instance Attribute Details

#raw_responseObject (readonly)

Returns the value of attribute raw_response.



127
128
129
# File 'lib/durable/llm/providers/deepseek.rb', line 127

def raw_response
  @raw_response
end

Instance Method Details

#choicesObject



133
134
135
# File 'lib/durable/llm/providers/deepseek.rb', line 133

def choices
  @raw_response['choices'].map { |choice| DeepSeekChoice.new(choice) }
end

#dataObject



137
138
139
# File 'lib/durable/llm/providers/deepseek.rb', line 137

def data
  @raw_response['data']
end

#to_sObject



141
142
143
# File 'lib/durable/llm/providers/deepseek.rb', line 141

def to_s
  choices.map(&:to_s).join(' ')
end