Skip to content

feat(embeddings): add AWS Bedrock embedding provider#1929

Open
v0ropaev wants to merge 2 commits into
NVIDIA-NeMo:developfrom
v0ropaev:feature/139-bedrock-embeddings
Open

feat(embeddings): add AWS Bedrock embedding provider#1929
v0ropaev wants to merge 2 commits into
NVIDIA-NeMo:developfrom
v0ropaev:feature/139-bedrock-embeddings

Conversation

@v0ropaev
Copy link
Copy Markdown

@v0ropaev v0ropaev commented May 25, 2026

Description

Adds a new embedding provider that integrates AWS Bedrock with NeMo Guardrails. The provider is registered under the bedrock engine name and supports two vendor families served through Amazon Bedrock Runtime:

  • Amazon Titan Text Embeddingsamazon.titan-embed-text-v1 (1536-dim) and amazon.titan-embed-text-v2:0 (1024-dim, configurable 256/512/1024 via dimensions). Titan's API accepts one input per request, so multi-document calls are dispatched as a sequence of invoke_model requests.
  • Cohere Embed v3 on Bedrockcohere.embed-english-v3, cohere.embed-multilingual-v3, cohere.embed-english-light-v3, cohere.embed-multilingual-light-v3. Cohere on Bedrock supports batching, so all documents go in a single request with the configurable input_type (default search_document).

Vendor dispatch is decided in __init__ by splitting the model id on ".", so adding a new family later is a small change (a new _encode_<vendor> method).

Example config

core:
  embedding_search_provider:
    name: default
    parameters:
      embedding_engine: bedrock
      embedding_model: amazon.titan-embed-text-v2:0
      region_name: us-east-1

Dependency

boto3 is added as an optional dependency, exposed via the new extra:

pip install nemoguardrails[bedrock]

Lazy import boto3 inside __init__ keeps overhead at zero when the extra is not installed, and a clear ImportError directs the user to the extra. Authentication uses the standard boto3 credential chain (env vars, ~/.aws/credentials, IAM role) — no eager validation, matching the style of the other providers.

Tests

  • Mock tests (TestBedrockEmbeddingModelMocked, 18 cases) cover: known/unknown models for both vendors, dimensions/normalize/input_type parameters, lazy embedding_size initialization (no AWS call until .embedding_size is read), kwargs forwarding to boto3.client, error wrapping in RuntimeError, async/sync encode parity, and the empty-input fast path. All 18 pass locally. No AWS calls are made and boto3 does not need to be installed for these tests.
  • Live tests (tests/test_embeddings_bedrock.py, 4 cases) follow the existing LIVE_TEST=1 gating used by test_embeddings_cohere.py / test_embeddings_google.py. They cover sync, async, and a Cohere-on-Bedrock batched call.

Docs

  • Added bedrock row to the embedding model providers table in docs/about/supported-llms.md.
  • Added a worked configuration example and notes on the dependency and AWS credential resolution in docs/configure-rails/other-configurations/embedding-search-providers.md.

Related Issue(s)

Fixes #139

Checklist

  • I've read the CONTRIBUTING guidelines.
  • I've updated the documentation if applicable.
  • I've added tests if applicable.
  • @mentions of the person or team responsible for reviewing proposed changes.

cc @Pouyanpi

Summary by CodeRabbit

  • New Features

    • Added AWS Bedrock embedding provider support with Amazon Titan and Cohere model families.
  • Documentation

    • Updated supported LLMs documentation to include Bedrock.
    • Added configuration guide for using Bedrock-hosted embedding models.
  • Chores

    • Added optional boto3 dependency for Bedrock support via the bedrock extra.
  • Tests

    • Added test coverage for Bedrock embeddings with multiple model configurations.

Review Change Stack

Add `BedrockEmbeddingModel` (engine name `bedrock`) that supports
Amazon Titan Text Embeddings v1/v2 and the Cohere Embed v3 family
served through AWS Bedrock Runtime. Titan models dispatch one
`invoke_model` request per document; Cohere models batch all
documents into a single request.

