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

Function _legacy_runtime_signature

src/openai/lib/bedrock.py:297–312  ·  view source on GitHub ↗
(
    client: BedrockOpenAI | AsyncBedrockOpenAI,
    configuration: _LegacyAuthConfiguration,
)

Source from the content-addressed store, hash-verified

295
296
297def _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
315def _provider_for_legacy_client(

Callers 3

__init__Method · 0.85
__init__Method · 0.85

Calls 1

Tested by

no test coverage detected