Class: RubyLLM::Protocols::InvokeModel::TitanMultimodalEmbeddings
- Inherits:
-
InvokeModel
- Object
- InvokeModel
- RubyLLM::Protocols::InvokeModel::TitanMultimodalEmbeddings
- Defined in:
- lib/ruby_llm/protocols/invoke_model/titan_multimodal_embeddings.rb
Overview
Amazon Titan multimodal embedding models over Bedrock InvokeModel.
Instance Method Summary collapse
-
#embed(text, model:, dimensions:, task_type: nil, title: nil, with: nil, provider_options: {}) ⇒ Object
rubocop:disable-next Lint/UnusedMethodArgument.
Instance Method Details
#embed(text, model:, dimensions:, task_type: nil, title: nil, with: nil, provider_options: {}) ⇒ Object
rubocop:disable-next Lint/UnusedMethodArgument
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/ruby_llm/protocols/invoke_model/titan_multimodal_embeddings.rb', line 9 def (text, model:, dimensions:, task_type: nil, title: nil, with: nil, provider_options: {}) (with) track_usage(:embedding) do responses = [text].flatten.map do |value| payload = (value, dimensions:, provider_options:) signed_post((model:), payload).tap { |response| (response) } end (responses, model:, text:) end end |