Class: RubyLLM::Protocols::InvokeModel::TitanTextEmbeddings
- Inherits:
-
InvokeModel
- Object
- InvokeModel
- RubyLLM::Protocols::InvokeModel::TitanTextEmbeddings
- Defined in:
- lib/ruby_llm/protocols/invoke_model/titan_text_embeddings.rb
Overview
Amazon Titan text 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_text_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, model:, dimensions:, provider_options:) signed_post((model:), payload).tap { |response| (response) } end (responses, model:, text:) end end |