Litellm test bedrock optional params embeddings dimension#20262
Merged
Sameerlite merged 3 commits intomainfrom Feb 2, 2026
Merged
Litellm test bedrock optional params embeddings dimension#20262Sameerlite merged 3 commits intomainfrom
Sameerlite merged 3 commits intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
Greptile OverviewGreptile SummaryThis PR updates test expectations for Bedrock Cohere embeddings to reflect the newly added
The core change aligns test expectations with the actual behavior after dimensions support was added to Bedrock Cohere embeddings. Confidence Score: 4/5
|
| Filename | Overview |
|---|---|
| tests/llm_translation/test_optional_params.py | Updated test to expect dimensions support for bedrock/cohere.embed-multilingual-v3 (changed from False to True) |
| tests/test_litellm/test_utils.py | Added schema validation for new cache pricing field and reformatted imports (cosmetic changes) |
| litellm/model_prices_and_context_window_backup.json | Updated Claude Sonnet pricing/limits and fixed indentation for openrouter model |
Sequence Diagram
sequenceDiagram
participant Test as test_bedrock_optional_params_embeddings_dimension
participant Utils as get_optional_params_embeddings
participant Config as BedrockCohereEmbeddingConfig
participant Schema as JSON Schema Validator
Note over Test: PR Updates Test Expectations
Test->>Utils: Call with dimensions=20 for cohere.embed-multilingual-v3
Utils->>Config: get_supported_openai_params()
Config-->>Utils: ["encoding_format", "dimensions"]
Utils->>Config: map_openai_params({"dimensions": 20})
Config-->>Utils: {"output_dimension": 20}
Utils-->>Test: Returns optional_params
Test->>Test: Assert len(optional_params) == 1 ✓
Note over Schema: PR Updates Schema Validation
Schema->>Schema: Add cache_creation_input_token_cost_above_1hr_above_200k_tokens
Schema->>Schema: Validate model_prices_and_context_window.json
Schema-->>Test: Schema validation passes ✓
| ("bedrock/amazon.titan-embed-image-v1", True, "embeddingConfig"), | ||
| ("bedrock/amazon.titan-embed-text-v2:0", True, "dimensions"), | ||
| ("bedrock/cohere.embed-multilingual-v3", False, None), | ||
| ("bedrock/cohere.embed-multilingual-v3", True, None), |
Contributor
There was a problem hiding this comment.
Test doesn't verify the correct parameter name. The dimensions_kwarg should be "output_dimension" (not None) to ensure dimensions are correctly mapped to Bedrock Cohere's output_dimension parameter, matching the pattern used for other models.
Suggested change
| ("bedrock/cohere.embed-multilingual-v3", True, None), | |
| ("bedrock/cohere.embed-multilingual-v3", True, "output_dimension"), |
Prompt To Fix With AI
This is a comment left during a code review.
Path: tests/llm_translation/test_optional_params.py
Line: 227:227
Comment:
Test doesn't verify the correct parameter name. The `dimensions_kwarg` should be `"output_dimension"` (not `None`) to ensure dimensions are correctly mapped to Bedrock Cohere's `output_dimension` parameter, matching the pattern used for other models.
```suggestion
("bedrock/cohere.embed-multilingual-v3", True, "output_dimension"),
```
How can I resolve this? If you propose a fix, please make it concise.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Relevant issues
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
tests/litellm/directory, Adding at least 1 test is a hard requirement - see detailsmake test-unitCI (LiteLLM team)
Branch creation CI run
Link:
CI run for the last commit
Link:
Merge / cherry-pick CI run
Links:
Type
🆕 New Feature
🐛 Bug Fix
🧹 Refactoring
📖 Documentation
🚄 Infrastructure
✅ Test
Changes