diff --git a/pilot/openapi/api_v1/api_v1.py b/pilot/openapi/api_v1/api_v1.py index ae23503fb..3da31a9ce 100644 --- a/pilot/openapi/api_v1/api_v1.py +++ b/pilot/openapi/api_v1/api_v1.py @@ -340,11 +340,11 @@ async def chat_completions(dialogue: ConversationVo = Body()): async def model_types(): print(f"/controller/model/types") try: - import requests - - response = requests.get( - f"{CFG.MODEL_SERVER}/api/controller/models?healthy_only=true" - ) + import httpx + async with httpx.AsyncClient() as client: + response = await client.get( + f"{CFG.MODEL_SERVER}/api/controller/models?healthy_only=true", + ) types = set() if response.status_code == 200: models = json.loads(response.text)