(
client: BedrockOpenAI | AsyncBedrockOpenAI,
configuration: _LegacyAuthConfiguration,
)
| 295 | |
| 296 | |
| 297 | def _legacy_runtime_signature( |
| 298 | client: BedrockOpenAI | AsyncBedrockOpenAI, |
| 299 | configuration: _LegacyAuthConfiguration, |
| 300 | ) -> _LegacyRuntimeSignature: |
| 301 | mode, credential = configuration |
| 302 | credential_identity: object = ( |
| 303 | hashlib.blake2s(credential.encode(), key=_LEGACY_SIGNATURE_KEY).digest() |
| 304 | if isinstance(credential, str) |
| 305 | else id(credential) |
| 306 | ) |
| 307 | return _LegacyRuntimeSignature( |
| 308 | mode=mode, |
| 309 | base_url=str(client.base_url), |
| 310 | region=client.aws_region, |
| 311 | credential_identity=credential_identity, |
| 312 | ) |
| 313 | |
| 314 | |
| 315 | def _provider_for_legacy_client( |
no test coverage detected