From 8320dc3cefd9a38ed99b0ffe9cc0db0d0a9dda1f Mon Sep 17 00:00:00 2001 From: aries_ckt <916701291@qq.com> Date: Mon, 11 Sep 2023 21:38:08 +0800 Subject: [PATCH] feat:chat_history add model_name --- pilot/openapi/api_v1/api_v1.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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)