(client: BedrockOpenAI | AsyncBedrockOpenAI)
| 362 | |
| 363 | |
| 364 | def _refresh_legacy_provider_runtime(client: BedrockOpenAI | AsyncBedrockOpenAI) -> None: |
| 365 | _synchronize_legacy_routing_state(client) |
| 366 | configuration = client._legacy_auth_configuration() |
| 367 | signature = _legacy_runtime_signature(client, configuration) |
| 368 | if signature == client._bedrock_runtime_signature: |
| 369 | return |
| 370 | |
| 371 | provider = _provider_for_legacy_client(client, configuration) |
| 372 | client._bedrock_provider = provider |
| 373 | client._provider = provider |
| 374 | client._provider_runtime = _configure_provider(provider) |
| 375 | if ( |
| 376 | isinstance(client._provider_runtime, _BedrockProviderRuntime) |
| 377 | and client.aws_region is None |
| 378 | and client._provider_runtime.region is not None |
| 379 | ): |
| 380 | client.aws_region = client._provider_runtime.region |
| 381 | client._bedrock_state = replace(client._bedrock_state, aws_region=client.aws_region) |
| 382 | client._bedrock_runtime_signature = _legacy_runtime_signature(client, configuration) |
| 383 | |
| 384 | |
| 385 | class BedrockOpenAI(OpenAI): |
no test coverage detected