Kiss Translator V2 Custom 配置

Kiss Translator 使用教程 继续讨论

最近蓝色系大版本更新到了V2,引入了聚合和上下文等新功能,并支持Youtube字幕翻译,Custom规则变化很大,研究了下水个帖

接入 Reka

Reka 每月有10刀的免费额度

点击拓展图标进入设置,依次点击 接口设置Custom

  • URL
    https://api.reka.ai/v1/chat
  • KEY
    点击前往获取
  • MODEL
    reka-flash
  • Request Hook
async (args) => {
  const url = args.url;
  const method = "POST";
  const headers = {
    "Content-type": "application/json",
    "X-Api-Key": args.key
  };
  const body = {
    model: args.model,
    messages: [
      {
        role: "user",
        content: args.systemPrompt,
      },
      {
        role: "assistant",
        content: "",
      },      
      {
        role: "user",
        content: JSON.stringify({
          targetLanguage: args.to,
          segments: args.texts.map((text, id) => ({ id, text })),
          glossary: {},
        }),
      },
    ],
    temperature: args.temperature,
    max_tokens: args.maxTokens,
    stream: false,
  };
  
  return { url, body, headers, method };
};
  • Response Hook
async ({ res, parseAIRes }) => {
  const translations = parseAIRes(res?.responses?.[0]?.message?.content);
  return { translations };
};

最大并发可设置为10,开启聚合和上下文,其余选项保持默认即可

参考链接

32 个赞

感谢reno佬!

感谢佬分享

感谢分享

厉害了。感谢大佬

谢谢大佬

草,原来商店还没有更新2.0版本,测试了一会发现怎么怎么都不行,还要手动加载更新 :nerd_face:

感谢大佬 用上了

感谢reno佬的教程

并发这么高吗,感谢

并发不清楚 文档没写 应该在50以内

1 个赞

感谢reno佬