添加 OpenRouter 支持 (#300)

* add openrouter provider

* remove package-lock.json
This commit is contained in:
GoldenXPig
2025-08-23 11:01:54 +08:00
committed by GitHub
parent 36c1e40d64
commit 5d5e23482f
4 changed files with 87 additions and 0 deletions

View File

@@ -21,6 +21,7 @@ import {
OPT_TRANS_OLLAMA,
OPT_TRANS_OLLAMA_2,
OPT_TRANS_OLLAMA_3,
OPT_TRANS_OPENROUTER,
OPT_TRANS_CUSTOMIZE,
OPT_TRANS_CUSTOMIZE_2,
OPT_TRANS_CUSTOMIZE_3,
@@ -316,6 +317,7 @@ export const apiTranslate = async ({
case OPT_TRANS_OPENAI_2:
case OPT_TRANS_OPENAI_3:
case OPT_TRANS_GEMINI_2:
case OPT_TRANS_OPENROUTER:
trText = res?.choices?.map((item) => item.message.content).join(" ");
isSame = text === trText;
break;