Authentication relies on the standard boto3 credential chain.
`boto3` is added as an optional dependency, exposed via the new
`nemoguardrails[bedrock]` extra, with lazy import so the provider
has zero overhead when the extra is not installed.

Mock test coverage in `TestBedrockEmbeddingModelMocked` exercises
the dispatch logic, lazy `embedding_size` resolution, kwargs
forwarding to `boto3.client`, error wrapping, and async/sync
encode parity. Live tests under `LIVE_TEST=1` validate end-to-end
against a real AWS account.

Fixes NVIDIA-NeMo#139

Signed-off-by: Dmitry Voropaev <workerv0ropaev@yandex.ru>
@github-actions
Copy link
Copy Markdown
Contributor

Documentation preview

https://nvidia-nemo.github.io/Guardrails/review/pr-1929

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 25, 2026

📝 Walkthrough

Walkthrough

This PR adds AWS Bedrock embedding model support to NeMo Guardrails. It implements a new BedrockEmbeddingModel provider that uses boto3 to invoke Amazon Titan and Cohere embedding models hosted on AWS Bedrock, with complete provider registration, optional dependency management, comprehensive test coverage, and user documentation.

Changes

Bedrock Embeddings Integration

Layer / File(s) Summary
Core Bedrock embedding model implementation
nemoguardrails/embeddings/providers/bedrock.py
BedrockEmbeddingModel wraps boto3 Bedrock Runtime calls with vendor-specific encoding logic: Titan embeddings are retrieved per-document with optional dimensions and normalize fields; Cohere embeddings are sent in a single batched request. The class includes lazy embedding_size initialization, async execution via thread executor, and error translation to RuntimeError.
Provider registration and dependency wiring
nemoguardrails/embeddings/providers/__init__.py, pyproject.toml
Bedrock provider is imported and registered with EmbeddingProviderRegistry, making it discoverable alongside built-in providers. boto3 >=1.34.0 is declared as an optional dependency, with a new bedrock Poetry extra and inclusion in the all extra.
Test configuration and live integration tests
tests/test_configs/with_bedrock_embeddings/config.co, tests/test_configs/with_bedrock_embeddings/config.yml, tests/test_embeddings_bedrock.py
A test Rails configuration with Titan v2 and OpenAI models is defined; an app fixture constructs LLMRails from this config. Live tests validate provider registration and test synchronous/asynchronous Titan encoding and batched Cohere encoding, gated by the LIVE_TEST environment variable.
Mocked unit tests for provider behavior
tests/test_embeddings_providers_mock.py
TestBedrockEmbeddingModelMocked covers model initialization across all Bedrock model families (Titan v1/v2, Cohere), configuration options (dimensions, region_name, AWS credentials), vendor-specific encoding invocation patterns and request payloads, empty document handling, error wrapping, async execution, lazy embedding size computation, and dimension verification for all predefined models.
Documentation updates for Bedrock embeddings
docs/about/supported-llms.md, docs/configure-rails/other-configurations/embedding-search-providers.md
Supported LLMs documentation lists AWS Bedrock as an embedding provider. Embedding search providers documentation adds Bedrock configuration details, supported model families, installation instructions for the optional bedrock extra, and notes on boto3 credential chain authentication.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 5 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 12.12% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding AWS Bedrock as a new embedding provider implementation.
Linked Issues check ✅ Passed The PR implements all key requirements from issue #139: supports Bedrock embedding models (Titan and Cohere), provides engine registration as 'bedrock', enables model_id configuration, and integrates with the embeddings provider system.
Out of Scope Changes check ✅ Passed All changes are directly scoped to adding Bedrock embedding support: provider implementation, registration, documentation, tests, dependencies, and configuration examples. No unrelated modifications present.
Test Results For Major Changes ✅ Passed PR includes comprehensive testing: 18 mock tests covering initialization, encoding, error handling; 4 live tests verifying embedding dimensions and batch behavior, all documented in PR summary.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (3)
docs/configure-rails/other-configurations/embedding-search-providers.md (2)

