MCPcopy Create free account
hub / github.com/pgadmin-org/pgadmin4 / get_anthropic_api_url

Function get_anthropic_api_url

web/pgadmin/llm/utils.py:374–388  ·  view source on GitHub ↗

Get the Anthropic API URL. Checks the user preference first, then falls back to system configuration ONLY when no preference is set. A preference URL that fails the SSRF allowlist check is dropped (and a warning is logged) — it is NOT silently substituted with the admin default

()

Source from the content-addressed store, hash-verified

372
373
374def get_anthropic_api_url():
375 """
376 Get the Anthropic API URL.
377
378 Checks the user preference first, then falls back to system
379 configuration ONLY when no preference is set. A preference URL
380 that fails the SSRF allowlist check is dropped (and a warning is
381 logged) — it is NOT silently substituted with the admin default.
382
383 Returns:
384 The URL string, or empty string if not configured or rejected.
385 """
386 return _resolve_pref_url(
387 'anthropic_api_url', config.ANTHROPIC_API_URL
388 )
389
390
391def get_anthropic_api_key():

Callers 3

get_llm_clientFunction · 0.90
get_anthropic_modelsFunction · 0.90
get_llm_configFunction · 0.85

Calls 1

_resolve_pref_urlFunction · 0.85

Tested by

no test coverage detected