Module: LLM::DeepSeek::ResponseAdapter

Defined in:
lib/llm/providers/deepseek/response_adapter.rb,
lib/llm/providers/deepseek/response_adapter/image.rb

Defined Under Namespace

Modules: Image

Class Method Summary collapse

Class Method Details

.adapt(res, type:) ⇒ LLM::Response

Parameters:

Returns:



14
15
16
17
18
# File 'lib/llm/providers/deepseek/response_adapter.rb', line 14

def adapt(res, type:)
  response = (LLM::Response === res) ? res : LLM::Response.new(res)
  adapter = select(type)
  response.extend(adapter)
end

.select(type) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



22
23
24
25
26
27
# File 'lib/llm/providers/deepseek/response_adapter.rb', line 22

def select(type)
  case type
  when :image then LLM::DeepSeek::ResponseAdapter::Image
  else LLM::OpenAI::ResponseAdapter.select(type)
  end
end