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 f8760943..2f402f0c 100644 --- a/LunaTranslator/files/defaultconfig/config.json +++ b/LunaTranslator/files/defaultconfig/config.json @@ -1945,6 +1945,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