From 4c5f7bc575350e24332f57148c38f5203510a5f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=81=8D=E5=85=AE=E6=83=9A=E5=85=AE?= <101191390+HIllya51@users.noreply.github.com> Date: Sat, 20 Jul 2024 14:58:04 +0800 Subject: [PATCH] . --- .../LunaTranslator/translator/gptcommon.py | 20 ++++++++++++------- docs/zh/guochandamoxing.md | 13 ++++++++++++ 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/LunaTranslator/LunaTranslator/translator/gptcommon.py b/LunaTranslator/LunaTranslator/translator/gptcommon.py index 07a371e4..d026fd1a 100644 --- a/LunaTranslator/LunaTranslator/translator/gptcommon.py +++ b/LunaTranslator/LunaTranslator/translator/gptcommon.py @@ -58,16 +58,22 @@ class gptcommon(basetrans): # 傻逼豆包大模型是非要v3,不是v1 if api_url.endswith("/v3"): return api_url - - if api_url.endswith("/v1/"): - api_url = api_url[:-1] + elif api_url.endswith("/v3/"): + return api_url[:-1] + # 智谱AI + elif api_url.endswith("/v4"): + return api_url + elif api_url.endswith("/v4/"): + return api_url[:-1] + # 正常的 elif api_url.endswith("/v1"): - pass + return api_url + elif api_url.endswith("/v1/"): + return api_url[:-1] elif api_url.endswith("/"): - api_url += "v1" + return api_url + "v1" else: - api_url += "/v1" - return api_url + return api_url + "/v1" def commonparseresponse(self, query, response: requests.ResponseBase, usingstream): if usingstream: diff --git a/docs/zh/guochandamoxing.md b/docs/zh/guochandamoxing.md index 5446f426..640b494a 100644 --- a/docs/zh/guochandamoxing.md +++ b/docs/zh/guochandamoxing.md @@ -26,6 +26,19 @@ ![img](https://image.lunatranslator.xyz/zh/damoxing/doubao.png) + +### **月之暗面** + +**API接口地址** `https://api.moonshot.cn` + +### **智谱AI** + +**API接口地址** `https://open.bigmodel.cn/api/paas/v4/chat/completions` + +### **零一万物** + +**API接口地址** `https://api.lingyiwanwu.com` +