mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-29 08:34: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})
|
message.append({"role": "user", "content": query})
|
||||||
|
|
||||||
usingstream = self.config["流式输出"]
|
usingstream = self.config["流式输出"]
|
||||||
url = self.config["API接口地址"]
|
|
||||||
if url.endswith("/chat/completions"):
|
|
||||||
pass
|
|
||||||
else:
|
|
||||||
url = self.checkv1(url) + "/chat/completions"
|
|
||||||
response = self.proxysession.post(
|
response = self.proxysession.post(
|
||||||
url,
|
self.createurl(),
|
||||||
headers=self.createheaders(),
|
headers=self.createheaders(),
|
||||||
params=self.createparam(),
|
params=self.createparam(),
|
||||||
json=self.createdata(message),
|
json=self.createdata(message),
|
||||||
stream=usingstream,
|
stream=usingstream,
|
||||||
)
|
)
|
||||||
return self.commonparseresponse(query, response, 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