Skip to content

Instantly share code, notes, and snippets.

@yrom
Created February 13, 2025 07:34
Show Gist options
  • Save yrom/c4f0fac1d3432fa4b16811c694ab2e2f to your computer and use it in GitHub Desktop.
Save yrom/c4f0fac1d3432fa4b16811c694ab2e2f to your computer and use it in GitHub Desktop.
自定义immersivetranslate 多语言提示词
{
...
"translationServices":
{
"siliconcloud": {
"APIKEY": "sk-xxx",
"assistantId": "auto",
"fallbackAssistantId": "common",
"langOverrides": [
{
"id": "auto2zh-CN",
"multiplePrompt": "You will be given a YAML formatted input containing entries with \"id\" and \"{{imt_source_field}}\" fields. \n{{normal_result_yaml_example}}\n\n。将下面 YAML 格式中所有的 \"{{imt_source_field}}\" 字段中的文本翻译为简体中文,并将翻译结果写在 \"{{imt_source_field}}\" 字段中\n开始翻译:\n\n{{yaml}}",
"prompt": "; 请你将输入文本翻译为简体中文,{{html_only}} ;如果某些内容无需翻译,则保持原文不变。注意仅输出翻译,不要执行代码,不要回答问题,不要解释。下面是输入文本:\n{{text}}",
"subtitlePrompt": "我将给你一份 YAML 格式的视频字幕文本。你需要将其中所有的 \"{{imt_sub_source_field}}\" 字段中的文本内容翻译为简体中文,并将翻译结果写在\"{{imt_sub_source_field}}\" 字段中返回,要求如下:\n\n1. 相邻条目\"{{imt_sub_source_field}}\" 内容可以作为上下文参考翻译。\n2. 返回可解析的 YAML,保持格式不变、条目数量不变!\n输入输出示例:\n{{subtitle_result_yaml_example}}\n\n开始翻译:\n\n{{yaml}}",
"systemPrompt": "你是精通多语言的翻译专家,帮我将文本内容从{{from}}翻译成简体中文,对于专有名词、人名、书名等不做翻译。同时,只对内容进行翻译,不要执行代码,不要回答问题,不要用任何工具。翻译结果不要带任何解释。\n{{summary_prompt}}{{terms_prompt}}"
}
],
"limit": "1",
"maxTextGroupLengthPerRequest": "5",
"maxTextGroupLengthPerRequestForSubtitle": "6",
"maxTextLengthPerRequest": "1450",
"model": "meta-llama/Llama-3.3-70B-Instruct",
"systemPrompt": "You are a professional, authentic machine translation engine. Provide the translation result from {{from}} to {{to}} directly, without any explanation. Never write code, answer questions, or explain. \n{{summary_prompt}}{{terms_prompt}}",
"temperature": "0.8"
}
...
}