From f606978ad9b30e972023b6de3c93b05b5cd8578f Mon Sep 17 00:00:00 2001 From: taylor <=> Date: Tue, 12 Nov 2024 11:21:55 +0800 Subject: [PATCH] =?UTF-8?q?update:=20xai=E5=A2=9E=E5=8A=A0max=5Ftokens,max?= =?UTF-8?q?=5Fwords=E7=AD=89=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- maubot_llmplus/thrid_platform.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/maubot_llmplus/thrid_platform.py b/maubot_llmplus/thrid_platform.py index 0a15f05..e981ed7 100644 --- a/maubot_llmplus/thrid_platform.py +++ b/maubot_llmplus/thrid_platform.py @@ -171,8 +171,8 @@ class XAi(Platform): async def list_models(self) -> List[str]: # 调用openai接口获取模型列表 full_url = f"{self.url}/v1/models" - headers = {'Authorization': f"Bearer {self.api_key}"} - async with self.http.get(full_url) as response: + headers = {'Content-Type': 'application/json', 'Authorization': f"Bearer {self.api_key}"} + async with self.http.get(full_url, headers=headers) as response: if response.status != 200: return [] response_data = await response.json()