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

Function get_docker_models

web/pgadmin/llm/__init__.py:700–727  ·  view source on GitHub ↗

Fetch available Docker Model Runner models.

()

Source from the content-addressed store, hash-verified

698@blueprint.route("/models/docker", methods=["GET"], endpoint='models_docker')
699@pga_login_required
700def get_docker_models():
701 """
702 Fetch available Docker Model Runner models.
703 """
704 from pgadmin.llm.utils import get_docker_api_url
705
706 api_url = get_docker_api_url()
707 if not api_url:
708 return make_json_response(
709 data={'models': [], 'error': 'No API URL configured'},
710 status=200
711 )
712
713 try:
714 models = _fetch_docker_models(api_url)
715 return make_json_response(data={'models': models}, status=200)
716 except LLMApiError as e:
717 return make_json_response(
718 data={'models': [], 'error': str(e)},
719 status=200
720 )
721 except Exception:
722 return make_json_response(
723 data={'models': [],
724 'error': 'Failed to fetch Docker models. '
725 'Check the API URL configuration.'},
726 status=200
727 )
728
729
730@blueprint.route(

Callers

nothing calls this directly

Calls 3

get_docker_api_urlFunction · 0.90
make_json_responseFunction · 0.90
_fetch_docker_modelsFunction · 0.85

Tested by

no test coverage detected