110-111: 💤 Low value

Consider clarifying whether region_name is required.

The configuration example above shows region_name: us-east-1, but this paragraph doesn't specify whether the parameter is required or optional. Since boto3 can infer the region from the standard credential chain (environment variables, AWS config files), it would be helpful to note that region_name can be omitted if the region is configured in the user's AWS environment.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/configure-rails/other-configurations/embedding-search-providers.md`
around lines 110 - 111, Clarify that the region_name parameter in the AWS
Bedrock configuration is optional: note that region_name (shown in the example)
can be omitted because boto3 will infer the region via its standard credential/
config chain (environment variables, ~/.aws/credentials or config, or IAM role),
but if you want to override the inferred region you can set region_name
explicitly; reference the region_name parameter and boto3 credential chain and
the supported models (e.g., amazon.titan-embed-text-v1, cohere.embed-english-v3)
so readers know where to apply this guidance.

87-109: ⚡ Quick win

Document optional configuration parameters for advanced use cases.

The PR summary indicates that Titan v2 supports configurable dimensions (256/512/1024) and Cohere models support configurable input_type (default search_document). Consider adding a note or example showing how users can configure these optional parameters in the YAML, as advanced users may need to customize embedding dimensions or input types for their specific use cases.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/configure-rails/other-configurations/embedding-search-providers.md`
around lines 87 - 109, Add documentation showing the optional parameters for
advanced embedding configuration under the existing
embedding_search_provider/parameters block: document that for embedding_engine:
titan (amazon.titan-embed-text-v2) users can set dimensions (256/512/1024) via a
dimensions parameter, and for embedding_engine: cohere users can set input_type
(default search_document) via an input_type parameter; update the YAML example
under both core.embedding_search_provider.parameters and
knowledge_base.embedding_search_provider.parameters to include commented or
example entries for dimensions and input_type and include short notes explaining
valid values and defaults so readers can customize embedding dimensions or input
types.
tests/test_embeddings_providers_mock.py (1)

851-1151: ⚡ Quick win

Add a regression test for unsupported vendor IDs.

Given current/future vendor dispatch, add one test asserting an unknown vendor (e.g., foo.embed-x) raises a clear error before any invoke_model call. This will lock in fail-fast behavior.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/test_embeddings_providers_mock.py` around lines 851 - 1151, Add a new
regression test method in TestBedrockEmbeddingModelMocked (e.g.,
test_init_with_unknown_vendor_raises) that uses the existing _fresh_import and a
patched boto3 mock client, calls BedrockEmbeddingModel("foo.embed-x") and
asserts it raises a clear exception (e.g., ValueError) with a descriptive
message about unsupported vendor, and also asserts that
mock_client.invoke_model.assert_not_called() to ensure fail-fast behavior before
any API calls; reference BedrockEmbeddingModel, _fresh_import, and
mock_client.invoke_model in the test.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@nemoguardrails/embeddings/providers/bedrock.py`:
- Around line 143-147: The code currently treats any non-"cohere" vendor as
Titan by calling _encode_titan, which causes wrong payloads for unknown vendors;
update the vendor dispatch in the method that uses self._vendor (the try block
calling _encode_cohere/_encode_titan) to explicitly check for supported vendors
(e.g., if self._vendor == "cohere": return self._encode_cohere(documents) elif
self._vendor == "titan": return self._encode_titan(documents)) and otherwise
raise a clear exception (ValueError or custom) indicating an unsupported vendor
so callers fail fast instead of falling through to Titan.
- Around line 57-60: The BedrockEmbeddingModel.__init__ currently forwards
profile_name in **kwargs to boto3.client which fails; update __init__ to
pop("profile_name", None) from kwargs and, if present, create a
boto3.Session(profile_name=profile_name) and call
session.client("bedrock-runtime", **kwargs) otherwise call
boto3.client("bedrock-runtime", **kwargs) so other aws_* and endpoint_url kwargs
still pass through. Also add validation in encode: before routing to
_encode_titan, check the model family/vendor (used by encode/method calling
_encode_titan) and raise a clear ValueError for unsupported vendors (i.e., allow
"cohere" and "titan" only), so unknown Bedrock model families fail fast with a
helpful message.

