从 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,开启聚合和上下文,其余选项保持默认即可