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

Function is_pref_api_url_rejected

web/pgadmin/llm/utils.py:317–325  ·  view source on GitHub ↗

Return True if the user has set a preference URL for ``pref_name`` but it failed the allowlist check. Callers use this to distinguish 'URL not configured' from 'URL configured but blocked' so the chat path can surface a clear error instead of a generic one.

(pref_name)

Source from the content-addressed store, hash-verified

315
316
317def is_pref_api_url_rejected(pref_name):
318 """
319 Return True if the user has set a preference URL for ``pref_name``
320 but it failed the allowlist check. Callers use this to distinguish
321 'URL not configured' from 'URL configured but blocked' so the chat
322 path can surface a clear error instead of a generic one.
323 """
324 pref_url = _get_preference_value(pref_name)
325 return bool(pref_url) and not validate_api_url(pref_url)
326
327
328def _resolve_pref_key_file(pref_name, config_default):

Callers 1

get_llm_clientFunction · 0.90

Calls 2

_get_preference_valueFunction · 0.85
validate_api_urlFunction · 0.85

Tested by

no test coverage detected