Class: RubyLLM::Protocols::InvokeModel::NovaEmbeddings
- Inherits:
-
InvokeModel
- Object
- InvokeModel
- RubyLLM::Protocols::InvokeModel::NovaEmbeddings
- Defined in:
- lib/ruby_llm/protocols/invoke_model/nova_embeddings.rb
Overview
Amazon Nova multimodal embedding models over Bedrock InvokeModel.
Constant Summary collapse
- DEFAULT_EMBEDDING_PURPOSE =
'GENERIC_INDEX'
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
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/ruby_llm/protocols/invoke_model/nova_embeddings.rb', line 11 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:, task_type:, provider_options:) signed_post((model:), payload).tap { |response| (response) } end (responses, model:, text:) end end |