update: xai增加max_tokens,max_words等参数

This commit is contained in:
taylor
2024-11-12 11:21:55 +08:00
parent 09c2ecef29
commit f606978ad9

View File

@@ -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()