MCPcopy
hub / github.com/openai/openai-python / _refresh_legacy_provider_runtime

Function _refresh_legacy_provider_runtime

src/openai/lib/bedrock.py:364–382  ·  view source on GitHub ↗
(client: BedrockOpenAI | AsyncBedrockOpenAI)

Source from the content-addressed store, hash-verified

362
363
364def _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
385class BedrockOpenAI(OpenAI):

Callers 3

_copy_configurationFunction · 0.85
_prepare_optionsMethod · 0.85
_prepare_optionsMethod · 0.85

Tested by

no test coverage detected