In `@tests/test_embeddings_bedrock.py`:
- Around line 22-27: The live Bedrock tests are only gated by LIVE_TEST_MODE but
not by the availability of the provider import; update the skip/guard conditions
in tests/test_embeddings_bedrock.py to require both LIVE_TEST_MODE and that
BedrockEmbeddingModel is not None (i.e., use "if not (LIVE_TEST_MODE and
BedrockEmbeddingModel)" or equivalent) so tests are skipped when
boto3/BedrockEmbeddingModel isn't importable; apply this change to all live-test
guards that currently only check LIVE_TEST_MODE.

---

Nitpick comments:
In `@docs/configure-rails/other-configurations/embedding-search-providers.md`:
- Around line 110-111: Clarify that the region_name parameter in the AWS Bedrock
configuration is optional: note that region_name (shown in the example) can be
omitted because boto3 will infer the region via its standard credential/ config
chain (environment variables, ~/.aws/credentials or config, or IAM role), but if
you want to override the inferred region you can set region_name explicitly;
reference the region_name parameter and boto3 credential chain and the supported
models (e.g., amazon.titan-embed-text-v1, cohere.embed-english-v3) so readers
know where to apply this guidance.
- Around line 87-109: Add documentation showing the optional parameters for
advanced embedding configuration under the existing
embedding_search_provider/parameters block: document that for embedding_engine:
titan (amazon.titan-embed-text-v2) users can set dimensions (256/512/1024) via a
dimensions parameter, and for embedding_engine: cohere users can set input_type
(default search_document) via an input_type parameter; update the YAML example
under both core.embedding_search_provider.parameters and
knowledge_base.embedding_search_provider.parameters to include commented or
example entries for dimensions and input_type and include short notes explaining
valid values and defaults so readers can customize embedding dimensions or input
types.

In `@tests/test_embeddings_providers_mock.py`:
- Around line 851-1151: Add a new regression test method in
TestBedrockEmbeddingModelMocked (e.g., test_init_with_unknown_vendor_raises)
that uses the existing _fresh_import and a patched boto3 mock client, calls
BedrockEmbeddingModel("foo.embed-x") and asserts it raises a clear exception
(e.g., ValueError) with a descriptive message about unsupported vendor, and also
asserts that mock_client.invoke_model.assert_not_called() to ensure fail-fast
behavior before any API calls; reference BedrockEmbeddingModel, _fresh_import,
and mock_client.invoke_model in the test.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: de29a79a-a278-4db0-be9c-2ac89ff9ea71

📥 Commits

Reviewing files that changed from the base of the PR and between e3715f9 and 6a98d1e.

