diff --git a/config/test.exs b/config/test.exs index 826cb1e1f..a1ca73e20 100644 --- a/config/test.exs +++ b/config/test.exs @@ -279,6 +279,11 @@ config :llm_db, family: "command", capabilities: %{chat: true}, limits: %{context: 4096, output: 4096} + }, + "cohere.embed-english-v3" => %{ + name: "Cohere Embed English v3", + family: "embed", + capabilities: %{embeddings: true} } } ], @@ -318,6 +323,7 @@ config :req_llm, :sample_embedding_models, ~w( openai:text-embedding-3-small google:text-embedding-004 azure:text-embedding-3-small + amazon_bedrock:cohere.embed-english-v3 ) config :req_llm, :sample_text_models, ~w( anthropic:claude-3-5-haiku-20241022 diff --git a/lib/req_llm/providers/amazon_bedrock.ex b/lib/req_llm/providers/amazon_bedrock.ex index 09300c689..44106d483 100644 --- a/lib/req_llm/providers/amazon_bedrock.ex +++ b/lib/req_llm/providers/amazon_bedrock.ex @@ -177,6 +177,29 @@ defmodule ReqLLM.Providers.AmazonBedrock do default: "default", doc: "Service tier for request prioritization. Priority provides faster responses at higher cost, Flex is more cost-effective with longer latency." + ], + input_type: [ + type: {:in, ["search_document", "search_query", "classification", "clustering"]}, + default: "search_document", + doc: "Input type for Cohere embedding models" + ], + embedding_types: [ + type: {:list, {:in, ["float", "int8", "uint8", "binary", "ubinary"]}}, + default: ["float"], + doc: "Output formats for Cohere embeddings" + ], + truncate: [ + type: {:in, ["NONE", "LEFT", "RIGHT"]}, + default: "NONE", + doc: "Truncation strategy for Cohere embedding models" + ], + images: [ + type: {:list, :string}, + doc: "List of base64-encoded images for Cohere image embeddings" + ], + inputs: [ + type: {:list, :map}, + doc: "List of mixed content parts for Cohere interleaved embeddings" ] ] @@ -188,6 +211,10 @@ defmodule ReqLLM.Providers.AmazonBedrock do "meta" => ReqLLM.Providers.AmazonBedrock.Meta } + @embedding_families %{ + "cohere" => ReqLLM.Providers.AmazonBedrock.Cohere + } + def default_base_url do # Override to handle region template "https://bedrock-runtime.{region}.amazonaws.com" @@ -248,11 +275,35 @@ defmodule ReqLLM.Providers.AmazonBedrock do end end + @impl ReqLLM.Provider + def prepare_request(:embedding, model_input, text, opts) do + with {:ok, model} <- ReqLLM.model(model_input) do + http_opts = Keyword.get(opts, :req_http_options, []) + model_id = model.provider_model_id || model.id + + timeout = + Keyword.get( + opts, + :receive_timeout, + Application.get_env(:req_llm, :receive_timeout, 30_000) + ) + + request = + Req.new( + [url: "/model/#{model_id}/invoke", method: :post, receive_timeout: timeout] ++ + http_opts + ) + |> attach_embedding(model, Keyword.put(opts, :text, text)) + + {:ok, request} + end + end + def prepare_request(operation, _model, _input, _opts) do {:error, InvalidParameter.exception( parameter: - "operation: #{inspect(operation)} not supported by Bedrock provider. Supported operations: [:chat, :object]" + "operation: #{inspect(operation)} not supported by Bedrock provider. Supported operations: [:chat, :object, :embedding]" )} end @@ -293,15 +344,7 @@ defmodule ReqLLM.Providers.AmazonBedrock do operation ) - # Construct the base URL with region - region = - case aws_creds do - %{region: r} when is_binary(r) -> r - %{region: _} -> "us-east-1" - %AWSAuth.Credentials{region: r} when is_binary(r) -> r - %AWSAuth.Credentials{} -> "us-east-1" - _ -> "us-east-1" - end + region = extract_region(aws_creds) base_url = "https://bedrock-runtime.#{region}.amazonaws.com" @@ -399,6 +442,63 @@ defmodule ReqLLM.Providers.AmazonBedrock do |> ReqLLM.Step.Fixture.maybe_attach(model, user_opts) end + def attach_embedding(%Req.Request{} = request, model_input, user_opts) do + %LLMDB.Model{} = + model = + case ReqLLM.model(model_input) do + {:ok, m} -> m + {:error, err} -> raise err + end + + if model.provider != provider_id() do + raise Error.Invalid.Provider.exception(provider: model.provider) + end + + {aws_creds, other_opts} = extract_aws_credentials(user_opts) + validate_aws_credentials!(aws_creds) + + processed_opts = + case ReqLLM.Provider.Options.process(__MODULE__, :embedding, model, other_opts) do + {:ok, opts} -> opts + {:error, error} -> raise error + end + + region = extract_region(aws_creds) + + base_url = "https://bedrock-runtime.#{region}.amazonaws.com" + model_id = model.provider_model_id || model.id + {model_family, formatter} = get_embedding_formatter(model_id) + + text = processed_opts[:text] + + case formatter.format_embedding_request(model_id, text, processed_opts) do + {:ok, model_body} -> + updated_request = + request + |> Map.put(:url, URI.parse(base_url <> "/model/#{model_id}/invoke")) + |> Req.Request.register_options([:model, :text, :operation, :model_family]) + |> Req.Request.merge_options( + base_url: base_url, + model: model_id, + operation: :embedding, + model_family: model_family + ) + |> Req.Request.put_header("content-type", "application/json") + |> Req.Request.put_private(:req_llm_model, model) + |> Map.put(:body, Jason.encode!(model_body)) + + updated_request + |> Step.Error.attach() + |> ReqLLM.Step.Retry.attach() + |> put_aws_sigv4(aws_creds) + |> Req.Request.append_response_steps(llm_decode_embedding: &decode_embedding_response/1) + |> ReqLLM.Step.Fixture.maybe_attach(model, user_opts) + + {:error, error} -> + raise error + end + end + @impl ReqLLM.Provider def attach_stream(model, context, opts, _finch_name) do # Get AWS credentials @@ -713,6 +813,21 @@ defmodule ReqLLM.Providers.AmazonBedrock do defp validate_aws_credentials!(%AWSAuth.Credentials{}), do: :ok + defp extract_region(aws_creds) do + case aws_creds do + %{region: r} when is_binary(r) -> r + %AWSAuth.Credentials{region: r} when is_binary(r) -> r + _ -> "us-east-1" + end + end + + defp strip_region_prefix(model_id) do + case String.split(model_id, ".", parts: 2) do + [region, rest] when region in ["us", "eu", "ap", "ca", "global"] -> rest + _ -> model_id + end + end + # API Key authentication - use Bearer token defp put_aws_sigv4(request, %{api_key: api_key}) when is_binary(api_key) do Req.Request.put_header(request, "authorization", "Bearer #{api_key}") @@ -800,14 +915,7 @@ defmodule ReqLLM.Providers.AmazonBedrock do end defp get_model_family(model_id) do - normalized_id = - case String.split(model_id, ".", parts: 2) do - [possible_region, rest] when possible_region in ["us", "eu", "ap", "ca", "global"] -> - rest - - _ -> - model_id - end + normalized_id = strip_region_prefix(model_id) found_family = @model_families @@ -830,6 +938,30 @@ defmodule ReqLLM.Providers.AmazonBedrock do """ end + defp get_embedding_formatter(model_id) do + normalized_id = strip_region_prefix(model_id) + + result = + @embedding_families + |> Enum.find(fn {prefix, _module} -> + String.starts_with?(normalized_id, prefix <> ".") + end) + + case result do + {family, formatter} -> + {family, formatter} + + nil -> + supported = Map.keys(@embedding_families) |> Enum.join(", ") + + raise InvalidParameter.exception( + parameter: + "Embedding not supported for model: #{model_id}. " <> + "Supported embedding model families: #{supported}" + ) + end + end + @impl ReqLLM.Provider def translate_options(operation, model, opts) do # Delegate to native Anthropic option translation for Anthropic models @@ -953,6 +1085,35 @@ defmodule ReqLLM.Providers.AmazonBedrock do {req, err} end + defp decode_embedding_response({req, %{status: 200} = resp}) do + if req.private[:llm_fixture_replay] do + {req, resp} + else + parsed_body = ensure_parsed_body(resp.body) + model_family = req.options[:model_family] + formatter = Map.get(@embedding_families, model_family) + + case formatter.parse_embedding_response(parsed_body) do + {:ok, normalized_response} -> + {req, %{resp | body: normalized_response}} + + {:error, error} -> + {req, error} + end + end + end + + defp decode_embedding_response({req, resp}) do + err = + Error.API.Response.exception( + reason: "Bedrock embedding API error", + status: resp.status, + response_body: resp.body + ) + + {req, err} + end + @impl ReqLLM.Provider def thinking_constraints do # AWS Bedrock requires temperature=1.0 when extended thinking is enabled diff --git a/lib/req_llm/providers/amazon_bedrock/cohere.ex b/lib/req_llm/providers/amazon_bedrock/cohere.ex new file mode 100644 index 000000000..3b21fb800 --- /dev/null +++ b/lib/req_llm/providers/amazon_bedrock/cohere.ex @@ -0,0 +1,241 @@ +defmodule ReqLLM.Providers.AmazonBedrock.Cohere do + @moduledoc """ + Cohere model family support for AWS Bedrock. + + Currently supports Cohere embedding models (cohere.embed-v4) on AWS Bedrock. + + ## Supported Models + + - `cohere.embed-v4:0` - Cohere Embed v4 with support for text and image embeddings + + ## Input Modes + + Cohere Embed v4 supports three input modes: + + 1. **Text-only** - Pass strings directly via the `text` parameter + 2. **Image-only** - Pass base64-encoded images via `:images` provider option + 3. **Mixed (interleaved)** - Pass content parts via `:inputs` provider option + + """ + + alias ReqLLM.Error + + @content_part_schema Zoi.object(%{ + type: Zoi.enum(["text", "image_url"]), + text: Zoi.optional(Zoi.string()), + image_url: Zoi.optional(Zoi.string()) + }) + + @input_item_schema Zoi.object(%{ + content: Zoi.array(@content_part_schema) + }) + + @embedding_request_schema Zoi.object(%{ + input_type: + Zoi.enum([ + "search_document", + "search_query", + "classification", + "clustering" + ]) + |> Zoi.default("search_document"), + embedding_types: + Zoi.array( + Zoi.enum(["float", "int8", "uint8", "binary", "ubinary"]) + ) + |> Zoi.default(["float"]), + texts: Zoi.optional(Zoi.array(Zoi.string())), + images: Zoi.optional(Zoi.array(Zoi.string())), + inputs: Zoi.optional(Zoi.array(@input_item_schema)), + output_dimension: Zoi.optional(Zoi.enum([256, 512, 1024, 1536])), + max_tokens: + Zoi.number() |> Zoi.min(1) |> Zoi.max(128_000) |> Zoi.optional(), + truncate: Zoi.optional(Zoi.enum(["NONE", "LEFT", "RIGHT"])) + }) + + @embedding_response_schema Zoi.object(%{ + embeddings: + Zoi.any(metadata: [description: "Embeddings in various formats"]), + texts: Zoi.optional(Zoi.array(Zoi.string())), + response_type: Zoi.optional(Zoi.string()) + }) + + def embedding_request_schema, do: @embedding_request_schema + def embedding_response_schema, do: @embedding_response_schema + + @doc """ + Formats text, images, or mixed content into Cohere embedding request format for Bedrock. + """ + def format_embedding_request(_model_id, text, opts) do + provider_opts = opts[:provider_options] || [] + + request_data = %{ + input_type: provider_opts[:input_type] || "search_document", + embedding_types: provider_opts[:embedding_types] || ["float"] + } + + request_data = + request_data + |> add_input_content(text, provider_opts) + |> maybe_put(:output_dimension, opts[:dimensions] || provider_opts[:dimensions]) + |> maybe_put(:truncate, provider_opts[:truncate]) + |> maybe_put(:max_tokens, provider_opts[:max_tokens]) + + case Zoi.parse(@embedding_request_schema, request_data) do + {:ok, validated} -> + {:ok, to_json_keys(validated)} + + {:error, errors} -> + {:error, + Error.Validation.Error.exception( + tag: :invalid_embedding_request, + reason: format_zoi_errors(errors), + context: [request: request_data] + )} + end + end + + defp add_input_content(request, text, provider_opts) do + cond do + provider_opts[:inputs] != nil -> + Map.put(request, :inputs, format_inputs(provider_opts[:inputs])) + + provider_opts[:images] != nil -> + Map.put(request, :images, provider_opts[:images]) + + is_list(text) and not Enum.empty?(text) -> + Map.put(request, :texts, text) + + is_binary(text) and text != "" -> + Map.put(request, :texts, [text]) + + true -> + request + end + end + + defp format_inputs(inputs) when is_list(inputs) do + Enum.map(inputs, fn + %{content: content} when is_list(content) -> + %{content: Enum.map(content, &format_content_part/1)} + + input -> + input + end) + end + + defp format_content_part(%{type: type, text: text}) when type in ["text", :text] do + %{type: "text", text: text} + end + + defp format_content_part(%{type: type, image_url: url}) + when type in ["image_url", :image_url] do + %{type: "image_url", image_url: url} + end + + defp format_content_part(part), do: part + + @doc """ + Parses Cohere embedding response into OpenAI-compatible format. + """ + def parse_embedding_response(response) when is_map(response) do + case Zoi.parse(@embedding_response_schema, atomize_keys(response)) do + {:ok, validated} -> + extract_embeddings(validated) + + {:error, errors} -> + {:error, + Error.API.Response.exception( + reason: "Invalid Cohere embedding response: #{format_zoi_errors(errors)}", + response_body: response + )} + end + end + + def parse_embedding_response(response) do + {:error, + Error.API.Response.exception( + reason: "Expected map response from Cohere embedding API", + response_body: response + )} + end + + defp extract_embeddings(%{embeddings: %{float: embeddings}}) when is_list(embeddings) do + data = build_embedding_data(embeddings) + {:ok, %{"data" => data}} + end + + defp extract_embeddings(%{embeddings: embeddings}) when is_list(embeddings) do + data = build_embedding_data(embeddings) + {:ok, %{"data" => data}} + end + + defp extract_embeddings(%{embeddings: embeddings}) when is_map(embeddings) do + float_embeddings = Map.get(embeddings, :float) || Map.get(embeddings, "float") + + if is_list(float_embeddings) do + data = build_embedding_data(float_embeddings) + {:ok, %{"data" => data}} + else + {:error, + Error.API.Response.exception( + reason: "No float embeddings found in response", + response_body: embeddings + )} + end + end + + defp extract_embeddings(response) do + {:error, + Error.API.Response.exception( + reason: "Unexpected embedding response structure", + response_body: response + )} + end + + defp build_embedding_data(embeddings) do + embeddings + |> Enum.with_index() + |> Enum.map(fn {embedding, idx} -> + %{"index" => idx, "embedding" => embedding} + end) + end + + defp to_json_keys(map) when is_map(map) do + Map.new(map, fn + {k, v} when is_atom(k) -> {Atom.to_string(k), to_json_keys(v)} + {k, v} -> {k, to_json_keys(v)} + end) + end + + defp to_json_keys(list) when is_list(list), do: Enum.map(list, &to_json_keys/1) + defp to_json_keys(value), do: value + + defp atomize_keys(map) when is_map(map) do + Map.new(map, fn + {k, v} when is_binary(k) -> {safe_to_existing_atom(k), atomize_keys(v)} + {k, v} -> {k, atomize_keys(v)} + end) + end + + defp atomize_keys(list) when is_list(list), do: Enum.map(list, &atomize_keys/1) + defp atomize_keys(value), do: value + + defp safe_to_existing_atom(string) do + String.to_existing_atom(string) + rescue + ArgumentError -> string + end + + defp maybe_put(map, _key, nil), do: map + defp maybe_put(map, key, value), do: Map.put(map, key, value) + + defp format_zoi_errors(errors) do + Enum.map_join(errors, ", ", fn %Zoi.Error{path: path, message: message} -> + case path do + [] -> message + _ -> "#{Enum.map_join(path, ".", &to_string/1)}: #{message}" + end + end) + end +end diff --git a/test/coverage/amazon_bedrock/embedding_test.exs b/test/coverage/amazon_bedrock/embedding_test.exs new file mode 100644 index 000000000..f6e448f89 --- /dev/null +++ b/test/coverage/amazon_bedrock/embedding_test.exs @@ -0,0 +1,13 @@ +defmodule ReqLLM.Coverage.AmazonBedrock.EmbeddingTest do + @moduledoc """ + Amazon Bedrock embedding API feature coverage tests. + + Run with REQ_LLM_FIXTURES_MODE=record to test against live API and record fixtures. + Otherwise uses fixtures for fast, reliable testing. + + Note: Bedrock requires AWS credentials (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION) + or a bearer token (AWS_BEARER_TOKEN_BEDROCK) when recording fixtures. + """ + + use ReqLLM.ProviderTest.Embedding, provider: :amazon_bedrock +end diff --git a/test/provider/amazon_bedrock/cohere_test.exs b/test/provider/amazon_bedrock/cohere_test.exs new file mode 100644 index 000000000..60d6aeaf7 --- /dev/null +++ b/test/provider/amazon_bedrock/cohere_test.exs @@ -0,0 +1,152 @@ +defmodule ReqLLM.Providers.AmazonBedrock.CohereTest do + use ExUnit.Case, async: true + + alias ReqLLM.Providers.AmazonBedrock.Cohere + + describe "format_embedding_request/3" do + test "formats single text input" do + {:ok, result} = Cohere.format_embedding_request("cohere.embed-v4:0", "Hello world", []) + + assert result["texts"] == ["Hello world"] + assert result["input_type"] == "search_document" + assert result["embedding_types"] == ["float"] + end + + test "formats list of texts" do + texts = ["Hello", "World"] + {:ok, result} = Cohere.format_embedding_request("cohere.embed-v4:0", texts, []) + + assert result["texts"] == ["Hello", "World"] + end + + test "uses custom input_type from provider_options" do + opts = [provider_options: [input_type: "search_query"]] + {:ok, result} = Cohere.format_embedding_request("cohere.embed-v4:0", "query", opts) + + assert result["input_type"] == "search_query" + end + + test "uses custom embedding_types from provider_options" do + opts = [provider_options: [embedding_types: ["float", "int8"]]] + {:ok, result} = Cohere.format_embedding_request("cohere.embed-v4:0", "text", opts) + + assert result["embedding_types"] == ["float", "int8"] + end + + test "includes dimensions when specified" do + opts = [dimensions: 512] + {:ok, result} = Cohere.format_embedding_request("cohere.embed-v4:0", "text", opts) + + assert result["output_dimension"] == 512 + end + + test "includes truncate when specified" do + opts = [provider_options: [truncate: "LEFT"]] + {:ok, result} = Cohere.format_embedding_request("cohere.embed-v4:0", "text", opts) + + assert result["truncate"] == "LEFT" + end + + test "includes max_tokens when specified" do + opts = [provider_options: [max_tokens: 1024]] + {:ok, result} = Cohere.format_embedding_request("cohere.embed-v4:0", "text", opts) + + assert result["max_tokens"] == 1024 + end + + test "formats image-only input" do + opts = [provider_options: [images: ["data:image/png;base64,abc123"]]] + {:ok, result} = Cohere.format_embedding_request("cohere.embed-v4:0", [], opts) + + assert result["images"] == ["data:image/png;base64,abc123"] + refute Map.has_key?(result, "texts") + end + + test "formats mixed content input" do + inputs = [ + %{ + content: [ + %{type: "text", text: "A cat"}, + %{type: "image_url", image_url: "data:image/png;base64,xyz"} + ] + } + ] + + opts = [provider_options: [inputs: inputs]] + {:ok, result} = Cohere.format_embedding_request("cohere.embed-v4:0", [], opts) + + assert [%{"content" => content}] = result["inputs"] + assert [%{"type" => "text", "text" => "A cat"}, %{"type" => "image_url"}] = content + end + + test "returns error for invalid dimension" do + opts = [dimensions: 999] + {:error, error} = Cohere.format_embedding_request("cohere.embed-v4:0", "text", opts) + + assert error.__struct__ == ReqLLM.Error.Validation.Error + assert error.tag == :invalid_embedding_request + end + + test "returns error for invalid input_type" do + opts = [provider_options: [input_type: "invalid"]] + {:error, error} = Cohere.format_embedding_request("cohere.embed-v4:0", "text", opts) + + assert error.__struct__ == ReqLLM.Error.Validation.Error + end + end + + describe "parse_embedding_response/1" do + test "parses response with float embeddings nested" do + response = %{ + "embeddings" => %{"float" => [[0.1, 0.2, 0.3], [0.4, 0.5, 0.6]]}, + "texts" => ["Hello", "World"] + } + + {:ok, result} = Cohere.parse_embedding_response(response) + + assert result["data"] == [ + %{"index" => 0, "embedding" => [0.1, 0.2, 0.3]}, + %{"index" => 1, "embedding" => [0.4, 0.5, 0.6]} + ] + end + + test "parses response with flat embeddings list" do + response = %{ + "embeddings" => [[0.1, 0.2], [0.3, 0.4]] + } + + {:ok, result} = Cohere.parse_embedding_response(response) + + assert result["data"] == [ + %{"index" => 0, "embedding" => [0.1, 0.2]}, + %{"index" => 1, "embedding" => [0.3, 0.4]} + ] + end + + test "returns error for invalid response format" do + response = %{"unexpected" => "format"} + {:error, error} = Cohere.parse_embedding_response(response) + + assert error.__struct__ == ReqLLM.Error.API.Response + end + + test "returns error for non-map response" do + {:error, error} = Cohere.parse_embedding_response("not a map") + + assert error.__struct__ == ReqLLM.Error.API.Response + assert error.reason =~ "Expected map response" + end + end + + describe "schema accessors" do + test "embedding_request_schema returns Zoi schema" do + schema = Cohere.embedding_request_schema() + assert is_struct(schema) + end + + test "embedding_response_schema returns Zoi schema" do + schema = Cohere.embedding_response_schema() + assert is_struct(schema) + end + end +end diff --git a/test/req_llm/providers/amazon_bedrock_test.exs b/test/req_llm/providers/amazon_bedrock_test.exs index dbb93a9ad..4a7dac04e 100644 --- a/test/req_llm/providers/amazon_bedrock_test.exs +++ b/test/req_llm/providers/amazon_bedrock_test.exs @@ -371,6 +371,257 @@ defmodule ReqLLM.Providers.AmazonBedrockTest do end end + describe "prepare_request/4 for embedding" do + setup do + System.put_env("AWS_ACCESS_KEY_ID", "AKIATEST") + System.put_env("AWS_SECRET_ACCESS_KEY", "secretTEST") + System.put_env("AWS_REGION", "us-east-1") + :ok + end + + test "builds embedding request for Cohere model" do + {:ok, model} = ReqLLM.model("amazon-bedrock:cohere.embed-english-v3") + text = "Hello, world!" + + opts = [ + access_key_id: "AKIATEST", + secret_access_key: "secretTEST", + region: "us-east-1" + ] + + {:ok, request} = AmazonBedrock.prepare_request(:embedding, model, text, opts) + + assert %Req.Request{} = request + assert request.url.path =~ "/model/cohere.embed-english-v3/invoke" + end + + test "includes text in Cohere format" do + {:ok, model} = ReqLLM.model("amazon-bedrock:cohere.embed-english-v3") + text = "Test embedding text" + + opts = [ + access_key_id: "AKIATEST", + secret_access_key: "secretTEST" + ] + + {:ok, request} = AmazonBedrock.prepare_request(:embedding, model, text, opts) + + body = Jason.decode!(request.body) + assert body["texts"] == ["Test embedding text"] + assert body["input_type"] == "search_document" + assert body["embedding_types"] == ["float"] + end + + test "supports batch text input" do + {:ok, model} = ReqLLM.model("amazon-bedrock:cohere.embed-english-v3") + texts = ["First text", "Second text", "Third text"] + + opts = [ + access_key_id: "AKIATEST", + secret_access_key: "secretTEST" + ] + + {:ok, request} = AmazonBedrock.prepare_request(:embedding, model, texts, opts) + + body = Jason.decode!(request.body) + assert body["texts"] == ["First text", "Second text", "Third text"] + end + + test "supports custom input_type via provider_options" do + {:ok, model} = ReqLLM.model("amazon-bedrock:cohere.embed-english-v3") + text = "Query text" + + opts = [ + access_key_id: "AKIATEST", + secret_access_key: "secretTEST", + provider_options: [input_type: "search_query"] + ] + + {:ok, request} = AmazonBedrock.prepare_request(:embedding, model, text, opts) + + body = Jason.decode!(request.body) + assert body["input_type"] == "search_query" + end + + test "supports embedding_types option" do + {:ok, model} = ReqLLM.model("amazon-bedrock:cohere.embed-english-v3") + text = "Test text" + + opts = [ + access_key_id: "AKIATEST", + secret_access_key: "secretTEST", + provider_options: [embedding_types: ["float", "int8"]] + ] + + {:ok, request} = AmazonBedrock.prepare_request(:embedding, model, text, opts) + + body = Jason.decode!(request.body) + assert body["embedding_types"] == ["float", "int8"] + end + + test "supports truncate option" do + {:ok, model} = ReqLLM.model("amazon-bedrock:cohere.embed-english-v3") + text = "Test text" + + opts = [ + access_key_id: "AKIATEST", + secret_access_key: "secretTEST", + provider_options: [truncate: "RIGHT"] + ] + + {:ok, request} = AmazonBedrock.prepare_request(:embedding, model, text, opts) + + body = Jason.decode!(request.body) + assert body["truncate"] == "RIGHT" + end + end + + describe "attach_embedding/3" do + setup do + {:ok, model} = ReqLLM.model("amazon-bedrock:cohere.embed-english-v3") + + opts = [ + access_key_id: "AKIATEST", + secret_access_key: "secretTEST", + region: "us-east-1", + text: "Hello, world!" + ] + + {:ok, model: model, opts: opts} + end + + test "attaches AWS SigV4 signing", %{model: model, opts: opts} do + request = Req.new(url: "/model/cohere.embed-english-v3/invoke", method: :post) + + attached = AmazonBedrock.attach_embedding(request, model, opts) + + assert attached.request_steps[:aws_sigv4] != nil + end + + test "sets content-type header", %{model: model, opts: opts} do + request = Req.new(url: "/model/cohere.embed-english-v3/invoke", method: :post) + + attached = AmazonBedrock.attach_embedding(request, model, opts) + + headers_map = Map.new(attached.headers) + assert headers_map["content-type"] == ["application/json"] + end + + test "configures base URL with region", %{model: model, opts: opts} do + request = Req.new(url: "/model/cohere.embed-english-v3/invoke", method: :post) + + attached = AmazonBedrock.attach_embedding(request, model, opts) + + assert attached.options[:base_url] == "https://bedrock-runtime.us-east-1.amazonaws.com" + end + + test "uses custom region", %{model: model, opts: opts} do + request = Req.new(url: "/model/cohere.embed-english-v3/invoke", method: :post) + custom_opts = Keyword.put(opts, :region, "eu-west-1") + + attached = AmazonBedrock.attach_embedding(request, model, custom_opts) + + assert attached.options[:base_url] == "https://bedrock-runtime.eu-west-1.amazonaws.com" + end + + test "sets model family in options", %{model: model, opts: opts} do + request = Req.new(url: "/model/cohere.embed-english-v3/invoke", method: :post) + + attached = AmazonBedrock.attach_embedding(request, model, opts) + + assert attached.options[:model_family] == "cohere" + end + + test "attaches decode_embedding response step", %{model: model, opts: opts} do + request = Req.new(url: "/model/cohere.embed-english-v3/invoke", method: :post) + + attached = AmazonBedrock.attach_embedding(request, model, opts) + + assert attached.response_steps[:llm_decode_embedding] != nil + end + end + + describe "Cohere embedding formatter" do + alias ReqLLM.Providers.AmazonBedrock.Cohere + + test "format_embedding_request builds correct request body" do + {:ok, body} = Cohere.format_embedding_request("cohere.embed-english-v3", "hello", []) + + assert body["texts"] == ["hello"] + assert body["input_type"] == "search_document" + assert body["embedding_types"] == ["float"] + end + + test "format_embedding_request handles list of texts" do + texts = ["first", "second"] + {:ok, body} = Cohere.format_embedding_request("cohere.embed-english-v3", texts, []) + + assert body["texts"] == ["first", "second"] + end + + test "format_embedding_request supports provider_options" do + opts = [ + provider_options: [ + input_type: "search_query", + embedding_types: ["float", "int8"], + truncate: "LEFT" + ], + dimensions: 256 + ] + + {:ok, body} = Cohere.format_embedding_request("cohere.embed-v4", "query", opts) + + assert body["input_type"] == "search_query" + assert body["embedding_types"] == ["float", "int8"] + assert body["truncate"] == "LEFT" + assert body["output_dimension"] == 256 + end + + test "format_embedding_request validates input_type" do + invalid_opts = [provider_options: [input_type: "invalid_type"]] + + {:error, error} = + Cohere.format_embedding_request("cohere.embed-english-v3", "text", invalid_opts) + + assert %ReqLLM.Error.Validation.Error{} = error + assert error.tag == :invalid_embedding_request + end + + test "parse_embedding_response normalizes Cohere response" do + cohere_response = %{ + "embeddings" => %{ + "float" => [[0.1, 0.2, 0.3], [0.4, 0.5, 0.6]] + } + } + + {:ok, normalized} = Cohere.parse_embedding_response(cohere_response) + + assert normalized["data"] == [ + %{"index" => 0, "embedding" => [0.1, 0.2, 0.3]}, + %{"index" => 1, "embedding" => [0.4, 0.5, 0.6]} + ] + end + + test "parse_embedding_response handles direct embeddings list" do + cohere_response = %{ + "embeddings" => [[0.1, 0.2], [0.3, 0.4]] + } + + {:ok, normalized} = Cohere.parse_embedding_response(cohere_response) + + assert normalized["data"] == [ + %{"index" => 0, "embedding" => [0.1, 0.2]}, + %{"index" => 1, "embedding" => [0.3, 0.4]} + ] + end + + test "parse_embedding_response returns error for invalid response" do + {:error, error} = Cohere.parse_embedding_response("not a map") + + assert %ReqLLM.Error.API.Response{} = error + end + end + describe "service_tier parameter" do test "includes service_tier in request body when specified" do System.put_env("AWS_ACCESS_KEY_ID", "AKIATEST") diff --git a/test/support/fake_keys.ex b/test/support/fake_keys.ex index 11af4b047..69285d171 100644 --- a/test/support/fake_keys.ex +++ b/test/support/fake_keys.ex @@ -20,14 +20,27 @@ defmodule ReqLLM.TestSupport.FakeKeys do providers = ReqLLM.Providers.list() for provider <- providers do - env_var = ReqLLM.Keys.env_var_name(provider) - config_key = ReqLLM.Keys.config_key(provider) - - if System.get_env(env_var) in [nil, ""] and - Application.get_env(:req_llm, config_key) in [nil, ""] do - System.put_env(env_var, "test-key-#{provider}") - end + install_fake_key_for_provider(provider) end end end + + defp install_fake_key_for_provider(:amazon_bedrock) do + if System.get_env("AWS_ACCESS_KEY_ID") in [nil, ""] and + System.get_env("AWS_BEARER_TOKEN_BEDROCK") in [nil, ""] do + System.put_env("AWS_ACCESS_KEY_ID", "AKIAIOSFODNN7EXAMPLE") + System.put_env("AWS_SECRET_ACCESS_KEY", "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY") + System.put_env("AWS_REGION", "us-east-1") + end + end + + defp install_fake_key_for_provider(provider) do + env_var = ReqLLM.Keys.env_var_name(provider) + config_key = ReqLLM.Keys.config_key(provider) + + if System.get_env(env_var) in [nil, ""] and + Application.get_env(:req_llm, config_key) in [nil, ""] do + System.put_env(env_var, "test-key-#{provider}") + end + end end diff --git a/test/support/fixtures/amazon_bedrock/cohere_embed_english_v3/embed_basic.json b/test/support/fixtures/amazon_bedrock/cohere_embed_english_v3/embed_basic.json new file mode 100644 index 000000000..f540e1881 --- /dev/null +++ b/test/support/fixtures/amazon_bedrock/cohere_embed_english_v3/embed_basic.json @@ -0,0 +1,1101 @@ +{ + "model_spec": "amazon_bedrock:cohere.embed-english-v3", + "provider": "amazon_bedrock", + "request": { + "body": { + "b64": "eyJlbWJlZGRpbmdfdHlwZXMiOlsiZmxvYXQiXSwiaW5wdXRfdHlwZSI6InNlYXJjaF9kb2N1bWVudCIsInRleHRzIjpbIkhlbGxvIHdvcmxkIl0sInRydW5jYXRlIjoiTk9ORSJ9" + }, + "canonical_json": { + "embedding_types": [ + "float" + ], + "input_type": "search_document", + "texts": [ + "Hello world" + ], + "truncate": "NONE" + }, + "headers": { + "accept-encoding": [ + "gzip" + ], + "authorization": "[REDACTED:authorization]", + "content-type": [ + "application/json" + ], + "host": [ + "bedrock-runtime.us-east-1.amazonaws.com" + ], + "user-agent": [ + "req/0.5.17" + ], + "x-amz-content-sha256": [ + "b7a6b1dfcc22990dabc3d9debeeef577c0404d73d23130ae2e1a6060bae4c1d1" + ], + "x-amz-date": [ + "20260127T121155Z" + ], + "x-amz-security-token": [ + "[REDACTED:x-amz-security-token]" + ] + }, + "method": "post", + "url": "https://bedrock-runtime.us-east-1.amazonaws.com/model/cohere.embed-english-v3/invoke" + }, + "response": { + "body": { + "data": [ + { + "embedding": [ + -0.029190063, + -0.02355957, + -0.05987549, + -0.05819702, + -0.03540039, + -0.030166626, + -0.033325195, + 0.054748535, + -0.014305115, + 0.039031982, + -0.036010742, + -8.0156326e-4, + 0.020355225, + -0.031677246, + 0.043151855, + -0.010238647, + 0.05218506, + -4.7183037e-4, + 0.018249512, + -0.006614685, + -0.014305115, + 0.039123535, + -0.0064964294, + 0.01940918, + 0.04135132, + -0.03164673, + 0.009384155, + -0.01360321, + -0.025543213, + -0.048675537, + 0.011955261, + 0.044128418, + 0.022338867, + 0.025665283, + 0.0052490234, + 0.075927734, + -0.018615723, + 0.017929077, + 0.0146484375, + -0.013031006, + 0.018844604, + -0.014160156, + 0.013626099, + -0.020965576, + -0.03466797, + 0.009391785, + -0.009666443, + -0.009674072, + -0.0011453629, + -0.04724121, + 0.0151901245, + -0.031921387, + 0.020217896, + 0.016326904, + -0.0064353943, + 0.011520386, + -0.061553955, + -0.02960205, + 0.02722168, + 0.0309906, + 0.0058517456, + -0.004398346, + 0.022079468, + 0.0011167526, + 0.025863647, + -0.041809082, + -3.2281876e-4, + 0.0060577393, + 0.02684021, + 0.028945923, + -0.0018758774, + 0.006011963, + -0.023620605, + 0.0039978027, + 0.0049743652, + 0.012886047, + 0.0063323975, + 0.037750244, + 0.0064353943, + 0.019470215, + -0.022613525, + 0.006450653, + -0.0065574646, + -0.06427002, + 0.03591919, + -0.009346008, + -0.0033874512, + 0.006477356, + -0.0044898987, + -0.072143555, + -0.015106201, + 0.06213379, + -0.026016235, + 0.015991211, + -0.044952393, + -0.022537231, + 0.017700195, + 0.043670654, + -0.0022087097, + 0.01828003, + -0.062805176, + -0.0057144165, + -0.010955811, + -0.033843994, + 0.0052871704, + -0.037628174, + -7.8201294e-4, + -0.012664795, + 0.05142212, + 0.052612305, + -0.044128418, + 0.076538086, + 0.014053345, + 0.019119263, + -0.009147644, + 8.068085e-4, + 0.0025100708, + 4.4178963e-4, + -0.028579712, + 0.017578125, + 0.02432251, + 0.024765015, + -0.010482788, + 0.024841309, + -0.016113281, + 0.009460449, + -0.033996582, + -0.017196655, + 0.06210327, + -0.059387207, + -0.024505615, + 0.048034668, + -0.08770752, + -0.058410645, + -0.023635864, + 0.022506714, + 0.02267456, + -0.048065186, + -0.0181427, + -0.015975952, + 0.036865234, + -0.0042686462, + -0.00554657, + 0.005962372, + -0.033172607, + 0.041290283, + 0.008872986, + -0.011238098, + -0.034088135, + -0.045135498, + -0.034606934, + -0.04525757, + -0.022476196, + 0.043914795, + 0.028671265, + 0.031921387, + 0.0073890686, + 0.0053977966, + 0.049468994, + 0.046203613, + -0.012306213, + 7.9488754e-4, + 0.056762695, + -0.051208496, + -0.032409668, + -0.02029419, + -0.036315918, + 0.0069351196, + -0.00299263, + 0.03164673, + -0.020874023, + 0.014923096, + -0.029556274, + -0.019485474, + 0.0028572083, + -0.0074539185, + -0.0035305023, + 0.0029315948, + -0.005554199, + 0.059570312, + 0.07824707, + -0.0049476624, + -0.072753906, + 0.08312988, + -0.042144775, + -0.025650024, + 0.004398346, + -0.004863739, + 0.035736084, + 0.0113220215, + 0.027648926, + 0.0023384094, + -0.053466797, + 0.009117126, + -0.017181396, + -0.008453369, + 0.020217896, + 0.009140015, + -0.003704071, + 0.012107849, + -0.02279663, + 0.021759033, + 0.017745972, + -0.009933472, + 0.062316895, + -0.010795593, + 0.02041626, + 0.009002686, + 0.034484863, + 0.021026611, + -0.012756348, + -0.023910522, + 0.065979004, + -0.13684082, + -0.0574646, + -0.02067566, + -0.059295654, + 0.003107071, + -0.020645142, + 0.02029419, + 0.030944824, + -0.025115967, + 0.012138367, + 0.0071372986, + 0.008613586, + 0.044769287, + -0.041229248, + 0.016448975, + -0.041168213, + 0.027801514, + -0.012573242, + 0.0060653687, + -0.04425049, + -0.042663574, + -0.06378174, + -0.041931152, + -0.052947998, + 5.955696e-4, + 0.024414062, + 0.045776367, + 0.015655518, + -0.013923645, + -0.010627747, + 0.010124207, + 0.027877808, + 0.020553589, + 0.019500732, + 0.019851685, + -0.01096344, + 0.025512695, + -0.007648468, + -0.0031738281, + 0.02468872, + -0.0050315857, + -0.019332886, + 0.05847168, + -6.585121e-4, + 0.0019512177, + -0.017623901, + 0.028320312, + -0.015991211, + 0.027160645, + 0.0099105835, + 0.008773804, + -0.029678345, + -0.012031555, + -0.02998352, + -1.1014938e-4, + -0.022140503, + 0.014793396, + 0.029251099, + -0.048583984, + -0.031280518, + -0.025131226, + 0.07055664, + -0.017288208, + -0.05895996, + 0.02293396, + -0.006134033, + -0.011703491, + -0.002904892, + -0.015625, + 0.0011634827, + 0.0138549805, + 0.022705078, + 0.015098572, + 0.03579712, + 0.030776978, + -0.006263733, + 0.031982422, + 0.06628418, + 0.029159546, + 0.013885498, + 0.030654907, + 0.0056114197, + 0.01727295, + 0.037750244, + 0.053375244, + -0.018966675, + 0.0028858185, + -0.048858643, + -0.0048294067, + 0.006538391, + -0.019241333, + -0.0065994263, + -0.01651001, + 0.024719238, + 0.00969696, + -0.0077590942, + 0.014465332, + -0.023406982, + 0.037475586, + 6.303787e-4, + 0.029129028, + -0.054504395, + -0.06109619, + -0.015686035, + -0.03036499, + -0.123413086, + -0.0713501, + -0.022506714, + -0.0069084167, + -0.014541626, + -0.024108887, + 0.003522873, + 0.0026607513, + -0.032684326, + 0.007637024, + -0.023086548, + -0.019454956, + 0.0016365051, + -0.024276733, + -0.028442383, + -0.008926392, + 0.018463135, + -0.011421204, + 0.02166748, + 0.01675415, + -0.010185242, + -0.013702393, + 0.034942627, + -0.018356323, + 0.0109939575, + 0.021362305, + 0.028030396, + -0.047546387, + -0.01084137, + -0.0149002075, + 0.02947998, + 7.777214e-4, + 0.012336731, + -0.027008057, + 0.011741638, + -0.027908325, + 0.03866577, + -0.04562378, + -0.036865234, + -0.039978027, + -0.0028495789, + -0.066833496, + 0.047302246, + 0.01058197, + 0.016479492, + -0.034210205, + -0.053222656, + -0.049194336, + 0.026046753, + 1.5187263e-4, + -0.06750488, + -0.011039734, + -0.028198242, + -0.035705566, + 0.043945312, + -0.032196045, + -0.07525635, + 0.01737976, + -0.0063285828, + -0.0390625, + -0.02053833, + -0.011062622, + 0.032470703, + 0.041534424, + -0.0143966675, + 0.021957397, + 0.0017137527, + 0.023239136, + 0.009361267, + 0.032287598, + 0.035583496, + 0.007358551, + 0.0017709732, + 0.041290283, + -0.045562744, + -0.0062675476, + 0.040985107, + 0.003490448, + -0.04586792, + 0.030578613, + -0.10949707, + 0.014373779, + -0.0234375, + -0.025604248, + -0.038757324, + -0.002565384, + -0.09283447, + -0.015037537, + -0.0791626, + -0.02848816, + 0.017181396, + 0.024536133, + 0.017715454, + 0.0020503998, + 0.028930664, + -0.007007599, + 0.016082764, + -0.023727417, + -0.082214355, + 0.020736694, + -6.03199e-4, + 0.0015201569, + -0.026473999, + 0.020187378, + -0.05380249, + -0.007507324, + -0.0051841736, + 0.042144775, + 0.0023345947, + 0.015045166, + 0.01890564, + -0.026016235, + 0.006000519, + -0.038391113, + -0.02017212, + -0.03778076, + -0.013961792, + 0.019470215, + -0.025878906, + 0.03237915, + -0.013221741, + -0.01361084, + 0.010826111, + 0.015434265, + 0.01889038, + 0.019058228, + -0.0013036728, + -0.005458832, + 0.018295288, + 0.015930176, + -0.05267334, + 0.0050315857, + -0.028381348, + 0.02192688, + -0.032958984, + 0.023773193, + -0.019012451, + -0.011062622, + 0.025222778, + 0.037506104, + 0.0057525635, + -0.0051994324, + 0.0053710938, + -0.016220093, + -0.048736572, + 0.0019664764, + -0.030212402, + -0.0049819946, + 0.0836792, + -0.013870239, + -0.03717041, + 0.014274597, + -0.030090332, + 0.0098724365, + 0.026565552, + 0.008232117, + -0.01701355, + -0.0036640167, + -0.018203735, + 0.003921509, + -0.020324707, + -0.013023376, + -0.021652222, + -0.009117126, + -0.026138306, + -0.0519104, + -0.029251099, + 0.0025253296, + -0.05368042, + -7.252693e-4, + 0.005924225, + 0.03942871, + 0.020858765, + -0.01309967, + 0.033050537, + -0.0032138824, + -0.031921387, + -0.009544373, + -0.0287323, + 0.035247803, + 0.008926392, + -0.0647583, + -0.030944824, + -0.012817383, + -0.002779007, + -0.0019893646, + 0.03024292, + -0.02168274, + -0.011978149, + 0.032989502, + 0.027313232, + 0.056274414, + 0.015701294, + 0.0018119812, + 0.008781433, + 0.024765015, + -0.023330688, + 0.037322998, + 0.005958557, + -0.008621216, + 8.382797e-4, + 7.9774857e-4, + 0.027282715, + 0.028305054, + -0.006580353, + 0.03475952, + 0.03756714, + -0.0070991516, + -0.043060303, + 0.014373779, + -0.021194458, + -0.0859375, + 0.03866577, + 0.0079422, + -0.0051002502, + 0.017059326, + -0.019836426, + 0.084350586, + -0.0079193115, + -0.0062217712, + 0.008766174, + -0.011993408, + 0.011688232, + 0.0072135925, + -0.041229248, + -0.028671265, + 0.018753052, + 0.011222839, + 0.033935547, + 0.092285156, + -0.02532959, + 0.0847168, + 0.0032176971, + -0.01612854, + 0.05316162, + 0.014663696, + -0.020050049, + -0.05041504, + -0.029815674, + 0.0038013458, + -0.025817871, + 0.014411926, + -0.0070266724, + 0.045837402, + -0.05621338, + 0.023406982, + -0.037200928, + 0.015281677, + 0.005554199, + -0.006801605, + 0.0013837814, + -0.012565613, + 0.0029830933, + -0.026107788, + -0.03515625, + -7.6436996e-4, + -0.018218994, + 0.0368042, + -0.043395996, + 0.0072288513, + 0.015823364, + 0.074035645, + 0.005256653, + 0.022537231, + -0.037261963, + 0.049194336, + 0.015625, + 0.05557251, + -0.013374329, + 0.029159546, + -2.8848648e-5, + 0.035339355, + -0.023910522, + -0.017303467, + -0.005504608, + 0.006298065, + 0.019470215, + 0.003271103, + 0.027175903, + -0.05239868, + 0.009048462, + 0.0028266907, + -0.044281006, + -0.012168884, + 0.014228821, + -0.036315918, + 0.039123535, + -0.006542206, + -0.033813477, + -0.016281128, + 0.02810669, + 0.008644104, + 0.03036499, + -0.0069847107, + -0.023162842, + 0.051239014, + -0.0059928894, + -0.054901123, + -0.007286072, + 0.029342651, + 0.013214111, + -0.0010004044, + 0.03050232, + -0.045318604, + 0.041992188, + 0.0056037903, + 0.0069503784, + -0.040985107, + -0.0016040802, + 0.028381348, + -0.0011138916, + -0.021102905, + 0.022842407, + -0.013954163, + -0.018951416, + 0.011146545, + 0.024734497, + 0.015716553, + -0.032348633, + 0.005039215, + -0.05883789, + -0.010398865, + 0.009284973, + 0.010803223, + 0.038238525, + -0.030685425, + -0.032958984, + -0.048034668, + -9.6797943e-4, + 0.006526947, + -0.028564453, + -0.009490967, + -0.01763916, + 0.0087509155, + 0.01802063, + 0.015670776, + -0.014076233, + 0.012207031, + -0.008110046, + 0.04449463, + -0.009628296, + -0.037078857, + -0.012504578, + 0.01008606, + -0.009254456, + -0.02709961, + 0.020248413, + 0.0035953522, + 0.016189575, + 0.04006958, + -0.020645142, + 0.035491943, + 0.0017499924, + -0.0020217896, + 0.03050232, + -0.004512787, + -0.025131226, + -0.020004272, + 0.03564453, + -0.012283325, + 0.002445221, + 0.010856628, + -0.026885986, + 0.01626587, + 0.012184143, + 0.025177002, + -0.04800415, + 0.019210815, + 0.021759033, + 0.017486572, + -0.019805908, + -0.05065918, + -0.07366943, + 0.028167725, + -0.045410156, + 0.008087158, + 0.035858154, + 0.004337311, + -0.047912598, + -0.025360107, + 0.035583496, + 0.029846191, + 0.0030879974, + -0.03213501, + 0.03555298, + -0.038513184, + 0.015556335, + 0.012283325, + -0.017166138, + 0.022232056, + -0.025802612, + 0.00844574, + -0.001953125, + 0.03250122, + -0.05255127, + -0.023742676, + 0.022033691, + -0.044677734, + -0.07366943, + -0.014251709, + -0.024902344, + -0.011650085, + -0.02420044, + -0.056671143, + -0.010498047, + -0.010887146, + 0.016937256, + -0.013748169, + -0.035308838, + 0.003326416, + 0.01247406, + 0.003320694, + -4.606247e-4, + 0.04827881, + -0.010635376, + -0.011238098, + 0.0021781921, + 0.027359009, + -0.0010375977, + 0.018371582, + 0.0058135986, + 0.0010137558, + -0.053771973, + 0.0033607483, + 0.021652222, + 0.034484863, + 0.03326416, + 0.05392456, + 0.021560669, + 0.040130615, + -0.02017212, + 0.021743774, + 0.010986328, + 0.0066986084, + 0.041992188, + -0.005897522, + 0.009895325, + -0.048217773, + -0.057037354, + 0.036010742, + 0.074157715, + -0.019485474, + -0.05355835, + -0.03112793, + -0.0053520203, + 0.06585693, + 0.012069702, + 0.05899048, + 0.026657104, + 0.030517578, + -0.015197754, + 0.02758789, + 0.06890869, + 0.025527954, + -0.0035076141, + -0.036224365, + -0.054534912, + 0.041259766, + 0.016235352, + -0.024032593, + 0.022964478, + 0.023971558, + 0.006664276, + -0.010246277, + -0.02720642, + -0.019973755, + -0.028808594, + -0.039611816, + 0.046051025, + 0.04333496, + 0.011894226, + 0.09094238, + -0.026901245, + 0.03564453, + -0.013763428, + 0.0496521, + 0.043121338, + 0.007572174, + 0.007633209, + -0.004558563, + 0.01235199, + -0.034057617, + -0.041046143, + 0.008728027, + -0.01979065, + 0.01084137, + 4.6873093e-4, + -0.08544922, + 0.020355225, + 0.046447754, + -0.016860962, + 0.0234375, + -0.009284973, + -0.036010742, + 0.0013437271, + 0.014572144, + 0.010513306, + -0.015823364, + 0.0014429092, + -7.683039e-5, + 0.0059661865, + -0.052856445, + -0.013755798, + 0.033294678, + 0.03768921, + -0.043640137, + -0.009628296, + 0.033477783, + 0.021942139, + -0.014328003, + -0.009086609, + -0.014045715, + 0.04107666, + -0.011062622, + 0.00248909, + 0.030532837, + -0.016311646, + 0.0031795502, + 0.02709961, + -0.03643799, + 0.039031982, + 0.022277832, + -0.0037021637, + -0.008987427, + 0.012687683, + 8.93116e-4, + -0.07537842, + 0.032928467, + 0.027313232, + -0.003791809, + -0.00579834, + 0.055389404, + 0.056610107, + 0.0625, + 0.032989502, + 0.0059318542, + -0.0018024445, + 0.013832092, + 0.019210815, + -0.03829956, + -0.043182373, + -0.014053345, + -0.020446777, + -9.6321106e-4, + -0.0035381317, + 0.032562256, + 0.021148682, + 0.003993988, + -0.038848877, + -0.013679504, + -0.015434265, + -0.029296875, + 0.007396698, + 0.023513794, + 0.019699097, + -0.06036377, + -0.038146973, + -0.01586914, + -0.0052490234, + -0.026855469, + -0.019882202, + 0.06719971, + 0.027313232, + 0.018310547, + -0.009666443, + -0.03302002, + -0.028045654, + 0.024597168, + -0.026412964, + 0.050231934, + -0.005859375, + 0.0021457672, + 0.022766113, + -0.040222168, + -0.010307312, + 0.003540039, + -0.07501221, + 6.9093704e-4, + -0.007183075, + 0.024932861, + -0.0231781, + 0.043151855, + -0.036590576, + -0.02633667, + -0.0019464493, + 0.019989014, + -0.023605347, + -0.0031147003, + 0.01612854, + 0.011054993, + -0.024139404, + -0.046661377, + 0.027328491, + 0.009025574, + 0.014335632, + 0.062042236, + -0.041015625, + 0.0044937134, + -0.0051460266, + 0.01234436, + 0.03918457, + -0.030899048, + -0.024902344, + 0.006542206, + -0.023071289, + -0.034423828, + -0.017150879, + 0.02935791, + -0.07067871, + -0.034088135, + 0.0034713745, + -0.018127441, + -0.022109985, + -0.051116943, + -0.088012695, + -0.013015747, + -0.0026130676, + -0.056396484, + -0.0057373047, + -0.006450653, + -0.015289307, + -0.009117126, + -0.018356323, + -0.0010461807, + 0.017486572, + 0.040863037, + -0.045196533, + 0.026733398, + 0.009300232, + -0.027542114, + -0.02116394, + -4.4870377e-4, + 0.0068511963, + -0.010444641, + -0.010475159, + 0.003074646, + 0.012123108, + 0.046051025, + -0.051940918, + -0.03289795, + -0.01486969, + 0.0256958, + -0.020843506, + 0.045440674, + 0.05380249, + 0.021255493, + -0.06817627, + 0.0070724487, + -0.05230713, + 0.012367249, + 0.022994995, + -2.3889542e-4, + -0.03253174, + -0.006465912, + -0.0010633469, + -0.025039673, + 0.007633209, + -0.0063095093, + 0.030654907, + -0.0046424866, + -0.012817383, + 0.03756714, + -0.058929443, + 0.043060303, + -0.01133728, + 0.025283813, + -0.012962341, + 0.07116699, + -0.035247803, + 0.0154953, + 0.008903503, + 0.008666992, + 0.01576233, + 0.013244629, + -0.026046753, + -0.024765015, + 0.06640625, + 0.02760315, + 0.014305115, + -0.004802704, + 0.04901123, + -0.0012950897, + -0.05038452, + 0.019012451, + 0.05697632, + 0.026229858, + -0.037872314, + -0.016281128, + 0.03567505, + -0.0028934479, + 0.009552002, + -0.054595947, + -0.039855957, + 0.06365967, + -0.038635254, + -0.037994385, + -0.0046691895, + -0.052978516, + -0.008590698, + -0.0012578964, + -0.016952515, + -0.06518555, + 0.0040664673, + 0.06567383, + -0.013290405, + 0.019607544 + ], + "index": 0 + } + ] + }, + "headers": { + "connection": [ + "keep-alive" + ], + "content-type": [ + "application/json" + ], + "date": [ + "Tue, 27 Jan 2026 12:11:55 GMT" + ], + "x-amzn-bedrock-input-token-count": [ + "2" + ], + "x-amzn-bedrock-invocation-latency": [ + "75" + ], + "x-amzn-requestid": [ + "baa10e9d-9083-4440-898a-6e3466ac4423" + ] + }, + "status": 200 + } +} \ No newline at end of file diff --git a/test/support/fixtures/amazon_bedrock/cohere_embed_english_v3/embed_batch.json b/test/support/fixtures/amazon_bedrock/cohere_embed_english_v3/embed_batch.json new file mode 100644 index 000000000..1da66e6ff --- /dev/null +++ b/test/support/fixtures/amazon_bedrock/cohere_embed_english_v3/embed_batch.json @@ -0,0 +1,3161 @@ +{ + "model_spec": "amazon_bedrock:cohere.embed-english-v3", + "provider": "amazon_bedrock", + "request": { + "body": { + "b64": "eyJlbWJlZGRpbmdfdHlwZXMiOlsiZmxvYXQiXSwiaW5wdXRfdHlwZSI6InNlYXJjaF9kb2N1bWVudCIsInRleHRzIjpbIkhlbGxvIHdvcmxkIiwiSG93IGFyZSB5b3U/IiwiVGVzdGluZyBlbWJlZGRpbmdzIl0sInRydW5jYXRlIjoiTk9ORSJ9" + }, + "canonical_json": { + "embedding_types": [ + "float" + ], + "input_type": "search_document", + "texts": [ + "Hello world", + "How are you?", + "Testing embeddings" + ], + "truncate": "NONE" + }, + "headers": { + "accept-encoding": [ + "gzip" + ], + "authorization": "[REDACTED:authorization]", + "content-type": [ + "application/json" + ], + "host": [ + "bedrock-runtime.us-east-1.amazonaws.com" + ], + "user-agent": [ + "req/0.5.17" + ], + "x-amz-content-sha256": [ + "05fbf7eea549de3ff9cf7ca30594d31a9bff114b9bd08e8e97f6dd6483a08a76" + ], + "x-amz-date": [ + "20260127T121154Z" + ], + "x-amz-security-token": [ + "[REDACTED:x-amz-security-token]" + ] + }, + "method": "post", + "url": "https://bedrock-runtime.us-east-1.amazonaws.com/model/cohere.embed-english-v3/invoke" + }, + "response": { + "body": { + "data": [ + { + "embedding": [ + -0.029342651, + -0.02281189, + -0.060302734, + -0.058013916, + -0.03491211, + -0.030288696, + -0.033203125, + 0.055541992, + -0.014846802, + 0.038085938, + -0.035491943, + -5.455017e-4, + 0.01979065, + -0.03189087, + 0.043792725, + -0.010498047, + 0.05203247, + -4.708767e-4, + 0.018432617, + -0.006729126, + -0.014450073, + 0.038757324, + -0.0059432983, + 0.019424438, + 0.041168213, + -0.03213501, + 0.009674072, + -0.014793396, + -0.024169922, + -0.048980713, + 0.012626648, + 0.044036865, + 0.022079468, + 0.026443481, + 0.005077362, + 0.07720947, + -0.018218994, + 0.01763916, + 0.015205383, + -0.0124435425, + 0.018630981, + -0.013809204, + 0.0140686035, + -0.020431519, + -0.03439331, + 0.00907135, + -0.009811401, + -0.009277344, + 2.002716e-4, + -0.047180176, + 0.014953613, + -0.031188965, + 0.019851685, + 0.017028809, + -0.006324768, + 0.011672974, + -0.060699463, + -0.02999878, + 0.027297974, + 0.032318115, + 0.005771637, + -0.003993988, + 0.022033691, + 2.4032593e-4, + 0.025619507, + -0.04147339, + -4.005432e-4, + 0.005241394, + 0.02720642, + 0.028839111, + -0.002632141, + 0.006412506, + -0.023742676, + 0.003643036, + 0.00566864, + 0.01335144, + 0.0063972473, + 0.037719727, + 0.005859375, + 0.019424438, + -0.022369385, + 0.0061569214, + -0.0061531067, + -0.064575195, + 0.035949707, + -0.009399414, + -0.0031604767, + 0.0065307617, + -0.004463196, + -0.07171631, + -0.014724731, + 0.0625, + -0.026382446, + 0.016159058, + -0.044158936, + -0.02204895, + 0.017837524, + 0.043823242, + -0.0020103455, + 0.019134521, + -0.06347656, + -0.0051002502, + -0.010795593, + -0.034210205, + 0.004749298, + -0.03692627, + -7.5531006e-4, + -0.012420654, + 0.051116943, + 0.052825928, + -0.04321289, + 0.076293945, + 0.013877869, + 0.019012451, + -0.008651733, + 6.828308e-4, + 0.0023498535, + 1.9836426e-4, + -0.028747559, + 0.017486572, + 0.02407837, + 0.024383545, + -0.010154724, + 0.024536133, + -0.015792847, + 0.009399414, + -0.034210205, + -0.016784668, + 0.061920166, + -0.05859375, + -0.024765015, + 0.047851562, + -0.08666992, + -0.05783081, + -0.023834229, + 0.021728516, + 0.022994995, + -0.048339844, + -0.018356323, + -0.016448975, + 0.036071777, + -0.00491333, + -0.005897522, + 0.0059661865, + -0.03274536, + 0.04208374, + 0.008529663, + -0.0113220215, + -0.03439331, + -0.045318604, + -0.034088135, + -0.046447754, + -0.022064209, + 0.04333496, + 0.02822876, + 0.03250122, + 0.007537842, + 0.005180359, + 0.049224854, + 0.046813965, + -0.011695862, + 0.0010070801, + 0.057434082, + -0.051086426, + -0.032104492, + -0.020370483, + -0.036499023, + 0.006790161, + -0.0029125214, + 0.031982422, + -0.020904541, + 0.015457153, + -0.028945923, + -0.019256592, + 0.002735138, + -0.008148193, + -0.0037822723, + 0.0028800964, + -0.0056648254, + 0.060455322, + 0.0791626, + -0.004699707, + -0.0725708, + 0.08319092, + -0.04296875, + -0.025299072, + 0.0048828125, + -0.0041046143, + 0.03591919, + 0.01121521, + 0.026992798, + 0.0035476685, + -0.053955078, + 0.008674622, + -0.017715454, + -0.008728027, + 0.020217896, + 0.00894165, + -0.0038375854, + 0.013061523, + -0.022369385, + 0.02166748, + 0.016784668, + -0.009544373, + 0.06222534, + -0.011749268, + 0.021087646, + 0.008102417, + 0.033996582, + 0.020904541, + -0.012649536, + -0.023712158, + 0.065979004, + -0.13659668, + -0.0569458, + -0.0211792, + -0.058532715, + 0.0031661987, + -0.021072388, + 0.021072388, + 0.03036499, + -0.025726318, + 0.011909485, + 0.0071411133, + 0.008422852, + 0.045166016, + -0.040893555, + 0.016723633, + -0.040863037, + 0.028015137, + -0.0127334595, + 0.0054779053, + -0.04434204, + -0.04272461, + -0.06359863, + -0.04196167, + -0.052581787, + 0.0010528564, + 0.024597168, + 0.045318604, + 0.015289307, + -0.014205933, + -0.01008606, + 0.011428833, + 0.028076172, + 0.020599365, + 0.018432617, + 0.020584106, + -0.011222839, + 0.025848389, + -0.008010864, + -0.0026512146, + 0.02520752, + -0.00472641, + -0.020385742, + 0.05895996, + -7.305145e-4, + 0.0030517578, + -0.01828003, + 0.027130127, + -0.0154953, + 0.027267456, + 0.009506226, + 0.008453369, + -0.029067993, + -0.011474609, + -0.030227661, + 2.0051003e-4, + -0.021987915, + 0.015197754, + 0.029281616, + -0.049591064, + -0.031311035, + -0.025253296, + 0.07092285, + -0.016601562, + -0.059387207, + 0.02279663, + -0.006225586, + -0.011871338, + -0.002506256, + -0.015975952, + 0.001613617, + 0.0132751465, + 0.023803711, + 0.015487671, + 0.035736084, + 0.031051636, + -0.006252289, + 0.032287598, + 0.066345215, + 0.029251099, + 0.013679504, + 0.030029297, + 0.0052108765, + 0.01776123, + 0.037200928, + 0.052520752, + -0.018661499, + 0.002790451, + -0.048950195, + -0.004432678, + 0.007801056, + -0.020431519, + -0.007270813, + -0.016220093, + 0.024780273, + 0.009483337, + -0.007698059, + 0.013702393, + -0.02218628, + 0.037200928, + 7.019043e-4, + 0.028793335, + -0.05432129, + -0.061065674, + -0.01576233, + -0.030548096, + -0.12286377, + -0.07080078, + -0.02218628, + -0.0067825317, + -0.013809204, + -0.024414062, + 0.00333786, + 0.0022621155, + -0.033203125, + 0.007675171, + -0.02355957, + -0.01902771, + 0.0016069412, + -0.02381897, + -0.02810669, + -0.009063721, + 0.017333984, + -0.0116119385, + 0.021530151, + 0.016616821, + -0.010314941, + -0.013450623, + 0.03552246, + -0.01864624, + 0.010528564, + 0.021240234, + 0.026473999, + -0.047454834, + -0.011009216, + -0.0143585205, + 0.029342651, + 7.8201294e-5, + 0.012718201, + -0.027282715, + 0.012031555, + -0.027420044, + 0.038909912, + -0.04537964, + -0.037109375, + -0.040283203, + -0.002773285, + -0.06665039, + 0.047454834, + 0.010192871, + 0.016555786, + -0.033050537, + -0.053710938, + -0.04937744, + 0.026306152, + 9.57489e-4, + -0.06762695, + -0.011489868, + -0.028869629, + -0.03540039, + 0.04397583, + -0.032196045, + -0.07525635, + 0.018051147, + -0.0051116943, + -0.03878784, + -0.022415161, + -0.010620117, + 0.032348633, + 0.040740967, + -0.015014648, + 0.022125244, + 0.0013504028, + 0.022918701, + 0.010025024, + 0.032196045, + 0.035583496, + 0.007484436, + 8.9263916e-4, + 0.04107666, + -0.046905518, + -0.0062675476, + 0.0413208, + 0.0036087036, + -0.04537964, + 0.03100586, + -0.10986328, + 0.014251709, + -0.024017334, + -0.025527954, + -0.03894043, + -0.0016651154, + -0.093444824, + -0.015289307, + -0.080078125, + -0.028884888, + 0.016830444, + 0.024124146, + 0.017425537, + 0.0024681091, + 0.028564453, + -0.00724411, + 0.016098022, + -0.02305603, + -0.082336426, + 0.020950317, + -0.0017604828, + 0.0014877319, + -0.0256958, + 0.019256592, + -0.05328369, + -0.00756073, + -0.0048980713, + 0.04220581, + 0.0024166107, + 0.014434814, + 0.019577026, + -0.026000977, + 0.0054779053, + -0.03817749, + -0.020492554, + -0.037719727, + -0.014175415, + 0.020050049, + -0.025604248, + 0.031585693, + -0.013336182, + -0.013793945, + 0.010536194, + 0.01512146, + 0.019714355, + 0.019729614, + -1.7547607e-4, + -0.005847931, + 0.017929077, + 0.015960693, + -0.052886963, + 0.004432678, + -0.029022217, + 0.021865845, + -0.032592773, + 0.0234375, + -0.018997192, + -0.011299133, + 0.024490356, + 0.03768921, + 0.0052261353, + -0.005092621, + 0.005622864, + -0.016815186, + -0.048858643, + 0.0020828247, + -0.030960083, + -0.0036201477, + 0.083984375, + -0.014160156, + -0.038116455, + 0.014732361, + -0.030227661, + 0.009887695, + 0.025970459, + 0.008613586, + -0.017364502, + -0.0026340485, + -0.018325806, + 0.0051612854, + -0.020767212, + -0.012641907, + -0.021514893, + -0.009284973, + -0.026153564, + -0.05178833, + -0.029785156, + 0.0032196045, + -0.05441284, + -0.0017471313, + 0.006038666, + 0.038848877, + 0.020690918, + -0.013412476, + 0.03314209, + -0.003648758, + -0.031707764, + -0.009651184, + -0.02861023, + 0.035339355, + 0.0090789795, + -0.06506348, + -0.030883789, + -0.011566162, + -0.0018577576, + -0.001906395, + 0.02998352, + -0.021957397, + -0.0119018555, + 0.032073975, + 0.027130127, + 0.056732178, + 0.016281128, + 0.0020217896, + 0.0093688965, + 0.025039673, + -0.023712158, + 0.037902832, + 0.0053215027, + -0.008018494, + 4.658699e-4, + 0.0010604858, + 0.026947021, + 0.028198242, + -0.006664276, + 0.035095215, + 0.037506104, + -0.007411957, + -0.042785645, + 0.014404297, + -0.021484375, + -0.085632324, + 0.037994385, + 0.008712769, + -0.005264282, + 0.016967773, + -0.019607544, + 0.08380127, + -0.008399963, + -0.0060424805, + 0.008666992, + -0.012588501, + 0.011245728, + 0.007003784, + -0.0413208, + -0.02796936, + 0.019454956, + 0.01158905, + 0.034851074, + 0.092041016, + -0.024841309, + 0.08544922, + 0.0029678345, + -0.016616821, + 0.053894043, + 0.014564514, + -0.02104187, + -0.050720215, + -0.029937744, + 0.0040893555, + -0.02508545, + 0.013900757, + -0.006427765, + 0.045196533, + -0.055999756, + 0.023239136, + -0.03677368, + 0.014961243, + 0.004989624, + -0.0070724487, + 0.0019111633, + -0.01260376, + 0.0035247803, + -0.025817871, + -0.035705566, + -7.6913834e-4, + -0.017608643, + 0.037506104, + -0.04345703, + 0.0077209473, + 0.016036987, + 0.07421875, + 0.006225586, + 0.023132324, + -0.037231445, + 0.05014038, + 0.015487671, + 0.054626465, + -0.0127334595, + 0.029876709, + 4.5776367e-5, + 0.035186768, + -0.023529053, + -0.018371582, + -0.005180359, + 0.00630188, + 0.019927979, + 0.0031261444, + 0.027511597, + -0.052947998, + 0.0087509155, + 0.003200531, + -0.044189453, + -0.011703491, + 0.014312744, + -0.035949707, + 0.038360596, + -0.005508423, + -0.03326416, + -0.015670776, + 0.027572632, + 0.009399414, + 0.030319214, + -0.007221222, + -0.023132324, + 0.051086426, + -0.005569458, + -0.05444336, + -0.007282257, + 0.029418945, + 0.013175964, + -5.2928925e-4, + 0.02998352, + -0.04425049, + 0.041656494, + 0.0058898926, + 0.0071105957, + -0.041015625, + -0.0013427734, + 0.028427124, + -7.90596e-4, + -0.020446777, + 0.023101807, + -0.014175415, + -0.019226074, + 0.0116119385, + 0.024261475, + 0.015556335, + -0.032562256, + 0.004348755, + -0.05899048, + -0.010620117, + 0.009140015, + 0.010787964, + 0.03793335, + -0.029571533, + -0.033477783, + -0.04824829, + -9.021759e-4, + 0.00617218, + -0.028396606, + -0.009262085, + -0.01789856, + 0.009246826, + 0.01889038, + 0.014839172, + -0.014221191, + 0.012252808, + -0.008270264, + 0.044677734, + -0.010353088, + -0.036712646, + -0.012466431, + 0.010353088, + -0.009414673, + -0.027160645, + 0.020492554, + 0.004219055, + 0.015457153, + 0.03930664, + -0.020401001, + 0.03564453, + 0.0014076233, + -0.0019416809, + 0.030426025, + -0.004508972, + -0.02482605, + -0.019210815, + 0.03515625, + -0.012588501, + 0.0022964478, + 0.01133728, + -0.027648926, + 0.016662598, + 0.012687683, + 0.025512695, + -0.047851562, + 0.019180298, + 0.022003174, + 0.017028809, + -0.020462036, + -0.05053711, + -0.07336426, + 0.028289795, + -0.045410156, + 0.008323669, + 0.03579712, + 0.0041122437, + -0.047821045, + -0.025680542, + 0.03564453, + 0.02961731, + 0.0039138794, + -0.03274536, + 0.03451538, + -0.03918457, + 0.015060425, + 0.012039185, + -0.017547607, + 0.022094727, + -0.025848389, + 0.00819397, + -0.0015926361, + 0.03253174, + -0.052093506, + -0.024230957, + 0.022949219, + -0.04534912, + -0.07324219, + -0.014953613, + -0.024841309, + -0.011383057, + -0.02482605, + -0.05718994, + -0.010223389, + -0.010818481, + 0.017440796, + -0.01399231, + -0.035491943, + 0.0032749176, + 0.012390137, + 0.0035362244, + -6.828308e-4, + 0.048217773, + -0.010734558, + -0.011329651, + 0.0018386841, + 0.027908325, + -0.0012283325, + 0.018447876, + 0.0055618286, + 0.0010795593, + -0.053985596, + 0.003320694, + 0.021453857, + 0.034179688, + 0.033294678, + 0.05392456, + 0.021362305, + 0.040893555, + -0.019897461, + 0.022094727, + 0.010604858, + 0.0063705444, + 0.042419434, + -0.0062026978, + 0.009239197, + -0.048706055, + -0.056030273, + 0.03652954, + 0.07409668, + -0.019821167, + -0.05404663, + -0.031021118, + -0.0053253174, + 0.06591797, + 0.012924194, + 0.059020996, + 0.026489258, + 0.030014038, + -0.015167236, + 0.02709961, + 0.06945801, + 0.02633667, + -0.0032157898, + -0.037017822, + -0.055267334, + 0.040161133, + 0.015991211, + -0.023620605, + 0.023010254, + 0.024215698, + 0.0064430237, + -0.008590698, + -0.026901245, + -0.02017212, + -0.028564453, + -0.040039062, + 0.046051025, + 0.043121338, + 0.012763977, + 0.09136963, + -0.026107788, + 0.03555298, + -0.013496399, + 0.04989624, + 0.04284668, + 0.008026123, + 0.008148193, + -0.004837036, + 0.012680054, + -0.034423828, + -0.041503906, + 0.00920105, + -0.01979065, + 0.011016846, + 6.5231323e-4, + -0.0848999, + 0.021377563, + 0.046173096, + -0.017288208, + 0.0234375, + -0.009429932, + -0.03643799, + 0.0016784668, + 0.013366699, + 0.010902405, + -0.015823364, + 0.001625061, + 3.33786e-4, + 0.006011963, + -0.05331421, + -0.014389038, + 0.03277588, + 0.03717041, + -0.04333496, + -0.008811951, + 0.03338623, + 0.022064209, + -0.014663696, + -0.008796692, + -0.014083862, + 0.041046143, + -0.010147095, + 0.0022659302, + 0.029266357, + -0.016464233, + 0.00365448, + 0.027511597, + -0.03668213, + 0.03878784, + 0.022369385, + -0.003774643, + -0.008407593, + 0.011993408, + 9.2315674e-4, + -0.076049805, + 0.03274536, + 0.027709961, + -0.0028686523, + -0.00598526, + 0.054992676, + 0.055541992, + 0.06262207, + 0.032928467, + 0.005722046, + -0.0017662048, + 0.014083862, + 0.019317627, + -0.038146973, + -0.042755127, + -0.014465332, + -0.020935059, + -0.0014715195, + -0.003873825, + 0.03253174, + 0.020858765, + 0.0036678314, + -0.03930664, + -0.013923645, + -0.016113281, + -0.029541016, + 0.0071868896, + 0.023910522, + 0.019012451, + -0.061065674, + -0.03805542, + -0.015068054, + -0.006046295, + -0.026397705, + -0.01939392, + 0.066589355, + 0.026657104, + 0.018859863, + -0.009262085, + -0.03274536, + -0.027496338, + 0.024963379, + -0.026565552, + 0.051116943, + -0.005683899, + 0.0019264221, + 0.021957397, + -0.03982544, + -0.01020813, + 0.003730774, + -0.07519531, + -1.449585e-4, + -0.007297516, + 0.02520752, + -0.022659302, + 0.04397583, + -0.037078857, + -0.025314331, + -0.0029659271, + 0.020645142, + -0.023147583, + -0.0027770996, + 0.01612854, + 0.0109939575, + -0.024230957, + -0.04675293, + 0.028045654, + 0.008842468, + 0.01436615, + 0.06188965, + -0.040100098, + 0.00504303, + -0.0051994324, + 0.012168884, + 0.03894043, + -0.031188965, + -0.024871826, + 0.00705719, + -0.023117065, + -0.034851074, + -0.016418457, + 0.030792236, + -0.071777344, + -0.033996582, + 0.0028572083, + -0.017700195, + -0.022583008, + -0.05102539, + -0.08782959, + -0.012626648, + -0.0027809143, + -0.05618286, + -0.0060157776, + -0.006614685, + -0.014907837, + -0.009010315, + -0.01826477, + 1.1634827e-4, + 0.01687622, + 0.040222168, + -0.045043945, + 0.027160645, + 0.009254456, + -0.027023315, + -0.019973755, + -7.6293945e-4, + 0.0069847107, + -0.010688782, + -0.010574341, + 0.0026626587, + 0.0116119385, + 0.045806885, + -0.0524292, + -0.032470703, + -0.015457153, + 0.025177002, + -0.020233154, + 0.045806885, + 0.05355835, + 0.021194458, + -0.06793213, + 0.0067253113, + -0.052246094, + 0.012260437, + 0.022232056, + -4.4250488e-4, + -0.03201294, + -0.00566864, + -9.4795227e-4, + -0.025527954, + 0.007396698, + -0.005607605, + 0.031158447, + -0.0049705505, + -0.01348114, + 0.03793335, + -0.05899048, + 0.04257202, + -0.01084137, + 0.02508545, + -0.013671875, + 0.07128906, + -0.035339355, + 0.015037537, + 0.0090789795, + 0.009605408, + 0.015213013, + 0.0126571655, + -0.02633667, + -0.0259552, + 0.066467285, + 0.028457642, + 0.01411438, + -0.0038871765, + 0.048583984, + -0.0015201569, + -0.050109863, + 0.019363403, + 0.056396484, + 0.027191162, + -0.03778076, + -0.015548706, + 0.03591919, + -0.0022506714, + 0.008506775, + -0.053985596, + -0.040283203, + 0.06323242, + -0.038604736, + -0.03741455, + -0.0054855347, + -0.052734375, + -0.008415222, + -0.0018386841, + -0.016357422, + -0.06549072, + 0.0044555664, + 0.06488037, + -0.012664795, + 0.019866943 + ], + "index": 0 + }, + { + "embedding": [ + 0.019348145, + 0.017822266, + -0.043151855, + -0.05883789, + 0.011398315, + 0.00680542, + -0.02267456, + 0.03881836, + 0.010147095, + 0.004142761, + -0.016525269, + -0.013633728, + -0.010345459, + -0.025375366, + 0.021453857, + 0.011779785, + 0.008659363, + 0.0022964478, + -0.01737976, + -0.031433105, + -6.504059e-4, + -0.0046806335, + -0.01777649, + -0.0017089844, + 0.019454956, + 0.07470703, + -0.07305908, + 0.059631348, + -0.034057617, + 0.008666992, + -0.0050582886, + -0.00289917, + 0.033569336, + 0.01638794, + 0.008926392, + 0.027313232, + 0.0026054382, + 0.014060974, + 0.02520752, + -0.025939941, + 0.03265381, + -0.03567505, + -0.08483887, + -0.06173706, + -0.055603027, + -0.0051345825, + 0.01626587, + 0.013511658, + -0.0046653748, + -0.02293396, + 0.016693115, + 0.003540039, + 0.019744873, + -0.068237305, + 4.6539307e-4, + 0.0030212402, + -0.005592346, + -0.03817749, + 0.007621765, + -0.019638062, + -0.013725281, + -0.03213501, + 0.0748291, + 0.019180298, + -0.005432129, + -0.052368164, + -0.0029525757, + 0.053253174, + -0.025665283, + -0.021133423, + 0.0051956177, + -0.020507812, + 0.03616333, + -0.029846191, + -0.03463745, + -0.0070495605, + 0.004508972, + -0.006614685, + 0.016571045, + -0.046569824, + 0.011505127, + 0.053985596, + -0.046173096, + -0.03086853, + 0.010971069, + -0.019638062, + -0.013885498, + -0.022415161, + 0.038330078, + -0.014373779, + -0.010726929, + -0.0035324097, + 0.042816162, + 0.08666992, + -0.013900757, + -0.00806427, + -0.013641357, + -0.019729614, + -0.013504028, + -0.018035889, + 0.0052719116, + -0.025924683, + 0.0178833, + -0.014526367, + 0.010726929, + 0.025146484, + -0.03186035, + -0.007358551, + 0.051330566, + 0.028045654, + -0.010879517, + 0.08050537, + 0.030258179, + 0.008041382, + -0.016906738, + 0.04269409, + 0.03112793, + -0.0012588501, + -0.019012451, + 0.050048828, + 0.028625488, + 0.016571045, + 8.31604e-4, + 0.0110321045, + -0.008041382, + 0.012901306, + -0.030044556, + -0.015991211, + 0.041229248, + -0.01576233, + -0.026794434, + 0.039520264, + -0.06591797, + -0.06518555, + -0.034423828, + 0.019744873, + -0.005241394, + -0.0473938, + -0.015434265, + 0.017959595, + -0.002796173, + -0.016204834, + 0.032318115, + 0.015281677, + -0.018508911, + 0.03463745, + -0.002746582, + -0.0069885254, + 0.0084991455, + -0.037475586, + 0.020050049, + -0.078063965, + 0.015213013, + 0.030410767, + -0.031555176, + 0.055664062, + -0.06951904, + 0.048339844, + -0.011528015, + 0.07305908, + 0.0056991577, + 0.036834717, + 0.080566406, + 0.02746582, + 0.0670166, + -0.05810547, + -0.050109863, + 0.01838684, + 0.028961182, + 0.036590576, + -0.032592773, + 0.031829834, + 0.021697998, + 0.04714966, + 0.019378662, + 0.016204834, + 0.020050049, + 0.00843811, + 0.02960205, + 0.0072250366, + -6.67572e-4, + -0.025344849, + 5.950928e-4, + 0.027008057, + -0.03173828, + -0.023849487, + -0.0014953613, + 0.011138916, + 0.00843811, + 0.033172607, + -0.027709961, + 0.013244629, + -0.024963379, + 0.001783371, + -0.039276123, + -0.07434082, + 0.018707275, + -0.023345947, + -0.011352539, + 0.06378174, + 0.01914978, + -0.0026760101, + 0.030532837, + -0.040161133, + -0.06524658, + 0.011230469, + -0.018859863, + 0.02670288, + 0.025527954, + -0.015731812, + 0.020904541, + -0.04083252, + 0.011314392, + 0.0016403198, + -0.020187378, + -0.026901245, + -0.0206604, + -0.046142578, + -0.022827148, + -6.122589e-4, + -0.02859497, + 0.023269653, + -0.054504395, + 0.012748718, + 0.009941101, + -0.03149414, + -0.0024681091, + -0.040130615, + -0.003818512, + 0.009498596, + -0.0113220215, + 0.013458252, + -0.009277344, + 0.013092041, + -0.011314392, + 0.011795044, + 0.03668213, + 0.05633545, + 0.0072631836, + -0.028442383, + 0.00674057, + 0.018692017, + -0.028656006, + 0.013687134, + 0.022338867, + -0.026947021, + -0.0051498413, + 0.027038574, + 0.014373779, + 0.01852417, + 0.044281006, + -0.04815674, + 0.02758789, + 0.02331543, + -0.0033035278, + 0.010299683, + 0.012519836, + 0.030853271, + 0.016708374, + 0.019012451, + -0.050476074, + 0.016952515, + 0.03378296, + -0.018234253, + -0.033813477, + 0.0141067505, + 0.008476257, + 0.036376953, + -0.0158844, + 0.014755249, + 0.022857666, + -0.021026611, + -0.016723633, + -0.03540039, + 0.08795166, + 0.02923584, + -0.036224365, + -0.012512207, + 0.006980896, + -0.010406494, + 0.0064849854, + -0.017410278, + 0.007850647, + 0.01058197, + 0.05545044, + -0.0013122559, + -0.0026016235, + 0.0014801025, + 0.023956299, + 0.014633179, + 0.052459717, + 4.7636032e-4, + -0.010238647, + 0.027297974, + 0.012290955, + -0.013946533, + 0.036499023, + 0.0022735596, + 0.011383057, + -0.024536133, + -0.037506104, + 0.026290894, + 0.0047836304, + -0.030731201, + -0.005306244, + 0.037750244, + -0.012901306, + 0.02116394, + -0.0069503784, + -0.050964355, + 0.032928467, + 0.0149383545, + 0.018127441, + 0.040802002, + -0.0284729, + -0.062316895, + 0.0017051697, + -0.008911133, + -0.062927246, + -0.08630371, + -0.01739502, + -0.006603241, + -0.0541687, + -0.016921997, + -0.0054359436, + 0.020401001, + -0.03753662, + -0.022659302, + -0.0073623657, + 0.018814087, + 0.01751709, + -0.028839111, + -0.05633545, + -0.0947876, + -0.019500732, + -0.013298035, + 0.0076141357, + -0.004486084, + -0.0022392273, + 0.0395813, + 0.0418396, + -0.040863037, + -0.009239197, + -0.021514893, + 0.010063171, + -0.015167236, + -0.011505127, + 0.022216797, + -0.042022705, + 0.0064048767, + -0.01411438, + -0.04156494, + -0.06585693, + 0.034423828, + 0.043762207, + -0.05508423, + 0.037384033, + 0.042297363, + 0.024261475, + -0.022537231, + 0.015434265, + -0.019180298, + -0.025848389, + 0.008483887, + 0.006072998, + -0.05404663, + -0.013267517, + 0.015930176, + -0.00843811, + 0.008720398, + -0.011291504, + -0.018005371, + -0.0063934326, + 9.918213e-5, + -0.013069153, + 0.0063476562, + -0.06008911, + -0.030960083, + 0.035186768, + -0.023101807, + 0.041046143, + 0.02017212, + 0.048553467, + -0.002439499, + 0.03665161, + 0.008636475, + -0.0060195923, + 0.002752304, + 0.038848877, + 0.014389038, + 0.0033721924, + 0.011856079, + 0.0211792, + 0.013977051, + 0.022125244, + -0.021697998, + -0.032287598, + -0.014953613, + -0.11102295, + 0.0028820038, + 0.04699707, + -0.008033752, + -0.03591919, + -0.011329651, + -0.03289795, + -0.026000977, + 0.008468628, + -0.01158905, + 0.03869629, + 0.032318115, + -0.009017944, + 0.061828613, + 0.028060913, + -0.010635376, + -0.023010254, + -0.004558563, + -0.049621582, + 0.008102417, + 0.03363037, + -0.027938843, + -0.011383057, + -0.040283203, + -0.015602112, + 0.008972168, + -0.012550354, + 0.040161133, + 0.008575439, + 0.03778076, + 0.020111084, + -0.07385254, + -0.026565552, + -0.05178833, + -0.015533447, + -0.03805542, + -0.01234436, + -0.013839722, + -0.034698486, + 0.0284729, + 0.019577026, + -0.009918213, + -0.00680542, + 0.014404297, + -0.02947998, + 0.025756836, + -0.029571533, + -0.020980835, + 0.009979248, + -0.0011415482, + -0.029144287, + -0.036865234, + -0.07354736, + 0.021575928, + 0.0028057098, + 0.0435791, + 0.009857178, + 0.04360962, + 0.020309448, + 0.04437256, + 0.010887146, + -0.014083862, + 0.013687134, + -0.026016235, + 1.296997e-4, + -0.0013065338, + -0.021621704, + 0.02432251, + 0.01777649, + 0.008003235, + -0.033355713, + 0.011192322, + -0.018463135, + 0.017105103, + -0.030090332, + -0.013999939, + 5.4359436e-4, + -2.632141e-4, + 0.0052719116, + -0.021606445, + 0.03591919, + -0.0072021484, + -0.038482666, + 0.009429932, + -0.061798096, + -0.034729004, + -0.0012454987, + -0.022109985, + -0.024475098, + 0.020385742, + 0.008468628, + -0.07696533, + -0.031677246, + -0.051696777, + -0.006149292, + -0.0541687, + -0.027526855, + -0.053222656, + 0.0030765533, + -9.0408325e-4, + -0.026809692, + -0.052520752, + -0.041137695, + 0.0029830933, + -0.012611389, + 0.029830933, + 0.059143066, + -0.05316162, + -0.03869629, + 0.012527466, + 0.032043457, + 0.051330566, + 0.037139893, + 0.023803711, + -0.038757324, + -0.023712158, + -0.012519836, + -0.0035133362, + 0.03286743, + 0.015159607, + -0.008728027, + -0.027496338, + -0.037139893, + -3.118515e-4, + 0.01159668, + 0.016204834, + 0.035736084, + -0.009536743, + 0.02758789, + 0.06793213, + 0.010070801, + -0.07904053, + 0.042022705, + -0.01979065, + -0.01335144, + 0.061462402, + -0.021484375, + 0.0715332, + -0.010345459, + 0.050567627, + 0.046142578, + -0.052490234, + -0.02897644, + -0.0064926147, + 0.013801575, + -0.017074585, + 0.009979248, + -0.03265381, + -0.026931763, + 0.045410156, + 0.02960205, + 0.07287598, + -0.041900635, + -0.06976318, + 0.068237305, + -0.0151901245, + -0.04208374, + -0.07836914, + -0.021575928, + -0.015411377, + 0.009239197, + 0.033843994, + 0.020477295, + 6.713867e-4, + -0.029022217, + 0.009727478, + -0.002067566, + -0.0085372925, + 0.016906738, + -0.042236328, + -0.046142578, + -9.403229e-4, + -0.0033073425, + 0.003736496, + -0.0011863708, + -0.05038452, + 0.013641357, + 0.0030269623, + -0.005508423, + 0.022033691, + -0.0013923645, + 8.31604e-4, + 0.013595581, + -0.0048675537, + -0.032104492, + 0.007797241, + 0.047973633, + -0.029388428, + -0.012680054, + 0.00207901, + 0.027526855, + -0.010246277, + -0.008583069, + -0.057495117, + 0.021911621, + -0.018875122, + -0.024993896, + -0.047851562, + 0.021865845, + -0.022628784, + 0.027313232, + -0.007865906, + -0.04321289, + 0.0146865845, + 0.03665161, + -0.025802612, + -0.017318726, + 0.039123535, + -0.02532959, + 0.033691406, + -0.04434204, + -0.03262329, + 0.02267456, + -0.010414124, + -0.020050049, + 0.013038635, + -0.04547119, + 0.06298828, + 0.009841919, + 0.04321289, + -0.015716553, + -0.038482666, + -0.014427185, + -0.027023315, + 0.006225586, + -0.052368164, + -5.41687e-4, + -0.025802612, + 0.06732178, + -0.021087646, + -0.022521973, + 0.021621704, + -0.053466797, + 0.008346558, + -0.007911682, + -0.018341064, + 0.03894043, + -0.009231567, + 0.018981934, + 0.01436615, + -0.02947998, + 0.047943115, + -0.049713135, + -0.0016555786, + -0.031951904, + 0.053100586, + -0.01260376, + -0.056671143, + -0.006778717, + -0.028366089, + -0.034942627, + 0.044433594, + 0.020019531, + 0.018218994, + -0.01953125, + 0.008705139, + 0.03253174, + 0.019805908, + 0.02607727, + -9.646416e-4, + 0.009384155, + -0.04095459, + 0.031311035, + 0.053100586, + -0.07342529, + 0.02949524, + -0.017654419, + 0.032348633, + 0.016418457, + 0.041229248, + 0.01638794, + -0.036376953, + 0.04147339, + -0.0690918, + -0.009765625, + 0.011505127, + -0.015411377, + -0.0077285767, + 0.024261475, + 0.004901886, + -0.014434814, + 0.026275635, + -0.025604248, + -0.006011963, + 0.037017822, + -0.0060272217, + -0.047668457, + -0.021514893, + 0.043518066, + 0.062316895, + 0.011550903, + -0.031921387, + -0.053863525, + 0.0068359375, + -0.02281189, + -0.020446777, + 0.021026611, + 0.02571106, + -0.008880615, + -0.0030555725, + 0.0072784424, + 0.029891968, + 0.025512695, + -0.022140503, + 0.024047852, + -0.010238647, + -0.0073013306, + 0.01889038, + -0.027404785, + 0.0061950684, + -0.0049743652, + 0.050079346, + 0.025375366, + -0.02394104, + -0.0335083, + -6.132126e-4, + -0.0211792, + -0.002254486, + 0.03765869, + 0.010787964, + -0.009086609, + 0.020233154, + -0.047698975, + -0.02267456, + -0.023498535, + -0.049835205, + 0.031463623, + -0.024978638, + -0.07348633, + -0.015838623, + 0.009498596, + -0.028503418, + 0.0069503784, + 0.03543091, + 0.005519867, + -0.004016876, + -0.02670288, + -0.037597656, + 0.026947021, + -0.0019683838, + -0.0031776428, + -0.023391724, + -0.013069153, + -0.007911682, + 0.02923584, + 0.0118637085, + 0.01864624, + 0.06390381, + 0.015899658, + 0.013053894, + -0.03942871, + 0.0077934265, + -0.019958496, + 9.727478e-4, + 0.008056641, + -0.024993896, + -0.0010318756, + -0.033172607, + 0.030441284, + 0.009239197, + 0.013664246, + -0.026016235, + -0.041259766, + -0.018737793, + -0.008872986, + 0.02130127, + -0.004673004, + 0.026046753, + 0.018493652, + 0.014785767, + 0.03955078, + 0.033447266, + 0.024414062, + 0.01852417, + 0.008857727, + -0.016311646, + -0.04611206, + 0.035095215, + 0.013450623, + -0.04333496, + 0.010131836, + 0.0039749146, + 0.025115967, + -0.013130188, + 0.031707764, + -0.013618469, + 0.03656006, + -0.07507324, + 0.029296875, + -0.037628174, + 0.05706787, + 0.026809692, + 0.0066871643, + 0.012512207, + 1.335144e-4, + 0.010894775, + 0.006378174, + 0.0017242432, + 0.03152466, + 0.011955261, + 0.05517578, + -0.017929077, + -0.015914917, + -0.04550171, + 0.013908386, + 0.045166016, + 0.0289917, + -0.03555298, + -0.004878998, + 0.047729492, + 0.019760132, + 0.0020599365, + 0.0018463135, + -0.0016708374, + -0.009841919, + 0.034454346, + -0.019058228, + 0.03753662, + 0.021224976, + 0.0056648254, + 0.011039734, + -0.015701294, + -0.026641846, + 0.040161133, + 0.037017822, + -0.028884888, + -0.033325195, + -0.013412476, + 0.042388916, + -0.02645874, + 0.019424438, + 2.746582e-4, + -0.0071792603, + -0.025543213, + 0.004501343, + 0.043304443, + 0.006175995, + 0.0109939575, + 0.011016846, + -0.044006348, + 0.03086853, + 0.04348755, + -0.010322571, + 0.00818634, + -0.036346436, + -0.0127334595, + -0.043914795, + -0.014511108, + 0.02961731, + 0.032470703, + 0.033050537, + 0.04119873, + 0.036743164, + 0.0541687, + -0.0014286041, + -0.024383545, + 0.021499634, + 0.06726074, + -0.020614624, + -0.05783081, + -0.01134491, + 0.005634308, + 0.008583069, + -0.0065078735, + -0.066223145, + 0.002603531, + 0.016906738, + -0.026931763, + -0.0061912537, + -0.017669678, + 0.0022144318, + -0.06304932, + -0.008529663, + 0.028778076, + 0.003320694, + -0.07421875, + -0.038269043, + 9.95636e-4, + 1.1444092e-4, + -0.031463623, + 0.005279541, + 0.037963867, + 0.0057258606, + -0.0075912476, + 0.036376953, + -0.021026611, + 0.002193451, + -0.051757812, + 0.022949219, + 0.06347656, + 0.023605347, + -0.0059051514, + 0.06750488, + -0.047668457, + -0.02168274, + 0.03314209, + -0.026184082, + 0.04373169, + -0.04046631, + 0.01322937, + -0.036987305, + 0.044525146, + -0.052581787, + -0.0317688, + -0.0043296814, + -0.0033950806, + -0.05255127, + 0.015960693, + 0.09234619, + 0.040130615, + 9.1552734e-5, + -0.027297974, + -0.018188477, + 0.010848999, + -0.011695862, + 0.037841797, + -0.0110321045, + -0.052734375, + -0.016784668, + -0.026916504, + 0.031799316, + -0.035888672, + -0.047546387, + -0.03503418, + -9.3460083e-4, + 0.0234375, + 0.04058838, + 0.0021095276, + 0.025497437, + -0.070007324, + -0.02861023, + 0.010627747, + -0.00356102, + -0.030029297, + -0.024291992, + 0.036346436, + 0.0015792847, + -0.00749588, + 0.0026607513, + -0.019927979, + -0.002811432, + -0.060333252, + -0.012084961, + 0.0017871857, + -0.020812988, + -0.0064430237, + -0.023834229, + 0.039855957, + 0.0158844, + 0.010627747, + -0.038146973, + -0.029266357, + -0.04095459, + -0.0031280518, + -0.012710571, + 0.017837524, + -0.0010976791, + 0.016723633, + -0.058532715, + -0.028762817, + -0.0072402954, + 0.057891846, + 0.018936157, + 0.04626465, + -0.015991211, + -0.052642822, + -0.047302246, + -0.01083374, + -0.027679443, + 0.054901123, + 0.030517578, + -0.0357666, + 0.011528015, + 0.01928711, + -0.025848389, + -0.014770508, + 0.007347107, + 0.042663574, + 0.03540039, + 0.0013771057, + 0.014671326, + 0.040771484, + -0.027542114, + 0.105041504, + 0.0054626465, + -0.01008606, + -0.078308105, + 0.0569458, + 0.009422302, + 0.018722534, + 0.0113220215, + 0.04272461, + -0.012840271, + 0.068359375, + 0.0024909973, + 0.0034179688, + 0.007865906, + 0.0045814514, + 0.020950317, + -0.030715942, + 0.02178955, + -0.0061416626, + 0.011512756, + -0.032287598, + 9.899139e-4, + -0.060577393, + 0.02255249, + -0.049316406, + -0.044158936, + -0.014343262, + -0.030014038, + -0.016983032, + -0.01864624, + 0.032287598, + -0.03326416, + 0.02684021, + -0.024658203, + -3.1232834e-4, + -0.010421753, + -0.012039185, + 0.068847656, + -0.0289917, + -0.022964478, + -0.036590576, + 0.04083252, + 9.5653534e-4 + ], + "index": 1 + }, + { + "embedding": [ + 0.024719238, + 0.0038871765, + -0.004085541, + -0.017211914, + -0.046844482, + -0.0178833, + -0.024276733, + -0.028701782, + 0.008277893, + 0.028396606, + -0.050476074, + -9.7465515e-4, + 1.1253357e-4, + -0.023284912, + 0.025390625, + -0.00667572, + 0.029586792, + 0.0152282715, + 0.0062332153, + -0.008354187, + -0.04336548, + 0.007507324, + 3.2806396e-4, + -0.02381897, + -0.014297485, + -0.022109985, + 0.0519104, + -0.012817383, + 0.019927979, + -0.029129028, + 0.008285522, + 0.008865356, + 4.6920776e-4, + 0.053955078, + -0.02696228, + 0.06329346, + -0.031311035, + 0.03543091, + 0.030807495, + -0.018066406, + -0.0024490356, + 0.0015487671, + 0.036071777, + -0.011619568, + 0.0012283325, + -0.0231781, + 0.049957275, + -0.03265381, + 0.008926392, + -0.0024166107, + 0.0030155182, + -0.00573349, + -0.019821167, + 0.060913086, + -0.0033798218, + 0.030548096, + -0.018310547, + 0.021270752, + 0.042541504, + 0.011528015, + -0.030044556, + 0.0011692047, + 0.03152466, + -0.03555298, + 0.0043792725, + -0.047729492, + -0.02357483, + 0.036895752, + 0.05895996, + 9.441376e-4, + -0.027557373, + -8.9645386e-5, + -0.008636475, + -0.01687622, + -0.048034668, + -0.0049057007, + 0.048980713, + 0.022705078, + -0.027526855, + -0.027069092, + 0.0061035156, + -0.008102417, + -0.02746582, + 3.8146973e-5, + -0.006111145, + 0.0043640137, + 0.013496399, + -0.021499634, + 0.03778076, + -0.029083252, + 0.00793457, + 0.06964111, + -0.026626587, + 0.072631836, + -0.023406982, + -0.020629883, + 0.009048462, + 0.013381958, + -0.005455017, + -0.02708435, + -0.016784668, + -0.032226562, + -2.2411346e-5, + -0.026000977, + 0.04309082, + -0.024337769, + -0.028808594, + -0.044006348, + 0.0947876, + 0.040893555, + -0.0211792, + 0.13537598, + -0.014442444, + -0.032470703, + 0.04135132, + 0.014541626, + -0.04650879, + 0.03665161, + -0.0029563904, + -0.037109375, + -0.0044784546, + -0.0011177063, + 0.015029907, + -0.014465332, + 0.034301758, + 0.02079773, + -0.03375244, + -0.015182495, + 0.003124237, + 0.0019378662, + -0.024978638, + 0.051757812, + -0.06640625, + -0.04852295, + -0.034057617, + -0.011741638, + -0.082214355, + -0.0032348633, + -0.03137207, + 0.013931274, + -0.016296387, + -0.04748535, + 0.05255127, + -6.790161e-4, + -0.06616211, + 0.066833496, + 0.053527832, + -0.023208618, + -0.072265625, + -0.079833984, + -0.027328491, + -0.003955841, + -0.0040626526, + 0.019851685, + -0.007701874, + 0.0074005127, + -0.04812622, + 0.0041160583, + 0.03692627, + 0.030349731, + -0.0011253357, + -0.024795532, + -0.0018844604, + -0.011932373, + -0.024429321, + 0.021011353, + 0.012504578, + 0.020309448, + 0.012306213, + 0.105407715, + -0.040039062, + -0.008415222, + 0.0063285828, + -0.021850586, + -0.020385742, + -0.013938904, + -0.01676941, + -0.0051498413, + 0.028518677, + 0.028778076, + 0.023208618, + -0.016052246, + -0.0076446533, + 0.01701355, + -0.012542725, + -0.080444336, + 0.031097412, + 7.7295303e-4, + -0.0105896, + 0.041412354, + 0.027542114, + 0.015960693, + -0.017501831, + 0.0015907288, + 0.0023498535, + 0.024902344, + -0.035339355, + 0.02192688, + -0.004508972, + -0.014198303, + -0.0113220215, + 0.04852295, + -0.023376465, + 0.0036697388, + 0.031585693, + -0.0016155243, + 0.023086548, + 0.0038986206, + -0.0033226013, + 0.039733887, + 0.018478394, + -0.023483276, + 0.009803772, + -0.009963989, + -0.01133728, + -0.02973938, + -0.01701355, + -0.052825928, + -0.025146484, + -0.025482178, + 0.0038375854, + 0.027160645, + -0.03060913, + 0.044891357, + 0.009521484, + 0.03817749, + -0.012367249, + 0.014259338, + 0.03616333, + 0.047424316, + 0.03048706, + -0.07324219, + 0.021347046, + -0.00415802, + -0.03262329, + -0.005470276, + -0.011421204, + -0.035064697, + -0.005432129, + 0.049926758, + 0.041290283, + 0.020187378, + 0.026763916, + -0.015716553, + 0.09460449, + 0.028625488, + 0.046203613, + -0.027954102, + -0.0074920654, + 0.052978516, + 0.02748108, + 0.013336182, + 0.0020561218, + 0.033325195, + -0.04321289, + 0.056243896, + 0.0061798096, + 0.0067863464, + -0.005592346, + 0.041229248, + -0.023620605, + 0.064697266, + 0.0390625, + -0.005054474, + -0.0154800415, + -0.046203613, + -0.03945923, + -0.023498535, + -0.011993408, + -0.008117676, + 0.037231445, + -0.041046143, + -0.007461548, + 0.010955811, + 0.064331055, + -0.048858643, + -0.034301758, + 0.001657486, + 0.017044067, + 0.00340271, + 0.020050049, + 0.08679199, + 0.066101074, + 0.010536194, + -0.0045547485, + 0.06518555, + 0.01159668, + 2.808571e-4, + -0.03918457, + -8.277893e-4, + 0.028778076, + 0.06451416, + 0.014556885, + 0.03793335, + 0.041046143, + 0.039001465, + 0.0062332153, + 0.014602661, + -0.01663208, + -0.029281616, + -0.03302002, + 0.02532959, + 0.0018920898, + -0.0076828003, + 0.011940002, + 0.03994751, + 0.040618896, + -0.014190674, + -0.013031006, + -0.0055007935, + -0.014678955, + 0.028808594, + -0.0014152527, + -0.009170532, + 0.010734558, + -0.019744873, + 0.013145447, + -0.015670776, + -0.022415161, + -0.042236328, + 0.07751465, + 0.0340271, + -0.038513184, + -0.0062446594, + 0.009315491, + -0.0206604, + -0.008491516, + -0.03668213, + -0.04989624, + -0.017364502, + -0.02772522, + -0.07800293, + -0.037628174, + -0.026672363, + 0.0034503937, + 0.0032863617, + 0.009742737, + 0.01007843, + 0.009506226, + 0.021194458, + 0.051208496, + 0.030090332, + 0.020904541, + -0.012069702, + 0.015464783, + -0.022857666, + -0.06112671, + 0.005836487, + 0.0032520294, + -0.028564453, + 0.023971558, + -0.025939941, + -0.0206604, + 0.029754639, + 0.059753418, + -0.019592285, + -0.0057792664, + 0.06854248, + 0.07006836, + 0.0013427734, + 0.046875, + -0.001821518, + 0.024307251, + -0.050598145, + -0.047668457, + -0.058929443, + 7.1525574e-4, + -0.005126953, + 0.009002686, + 0.05206299, + 0.064697266, + -0.0034255981, + -0.018585205, + -0.0013313293, + -0.06756592, + -0.0541687, + -0.014480591, + -0.054504395, + -0.030700684, + -0.038604736, + 0.006225586, + 9.6559525e-4, + 0.038208008, + 0.003255844, + 0.027145386, + -0.0021324158, + 0.06384277, + 0.08703613, + 0.037841797, + -0.011329651, + -0.026489258, + 4.377365e-4, + -0.028640747, + -0.004753113, + 0.033203125, + 0.004081726, + 0.023162842, + -0.03869629, + -0.060577393, + -0.01977539, + 0.06072998, + -0.024398804, + -0.05126953, + 0.010681152, + -0.050354004, + 0.003227234, + 0.032043457, + -0.03060913, + -0.00289917, + 0.033477783, + 0.025268555, + -0.018478394, + 0.07269287, + -0.0435791, + 0.029953003, + -0.04046631, + -0.030395508, + 9.441376e-5, + -0.011474609, + 0.02796936, + -0.0046539307, + 0.009277344, + -0.030151367, + -0.010513306, + 0.011207581, + 6.1035156e-5, + 0.04626465, + 0.006816864, + 0.017608643, + 8.163452e-4, + 0.03173828, + -0.033416748, + -0.005630493, + 0.027160645, + -0.01461792, + 0.025039673, + -0.005466461, + 0.0, + 0.035095215, + -0.026351929, + -0.011398315, + -7.753372e-4, + 0.03817749, + 0.0018005371, + 0.023269653, + -0.0109939575, + 0.0040740967, + -0.0028419495, + -0.03378296, + 0.042999268, + -0.062072754, + 0.015655518, + -0.03793335, + 0.031707764, + -0.05026245, + 0.017868042, + 0.01184082, + 0.032287598, + 0.0040397644, + -0.010513306, + 0.031555176, + -0.021057129, + -0.043151855, + 0.0025558472, + 0.004081726, + 0.020965576, + 0.046539307, + 1.335144e-4, + 0.0022773743, + 0.0065689087, + 0.009567261, + -0.050323486, + -0.020431519, + -0.012496948, + -5.3167343e-5, + -0.012756348, + -0.015655518, + 0.014602661, + -0.007457733, + -0.014450073, + 0.025619507, + -0.017425537, + -0.0057754517, + -0.035217285, + 0.0034103394, + 0.013191223, + -0.057128906, + 0.016571045, + 0.03161621, + 0.02734375, + 0.0055999756, + -0.01486969, + 0.043701172, + -0.008125305, + -0.023788452, + -0.004764557, + -0.02293396, + -0.010879517, + 0.0014381409, + -0.10736084, + -0.01651001, + 0.006755829, + 0.026794434, + 0.021713257, + 0.042114258, + -0.05218506, + -0.055755615, + 0.003768921, + 0.021697998, + 0.012268066, + 0.02331543, + -0.0104599, + 0.0061569214, + -0.040893555, + -0.009979248, + 0.08013916, + -0.030563354, + -0.01914978, + 0.016983032, + 0.0018806458, + 0.06530762, + 0.039794922, + 0.017349243, + -8.8882446e-4, + 0.03543091, + 0.0018692017, + -0.011436462, + 6.2561035e-4, + -0.03527832, + -0.072021484, + -0.006603241, + -0.017913818, + 0.0016555786, + 0.027404785, + 0.042175293, + 0.080078125, + -0.016983032, + -0.003622055, + -0.0062561035, + -0.019622803, + -0.028930664, + -0.023025513, + -0.02659607, + -0.0012245178, + 0.002784729, + -0.050567627, + 0.012207031, + 0.047668457, + 0.020141602, + 0.005996704, + 0.043395996, + -3.8909912e-4, + -0.02267456, + -0.012161255, + -0.019744873, + -0.007801056, + -0.0211792, + 0.012863159, + -0.049621582, + -0.024291992, + 0.0023403168, + 0.02532959, + -0.017150879, + 0.0029907227, + -0.015823364, + 0.00894165, + -0.014091492, + -0.02229309, + -0.0043411255, + 0.013755798, + -0.04776001, + -0.019866943, + 0.013435364, + -0.0022659302, + -0.0013523102, + -0.0053520203, + -0.040283203, + 0.0074501038, + 0.013191223, + 0.03652954, + -0.0021896362, + 0.030059814, + -0.0054016113, + 0.011558533, + 0.056030273, + -0.009162903, + -0.04849243, + 0.0049819946, + 0.01890564, + -0.0033359528, + -0.0052337646, + -0.036346436, + -0.030471802, + -0.026107788, + 0.013366699, + -9.045601e-4, + 0.064208984, + -0.003490448, + 0.0037937164, + 0.014907837, + -0.016555786, + 0.016189575, + 0.019378662, + -0.0061035156, + 0.02633667, + 0.03945923, + 0.0044288635, + 0.027832031, + 0.011894226, + 0.0028495789, + 0.028060913, + -7.171631e-4, + -0.031585693, + 0.033050537, + -0.028152466, + -0.0056991577, + 0.04446411, + 0.056640625, + 4.6920776e-4, + -0.008285522, + 0.038482666, + -0.008049011, + 0.028259277, + 0.007194519, + -0.04864502, + -0.034057617, + 0.0044174194, + 0.0110321045, + 0.0070152283, + 0.009185791, + 0.033203125, + 0.0018196106, + -0.07086182, + -0.0368042, + -0.026901245, + 0.058929443, + -0.048217773, + -0.05621338, + -0.0067253113, + 0.044769287, + 8.215904e-4, + 0.035858154, + 0.062683105, + -0.034729004, + 0.031982422, + -0.045043945, + 0.017547607, + 0.016494751, + -0.05142212, + -0.009918213, + 0.007904053, + 0.025802612, + 0.01134491, + 0.028961182, + 0.011360168, + -0.007045746, + 0.0124053955, + 0.006465912, + 0.008628845, + -0.0736084, + -0.016906738, + -0.002861023, + -0.026123047, + -0.021133423, + -1.3113022e-4, + -0.03503418, + 0.08251953, + -0.0027313232, + 0.027526855, + -0.066101074, + -0.007637024, + -0.0060577393, + -0.022628784, + 0.0045547485, + 0.010421753, + 0.026245117, + 0.020645142, + 0.017059326, + 0.005027771, + -0.004463196, + -0.011245728, + -0.01689148, + -3.4236908e-4, + 0.017562866, + -0.040008545, + -0.015037537, + 0.01953125, + 0.054870605, + -0.008026123, + -0.031799316, + -0.0385437, + 0.040008545, + -0.034362793, + -0.013015747, + -0.0029945374, + 0.0030174255, + -0.020843506, + 8.544922e-4, + 0.048461914, + 0.008880615, + 0.005191803, + -0.0058670044, + 0.008758545, + -0.0135269165, + 0.024398804, + 0.03881836, + -0.02027893, + -0.01890564, + -0.008918762, + 0.018249512, + -0.006248474, + 0.013214111, + -0.058746338, + -0.030273438, + 0.04736328, + -0.030883789, + 0.010261536, + 0.022964478, + 0.020477295, + -0.037322998, + -0.0012664795, + -0.006225586, + -0.0040664673, + -0.026885986, + 0.0236969, + 0.0027198792, + -0.025909424, + 0.031188965, + 0.011314392, + -0.024612427, + 0.020553589, + 6.837845e-4, + 0.00178051, + -0.015342712, + 0.020217896, + -0.05709839, + 0.023254395, + 0.02722168, + -0.0037212372, + 0.03277588, + -0.013847351, + 4.2200089e-4, + 0.035705566, + 0.026794434, + 0.020446777, + 0.060424805, + 0.013412476, + 0.023010254, + 0.022659302, + 0.04510498, + 0.05065918, + -0.010437012, + -0.014968872, + 0.028900146, + 6.6947937e-4, + 0.031234741, + 0.043304443, + 0.0064048767, + -0.0121536255, + -0.013847351, + -0.06378174, + -0.005302429, + -0.010643005, + 0.030761719, + -9.460449e-4, + 0.016143799, + -0.06561279, + -0.004928589, + 0.021362305, + -0.03778076, + -0.014099121, + 0.06854248, + -0.03677368, + -0.103393555, + 0.05218506, + -0.030914307, + 0.020126343, + -0.01361084, + 0.016296387, + 0.029891968, + 0.014511108, + -0.008712769, + -0.026733398, + -0.02494812, + -0.008712769, + -0.018341064, + 0.02609253, + 0.017837524, + 0.009590149, + 0.025512695, + -0.008117676, + 0.029525757, + -0.016555786, + 0.004436493, + 0.002029419, + -0.00724411, + -0.014846802, + -0.0018310547, + 0.034698486, + -0.018173218, + 0.008926392, + -0.07336426, + 0.052978516, + -0.0018997192, + 0.031097412, + -0.09466553, + 0.013046265, + 0.052520752, + -0.03112793, + 0.017150879, + -0.017562866, + -0.001876831, + -0.018615723, + 0.002418518, + -0.023971558, + 0.0011634827, + -0.015777588, + 0.002910614, + -0.01927185, + -0.06213379, + 7.953644e-4, + 0.027557373, + 0.007843018, + 0.0028495789, + 0.044067383, + -0.040008545, + 0.05557251, + 0.006565094, + 0.015975952, + -0.011947632, + -0.005077362, + -0.033935547, + 0.036834717, + 0.0446167, + 0.018981934, + 0.048919678, + -0.050109863, + 0.014884949, + -0.03201294, + 0.0101623535, + -6.2179565e-4, + -0.045928955, + 0.016860962, + 0.038635254, + -0.08178711, + 0.023284912, + -0.0010576248, + 0.007736206, + 0.025665283, + 0.03326416, + 0.043670654, + 0.047576904, + -0.026367188, + 0.025482178, + 0.04071045, + 0.066345215, + 0.043029785, + -0.036193848, + -0.013587952, + 0.0076141357, + -0.025390625, + 0.014793396, + -0.011413574, + 0.03591919, + 0.03390503, + 0.018997192, + -0.023391724, + 0.003929138, + -0.023117065, + -0.015312195, + 0.009353638, + 0.015686035, + 0.04437256, + -0.033233643, + -0.03225708, + 0.011062622, + 0.0184021, + -0.06311035, + 0.016082764, + 0.02230835, + 0.048828125, + 0.050231934, + 0.047576904, + 0.0025463104, + -0.016433716, + 0.035491943, + -0.014846802, + 0.027557373, + -0.024276733, + -0.004676819, + 0.030273438, + -0.044158936, + 0.008987427, + 0.0035629272, + -0.026412964, + 0.0284729, + -0.007221222, + 0.03866577, + -0.035705566, + 0.0017852783, + -0.01109314, + -0.045318604, + 0.0059776306, + -0.014480591, + -0.006664276, + 0.012359619, + 0.017700195, + -0.022979736, + -1.449585e-4, + -0.050201416, + -0.024353027, + 0.006385803, + 0.012039185, + 0.050811768, + -0.03918457, + -0.034423828, + 0.021972656, + 0.016479492, + 0.061309814, + 0.016815186, + -0.009727478, + -0.0028266907, + -0.0039482117, + -0.03967285, + -3.8528442e-4, + 0.021331787, + -0.01083374, + -0.060028076, + -0.029205322, + 0.02017212, + 0.02859497, + -0.03543091, + -0.095458984, + 0.057403564, + -0.027572632, + -0.034606934, + -3.6239624e-4, + -0.015625, + -0.0014190674, + -0.037017822, + -0.03012085, + 0.028427124, + -0.0073051453, + 0.023162842, + -0.055603027, + 0.0309906, + -0.019592285, + -0.016845703, + 0.022232056, + 0.012123108, + 0.03353882, + -0.035858154, + -0.023773193, + 1.6784668e-4, + 0.01876831, + 0.06665039, + -0.018569946, + -0.05810547, + 0.015670776, + 0.009292603, + -0.0418396, + 0.042236328, + 0.025375366, + 0.012001038, + 6.3323975e-4, + 0.022384644, + -0.032592773, + 0.009857178, + -0.0028247833, + 0.04244995, + 0.021347046, + 0.023040771, + -0.05429077, + 0.034088135, + 0.015304565, + -0.045562744, + 0.015380859, + 0.014579773, + -0.035858154, + 0.036468506, + 0.0016212463, + 0.021835327, + -0.040740967, + 0.032287598, + -0.0048065186, + 0.04925537, + -0.019927979, + 0.02432251, + 0.0076828003, + -0.02545166, + 0.011375427, + 0.03186035, + -0.016036987, + -0.010757446, + 0.019424438, + 0.0059051514, + 0.013824463, + -0.008598328, + 0.033599854, + -0.013267517, + -0.022277832, + -0.013534546, + 0.013717651, + -0.027069092, + 0.015167236, + -0.036102295, + 0.0056114197, + -0.023162842, + -0.03955078, + 0.07281494, + -0.036071777, + 0.04156494, + -0.05090332, + 0.023971558, + -6.9618225e-4, + 0.022232056, + 0.0024776459, + -0.059387207, + -0.0014419556, + -0.035736084, + -0.032226562, + -0.02293396, + -0.032318115, + 0.01525116 + ], + "index": 2 + } + ] + }, + "headers": { + "connection": [ + "keep-alive" + ], + "content-type": [ + "application/json" + ], + "date": [ + "Tue, 27 Jan 2026 12:11:55 GMT" + ], + "x-amzn-bedrock-input-token-count": [ + "11" + ], + "x-amzn-bedrock-invocation-latency": [ + "95" + ], + "x-amzn-requestid": [ + "d6804b06-2050-4c13-b780-87db2662aef7" + ] + }, + "status": 200 + } +} \ No newline at end of file diff --git a/test/support/provider_test/embedding.ex b/test/support/provider_test/embedding.ex index 02b1bf8a9..2752960d6 100644 --- a/test/support/provider_test/embedding.ex +++ b/test/support/provider_test/embedding.ex @@ -39,7 +39,7 @@ defmodule ReqLLM.ProviderTest.Embedding do @models ModelMatrix.models_for_provider(provider, operation: :embedding) setup_all do - LLMDB.load(allow: :all, custom: %{}) + LLMDB.load(allow: :all, custom: Application.get_env(:llm_db, :custom, %{})) :ok end