update: xai增加max_tokens,max_words等参数
This commit is contained in:
@@ -41,7 +41,7 @@ platforms:
|
|||||||
max_tokens: 2000
|
max_tokens: 2000
|
||||||
max_context_messages: 20
|
max_context_messages: 20
|
||||||
xai:
|
xai:
|
||||||
url: curl https://api.x.ai
|
url: https://api.x.ai
|
||||||
api_key:
|
api_key:
|
||||||
model: grok-beta
|
model: grok-beta
|
||||||
temperature: 1
|
temperature: 1
|
||||||
|
|||||||
@@ -150,7 +150,7 @@ class XAi(Platform):
|
|||||||
request_body["temperature"] = self.temperature
|
request_body["temperature"] = self.temperature
|
||||||
|
|
||||||
endpoint = f"{self.url}/v1/chat/completions"
|
endpoint = f"{self.url}/v1/chat/completions"
|
||||||
async with self.http.post(url=endpoint, data=json.dumps(request_body), headers=headers) as resp:
|
async with self.http.post(url=endpoint, data=json.dumps(request_body), headers=headers) as response:
|
||||||
# plugin.log.debug(f"响应内容:{response.status}, {await response.json()}")
|
# plugin.log.debug(f"响应内容:{response.status}, {await response.json()}")
|
||||||
if response.status != 200:
|
if response.status != 200:
|
||||||
return ChatCompletion(
|
return ChatCompletion(
|
||||||
|
|||||||
Reference in New Issue
Block a user