Skip to content

fix: raise ValueError when 'model' is passed instead of 'model_name' in BedrockEmbedding#20836

Open
Br1an67 wants to merge 1 commit intorun-llama:mainfrom
Br1an67:fix/issue-14401-model-name-validation
Open

fix: raise ValueError when 'model' is passed instead of 'model_name' in BedrockEmbedding#20836
Br1an67 wants to merge 1 commit intorun-llama:mainfrom
Br1an67:fix/issue-14401-model-name-validation

Conversation

@Br1an67
Copy link

@Br1an67 Br1an67 commented Mar 1, 2026

Description

Raises a clear ValueError when users pass model= instead of model_name= to BedrockEmbedding. Previously, model= was silently absorbed by **kwargs and ignored, causing the default model (amazon.titan-embed-text-v1) to be used unexpectedly.

Fixes #14401

New Package?

  • No

Version Bump?

  • Yes — llama-index-embeddings-bedrock bumped from 0.7.30.7.4

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • I added new unit tests to cover this change

Added test_model_param_raises_error which verifies that BedrockEmbedding(model="cohere.embed-multilingual-v3") raises ValueError with a message guiding to use model_name.

Suggested Checklist:

  • I have performed a self-review of my own code
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I ran uv run make format; uv run make lint to appease the lint gods

@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Mar 1, 2026
Copy link
Member

@AstraBert AstraBert left a comment

Choose a reason for hiding this comment

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

We need to bump the version of the integration before merging

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Mar 2, 2026
…in BedrockEmbedding

Raises a clear ValueError when users pass model= instead of model_name=
to BedrockEmbedding. Previously, model= was silently absorbed by **kwargs
and ignored, causing the default model (amazon.titan-embed-text-v1) to be
used unexpectedly.

Bump llama-index-embeddings-bedrock version to 0.7.4.
@Br1an67 Br1an67 force-pushed the fix/issue-14401-model-name-validation branch from 81f7b2e to 10a6571 Compare March 2, 2026 14:53
@Br1an67
Copy link
Author

Br1an67 commented Mar 2, 2026

Thanks for the review! Bumped llama-index-embeddings-bedrock from 0.7.30.7.4 in both pyproject.toml and uv.lock.

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

Labels

lgtm This PR has been approved by a maintainer size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: model_name vs. model in BedrockEmbedding doesn't throw an error

2 participants