From acce466c1b2ec658438fa839b5f6b4526c08a32a 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: Tue, 6 Aug 2024 00:47:05 +0800 Subject: [PATCH] Revert "invalid" --- .../LunaTranslator/translator/chatmiko.py | 13 +++ .../files/defaultconfig/config.json | 5 ++ .../defaultconfig/translatorsetting.json | 81 +++++++++++++++++++ 3 files changed, 99 insertions(+) create mode 100644 LunaTranslator/LunaTranslator/translator/chatmiko.py diff --git a/LunaTranslator/LunaTranslator/translator/chatmiko.py b/LunaTranslator/LunaTranslator/translator/chatmiko.py new file mode 100644 index 00000000..2bbc0533 --- /dev/null +++ b/LunaTranslator/LunaTranslator/translator/chatmiko.py @@ -0,0 +1,13 @@ +from translator.gptcommon import gptcommon + + +class TS(gptcommon): + + def createheaders(self): + return { + "Authorization": "Bearer apiKey", + "origin": "https://chatmiko.com", + } + + def createurl(self): + return "https://api.chatmiko.com/v1/chat/completions" diff --git a/LunaTranslator/files/defaultconfig/config.json b/LunaTranslator/files/defaultconfig/config.json index cbe9c094..a91fe1dc 100644 --- a/LunaTranslator/files/defaultconfig/config.json +++ b/LunaTranslator/files/defaultconfig/config.json @@ -1940,6 +1940,11 @@ "type": "pre", "color": "blue", "name": "实时编辑" + }, + "chatmiko": { + "use": false, + "color": "blue", + "name": "chatmiko" } }, "ZoomFactor": 1, diff --git a/LunaTranslator/files/defaultconfig/translatorsetting.json b/LunaTranslator/files/defaultconfig/translatorsetting.json index a1856702..0aaf5d1b 100644 --- a/LunaTranslator/files/defaultconfig/translatorsetting.json +++ b/LunaTranslator/files/defaultconfig/translatorsetting.json @@ -1212,5 +1212,86 @@ "step": 0.1 } } + }, + "chatmiko":{ + "args": { + "model": "deepseek-chat", + "附带上下文个数": 0, + "使用自定义promt": false, + "自定义promt": "", + "流式输出": false, + "Temperature": 0.3, + "top_p": 0.3, + "max_tokens": 128, + "frequency_penalty": 0, + "user_user_prompt": "{sentence}", + "use_user_user_prompt": false, + "other_args": "{}", + "use_other_args": false, + "s": "" + }, + "argstype": { + "other_args": { + "type": "multiline", + "refswitch": "use_other_args", + "name": "其他参数" + }, + "user_user_prompt": { + "name": "user prompt", + "refswitch": "use_user_user_prompt", + "rank": 5.1 + }, + "s": { + "type": "split", + "rank": 1.5 + }, + "API接口地址": { + "rank": 0 + }, + "model": { + "rank": 1 + }, + "top_p": { + "type": "spin", + "min": 0, + "max": 1, + "step": 0.01 + }, + "frequency_penalty": { + "type": "spin", + "min": 0, + "max": 2, + "step": 0.05 + }, + "max_tokens": { + "type": "intspin", + "min": 1, + "max": 4096, + "step": 1 + }, + "流式输出": { + "type": "switch", + "rank": 2 + }, + "自定义promt": { + "type": "multiline", + "refswitch": "使用自定义promt", + "name": "自定义_system promt", + "rank": 5 + }, + "附带上下文个数": { + "type": "intspin", + "min": 0, + "max": 10, + "step": 1, + "rank": 4.9 + }, + "Temperature": { + "type": "spin", + "min": 0, + "max": 1, + "step": 0.1 + } + } } } \ No newline at end of file