⛔ Files ignored due to path filters (1)
  • poetry.lock is excluded by !**/*.lock
📒 Files selected for processing (9)
  • docs/about/supported-llms.md
  • docs/configure-rails/other-configurations/embedding-search-providers.md
  • nemoguardrails/embeddings/providers/__init__.py
  • nemoguardrails/embeddings/providers/bedrock.py
  • pyproject.toml
  • tests/test_configs/with_bedrock_embeddings/config.co
  • tests/test_configs/with_bedrock_embeddings/config.yml
  • tests/test_embeddings_bedrock.py
  • tests/test_embeddings_providers_mock.py

Comment thread nemoguardrails/embeddings/providers/bedrock.py Outdated
Comment thread nemoguardrails/embeddings/providers/bedrock.py
Comment thread tests/test_embeddings_bedrock.py
@codecov
Copy link
Copy Markdown

codecov Bot commented May 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 25, 2026

Greptile Summary

This PR adds a new BedrockEmbeddingModel embedding provider that integrates AWS Bedrock Runtime into NeMo Guardrails, supporting Amazon Titan Text Embeddings (v1/v2) and Cohere Embed v3 models served via Bedrock.

  • Provider implementation (bedrock.py): vendor dispatch in __init__ via model-id prefix; Titan makes one invoke_model call per document, Cohere batches all texts in a single call; boto3 is imported lazily and dimensions/normalize emit UserWarning when passed to unsupported models.
  • Registration & packaging: provider is registered in providers/__init__.py with engine_name = "bedrock"; boto3 >= 1.34.0 is added as an optional dep under the new bedrock extra and included in all.
  • Tests: 18 mock-based unit tests in test_embeddings_providers_mock.py require no AWS credentials; 4 live integration tests in test_embeddings_bedrock.py are gated behind LIVE_TEST=1.

Confidence Score: 5/5

Safe to merge; the new Bedrock provider is self-contained, does not touch existing provider paths, and has solid mock test coverage.

The change adds a new optional provider behind a lazy boto3 import. Existing providers and core functionality are untouched. The implementation correctly validates vendor prefixes at construction time, warns on misapplied parameters, and preserves the standard credential chain. The only gaps are the absence of a batch-size guard for Cohere (the API will surface an error for >96 texts) and a lack of allowed-values validation for Titan v2 dimensions; neither causes silent data corruption.

nemoguardrails/embeddings/providers/bedrock.py — the Cohere encoder and Titan v2 dimensions handling are the areas worth a second look.

Important Files Changed

Filename Overview
nemoguardrails/embeddings/providers/bedrock.py New BedrockEmbeddingModel provider with Amazon Titan and Cohere vendor dispatch; Cohere path sends all documents in one unbounded request (no 96-text batch limit guard) and dimensions values for Titan v2 are not validated against the allowed set {256, 512, 1024}.
nemoguardrails/embeddings/providers/init.py Adds bedrock module import and registers BedrockEmbeddingModel in the provider registry; change is minimal and consistent with existing pattern.
tests/test_embeddings_providers_mock.py Adds 18 mock-based unit tests for BedrockEmbeddingModel covering known/unknown models, parameter warnings, lazy embedding_size, kwargs forwarding, error wrapping, async parity, and empty-input fast path; all cases are well-structured and consistent with existing provider test classes.
tests/test_embeddings_bedrock.py Live-mode integration tests gated behind LIVE_TEST env var; covers sync/async Titan v2 and Cohere batched encoding; consistent with the existing pattern in other live embedding test files.
pyproject.toml Adds boto3 as an optional dependency under the new bedrock extra and also includes it in the all extra; version constraint >=1.34.0 is reasonable.
docs/configure-rails/other-configurations/embedding-search-providers.md Adds clear installation instructions, full YAML config example for both core and knowledge_base sections, and supported model list; documentation is accurate and consistent with the implementation.

Sequence Diagram

sequenceDiagram
    participant App as NeMo Guardrails
    participant Registry as EmbeddingProviderRegistry
    participant Bedrock as BedrockEmbeddingModel
    participant boto3 as boto3 Client
    participant AWS as AWS Bedrock Runtime

    App->>Registry: init_embedding_model("amazon.titan-embed-text-v2:0", "bedrock", params)
    Registry->>Bedrock: __init__(embedding_model, region_name, ...)
    Note over Bedrock: import boto3 (lazy)<br/>validate vendor prefix<br/>create boto3 client
    Bedrock-->>App: model instance

    App->>Bedrock: encode(documents)
    alt "vendor == "amazon""
        loop per document
            Bedrock->>boto3: "invoke_model(modelId, body={inputText, [dimensions, normalize]})"
            boto3->>AWS: POST bedrock-runtime/invoke
            AWS-->>boto3: "{embedding: [...]}"
            boto3-->>Bedrock: response
        end
    else "vendor == "cohere""
        Bedrock->>boto3: "invoke_model(modelId, body={texts: all_docs, input_type})"
        boto3->>AWS: POST bedrock-runtime/invoke
        AWS-->>boto3: "{embeddings: [[...], [...]]}"
        boto3-->>Bedrock: response
    end
    Bedrock-->>App: List[List[float]]
Loading
Prompt To Fix All With AI
Fix the following 2 code review issues. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 2
nemoguardrails/embeddings/providers/bedrock.py:210-219
**Cohere batch size limit not enforced**

Bedrock's Cohere Embed API accepts at most 96 texts per call. `_encode_cohere` forwards the full `documents` list in a single `invoke_model` request with no chunking. A knowledge-base indexing run with more than 96 documents will hit the service limit and raise a `RuntimeError` wrapping a cryptic API error, with no indication that the batch was too large. Adding a loop that slices `documents` into chunks of 96 and concatenates the result would make this method robust for large corpora.

### Issue 2 of 2
nemoguardrails/embeddings/providers/bedrock.py:112-130
**No validation of `dimensions` values for Titan v2**

Titan v2 accepts only three discrete values for `dimensions`: 256, 512, or 1024. Any other integer (e.g. `dimensions=100`) passes the current guard and is silently forwarded to the API, which returns an error that gets wrapped in `RuntimeError("Failed to retrieve embeddings: …")`. Adding an explicit check against `{256, 512, 1024}` before storing `self.dimensions` would surface misconfigurations at construction time with a clear `ValueError`.

Reviews (2): Last reviewed commit: "fix(embeddings): address review feedback..." | Re-trigger Greptile

Comment thread nemoguardrails/embeddings/providers/bedrock.py
Comment thread nemoguardrails/embeddings/providers/bedrock.py Outdated
…NeMo#139)

CodeRabbit + Greptile findings on PR NVIDIA-NeMo#1929:

- Fail-fast for unsupported vendors: add _SUPPORTED_VENDORS and raise
  ValueError in __init__ instead of silently routing non-cohere models
  to the Titan encoder (CodeRabbit Major, Greptile P1).
- profile_name now creates a boto3.Session(profile_name=...).client(...)
  pair instead of being silently dropped on the floor; boto3.client()
  does not accept profile_name as a kwarg (CodeRabbit Major).
- Warn (UserWarning) when dimensions or normalize are passed for models
  that do not support them (Titan v1, any Cohere) so misconfiguration
  is visible instead of silently ignored (Greptile P2).
- Guard live tests with BEDROCK_AVAILABLE so LIVE_TEST=1 without boto3
  skips cleanly instead of failing with TypeError (CodeRabbit Minor).
- Docs: clarify region_name is optional and document profile_name,
  dimensions, normalize, input_type as inline-commented examples.
- Tests: add coverage for the new fail-fast, profile/Session, and three
  warn paths.

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: Dmitry Voropaev <workerv0ropaev@yandex.ru>
@v0ropaev
Copy link
Copy Markdown
Author

Pushed cfbfc3cbf addressing the bot reviews. Per-thread replies are above; high-level summary for convenience:

Major / actionable

  • CodeRabbit profile_name (bedrock.py) — fixed via boto3.Session(profile_name=...).client(...) branch.
  • CodeRabbit + Greptile P1 unsupported-vendor fall-through — fixed via _SUPPORTED_VENDORS whitelist + ValueError in __init__.
  • CodeRabbit live-test guard — fixed via BEDROCK_AVAILABLE predicate in all 4 skipifs.
  • Greptile P2 dimensions/normalize silently ignored — fixed via warnings.warn(UserWarning) + clearing the offending value so embedding_size stays correct.

Nitpicks (CodeRabbit review body)

  • Clarify region_name is optional — added a comment in the docs YAML and a note in the surrounding prose.
  • Document advanced parameters — added inline-commented profile_name/dimensions/normalize/input_type lines in the docs YAML.
  • Regression test for unsupported vendor — test_init_with_unsupported_vendor_raises (also asserts no invoke_model/boto3.client call before the raise).

Net changes: 4 files, +155/−14. Mock-test count rose from 18 to 24 (full TestBedrockEmbeddingModelMocked green locally); live tests still skipped without LIVE_TEST=1. CI from the previous push was green across Python 3.10–3.13, lint, docker, build-docs, codecov.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] Bedrock Embedding model

1 participant