mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-29 00:24:13 +08:00
fix
This commit is contained in:
parent
ca50467324
commit
e5c86a212e
@ -128,16 +128,19 @@ class gptcommon(basetrans):
|
||||
message.append({"role": "user", "content": query})
|
||||
|
||||
usingstream = self.config["流式输出"]
|
||||
url = self.config["API接口地址"]
|
||||
if url.endswith("/chat/completions"):
|
||||
pass
|
||||
else:
|
||||
url = self.checkv1(url) + "/chat/completions"
|
||||
response = self.proxysession.post(
|
||||
url,
|
||||
self.createurl(),
|
||||
headers=self.createheaders(),
|
||||
params=self.createparam(),
|
||||
json=self.createdata(message),
|
||||
stream=usingstream,
|
||||
)
|
||||
return self.commonparseresponse(query, response, usingstream)
|
||||
|
||||
def createurl(self):
|
||||
url = self.config["API接口地址"]
|
||||
if url.endswith("/chat/completions"):
|
||||
pass
|
||||
else:
|
||||
url = self.checkv1(url) + "/chat/completions"
|
||||
return url
|
||||
|
Loading…
x
Reference in New Issue
Block a user