* fix: avoid redundant __init__ calls on hot path
Previously, imports on the request hot path caused __init__ to run
excessively for every request. This change ensures initialization
happens once, reducing cpu overhead.
* fix: remove redundant __init__ import
The current implementation no longer requires an import at the top of the function.
* fix: placed on core utils for future reuse
* test: add coverage & remove inline import
A general import-checking tool across all endpoints would be a large PR.
This commit focuses on a smaller, targeted fix for the discussed case.
* added import check to CI
- Add encoding_format parameter to supported parameters table
- Document float and base64 encoding format options
- Add usage examples for both encoding formats
- Update parameter documentation for amazon.titan-embed-text-v2:0
- Test encoding_format='float' parameter mapping and response handling
- Test encoding_format='base64' parameter mapping to binary format
- Verify parameter transformation and response processing
- Mock AWS API responses for both float and binary formats
- Ensure OpenAI compatibility with new encoding_format support
- Add encoding_format to supported OpenAI parameters list
- Implement encoding_format to embeddingTypes parameter mapping
- Map 'float' to ['float'] and 'base64' to ['binary'] formats
- Handle response with proper fallback: binary > float > embedding field
- Support both float and binary response formats per AWS documentation
Fixes#14685 - UnsupportedParamsError when using encoding_format with Titan V2
- Add embeddingTypes parameter to AmazonTitanV2EmbeddingRequest
- Add embeddingsByType response field for binary format support
- Update type hints for enhanced embedding response handling
The Admin UI is already built before packaging, so the second invocation of docker/build_admin_ui.sh after PyJWT adjustments was unnecessary. Removing it speeds up the builder stage, reduces cache invalidation, and doesn’t change the resulting wheel or runtime image.
Add documentation for using AWS Bedrock Application Inference Profiles
with image generation APIs, specifically for Nova Canvas models.
The documentation includes:
- SDK examples showing model_id parameter usage
- Proxy configuration examples
- Follows the same pattern as chat completions inference profiles
Follow the same pattern as chat completions and embeddings by extracting
model_id from optional_params into a variable, even though it's not used
in image generation. This maintains code consistency across Bedrock services.
- Add Asia/Bangkok (UTC+7) to timezone_map in duration_parser.py
- Update documentation to include Bangkok in common timezone values
- Add test case to verify Bangkok timezone functionality
- Change parameter from request_metadata to requestMetadata to match camelCase convention
- Consistent with guardrailConfig and performanceConfig naming pattern
- Update all references in transformation code and error messages
- Update tests and documentation to use correct parameter name
- Fix type checking for parameter validation