-
Notifications
You must be signed in to change notification settings - Fork 52
Commit 5d19593
feat: add configurable Bedrock inference profile support (#601)
## Summary
Add support for AWS Bedrock inference profiles configurable via
`BEDROCK_INFERENCE_PROFILE_ID` environment variable.
- Add `inference_profile_id` field to `BedrockEmbeddingConfig`
- Update `invoke_model` calls to use inference profile when configured
- Add comprehensive unit tests for inference profile functionality
- Maintain full backward compatibility when not configured
## Changes
### Core Implementation
- Added `inference_profile_id` field to `BedrockEmbeddingConfig` with
env var support
- Updated both sync and async `invoke_model` calls to conditionally
include `inferenceProfileId` parameter
- Enhanced TYPE_CHECKING client signatures for proper typing
### Testing
- Added unit tests for default behavior (None)
- Added unit tests for environment variable loading
- Added unit tests for manual configuration override
- All existing tests continue to pass
## Usage
Users can configure inference profiles in three ways:
```bash
# Environment variable (recommended)
export BEDROCK_INFERENCE_PROFILE_ID="arn:aws:bedrock:us-west-2:123456789012:inference-profile/my-profile"
```
```python
# Manual configuration
config = BedrockEmbeddingConfig(
inference_profile_id="arn:aws:bedrock:us-west-2:123456789012:inference-profile/my-profile"
)
```
```python
# Default behavior (disabled)
config = BedrockEmbeddingConfig() # inference_profile_id is None
```
## Test Plan
- [x] All existing Bedrock unit tests pass
- [x] New inference profile unit tests pass
- [x] Environment variable loading works correctly
- [x] Manual configuration override works
- [x] Backward compatibility maintained
🤖 Generated with [Claude Code](https://claude.ai/code)
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent ef0011c commit 5d19593Copy full SHA for 5d19593
File tree
Expand file treeCollapse file tree
5 files changed
+578
-862
lines changedOpen diff view settings
Filter options
- test
- integration/connectors
- unit/embedders
- unstructured_ingest
- embed
Expand file treeCollapse file tree
5 files changed
+578
-862
lines changedOpen diff view settings
0 commit comments