Module: RubyLLM::Providers::GPUStack::Embeddings
- Included in:
- ChatCompletions
- Defined in:
- lib/ruby_llm/providers/gpustack/embeddings.rb
Overview
GPUStack's vLLM backend accepts multimodal embeddings as messages.
Class Method Summary collapse
- .render_embedding_payload(text, model:, dimensions:, task_type: nil, title: nil, with: [], provider_options: {}) ⇒ Object
- .supports_embedding_media? ⇒ Boolean
Class Method Details
.render_embedding_payload(text, model:, dimensions:, task_type: nil, title: nil, with: [], provider_options: {}) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/ruby_llm/providers/gpustack/embeddings.rb', line 14 def (text, model:, dimensions:, task_type: nil, title: nil, with: [], provider_options: {}) payload = super(text, model:, dimensions:, task_type:, title:, provider_options: {}) if with.any? raise ArgumentError, 'embed one text at a time when embedding attachments' if text.is_a?(Array) payload.delete(:input) payload[:messages] = [{ role: 'user', content: GPUStack::Media.format_content(text, with) }] end payload.merge() end |
.supports_embedding_media? ⇒ Boolean
10 11 12 |
# File 'lib/ruby_llm/providers/gpustack/embeddings.rb', line 10 def true end |