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

Function get_openai_model

web/pgadmin/llm/utils.py:437–452  ·  view source on GitHub ↗

Get the OpenAI model to use. Checks user preferences first, then falls back to system configuration. Returns: The model name string, or empty string if not configured.

()

Source from the content-addressed store, hash-verified

435
436
437def get_openai_model():
438 """
439 Get the OpenAI model to use.
440
441 Checks user preferences first, then falls back to system configuration.
442
443 Returns:
444 The model name string, or empty string if not configured.
445 """
446 # Check user preference first
447 pref_model = _get_preference_value('openai_api_model')
448 if pref_model:
449 return pref_model
450
451 # Fall back to system configuration
452 return config.OPENAI_API_MODEL or ''
453
454
455def get_ollama_api_url():

Callers 3

get_llm_clientFunction · 0.90
get_llm_statusFunction · 0.90
get_llm_configFunction · 0.85

Calls 1

_get_preference_valueFunction · 0.85

Tested by

no test coverage detected