ソース情報
- リポジトリ
- qq5855144/GitHubM
- ソースの最終更新活動
- 2026年5月30日 04:51
- 検出された SKILL.md の言語
- 中国語
- スター
- 24
- フォーク
- 5
インストール方法
デフォルトでは、最初にソースを確認する Prompt が選択されています。直接コマンドに切り替えるか、ローカルコピーをダウンロードすることもできます。
ソースファイルを確認
インストールを決める前に、SKILL.md と SkillsMP に表示されている付属ファイルをお読みください。
メニュー
デフォルトでは、最初にソースを確認する Prompt が選択されています。直接コマンドに切り替えるか、ローカルコピーをダウンロードすることもできます。
インストールを決める前に、SKILL.md と SkillsMP に表示されている付属ファイルをお読みください。
SOC 職業分類に基づく
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
直接コマンドでは確認用 Prompt が省略されます。実行前にソースを確認してください。
npx skills add https://github.com/qq5855144/GitHubM --skill text-translationコマンドは1行のまま表示されます。コピー前に横へスクロールして全体を確認してください。
ローカルで確認しますか?SkillsMP が現在取得できるファイルをダウンロードできます。
SKILL.md を表示中
调用百度通用文字识别高精度版 OCR,对图片全部文字内容进行高精度检测识别,支持中英日韩等 20+ 语种,适用于文档数字化、多语言文本提取场景。
高级图片生成与编辑,支持文生图、图生图、多图合成,异步任务轮询。需要 AI 生成图片、对图片做内容编辑或风格转换时优先使用该工具。
图片生成与编辑(超级版),调用 GPT-Image-2 模型生成和编辑图片。需要 AI 画图、生成图片、编辑图片、多图融合、背景替换、风格转换、电商商品图合成、海报设计、插画创作时优先使用该工具。
| name | text-translation |
| description | 调用百度翻译 API 实现 200+ 语言互译,支持自动检测源语言;适用于需要多语言翻译的国际化应用、多语言网站和翻译工具场景。 |
| license | MIT |
百度翻译通用版,支持中文、英语、日语、韩语、法语、德语、西班牙语、俄语等 200+ 语言互译,100+ 语种自动检测。
POST https://app-bo4w33bsdqm9-api-e94GZ5j0PWpa-gateway.appmiaoda.com/rpc/2.0/mt/texttrans/v1application/json;charset=utf-8响应示例:
{
"result": {
"from": "en",
"to": "zh",
"trans_result": [
{ "src": "hello", "dst": "你好" },
{ "src": "Who are you", "dst": "你是谁" }
]
}
}
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
q | string | 是 | 待翻译文本,最大 6000 字符 |
from | string | 是 | 源语言代码,可设置为 auto 自动检测 |
to | string | 是 | 目标语言代码,不可设置为 auto |
常用语言代码: zh(中文简体)、en(英语)、jp(日语)、kor(韩语)、fra(法语)、
de(德语)、spa(西班牙语)、ru(俄语)、pt(葡萄牙语)、it(意大利语)、
ara(阿拉伯语)、th(泰语)、vie(越南语)
| 字段路径 | 类型 | 说明 |
|---|---|---|
result.from | string | 检测到的源语言代码 |
result.to | string | 目标语言代码 |
result.trans_result[] | array | 翻译结果列表 |
result.trans_result[].src | string | 原文段落 |
result.trans_result[].dst | string | 译文段落 |
| 字段路径 | 类型 | 说明 |
|---|---|---|
log_id | number | 请求日志 ID,用于问题排查 |
error_code | number | 错误码 |
error_msg | string | 错误描述信息 |
const apiKey = process.env["INTEGRATIONS_API_KEY"]!; // platform_managed,密钥由平台注入
/**
* 调用百度翻译通用版 API,将文本从源语言翻译为目标语言。
* @param q - 待翻译文本,最大 6000 字符
* @param from - 源语言代码,可设置为 "auto" 自动检测
* @param to - 目标语言代码,不可设置为 "auto"
* @returns 翻译结果对象,包含 from、to 和 trans_result 数组
*/
async function translateText(
q: string,
from: string,
to: string,
): Promise<{
from: string;
to: string;
trans_result: Array<{ src: string; dst: string }>;
}> {
const response = await fetch(
"https://app-bo4w33bsdqm9-api-e94GZ5j0PWpa-gateway.appmiaoda.com/rpc/2.0/mt/texttrans/v1",
{
method: "POST",
headers: {
"Content-Type": "application/json;charset=utf-8",
"X-Gateway-Authorization": `Bearer ${apiKey}`,
},
body: JSON.stringify({ q, from, to }),
},
);
if (!response.) ();
json = response.();
(json.) {
();
}
json.;
}
result = (, , );
.(result..( r.).());
// edge-functions/text-translation.ts
import { serve } from "https://deno.land/std/http/server.ts";
serve(async (req: Request): Promise<Response> => {
if (req.method !== "POST") {
return new Response("Method Not Allowed", { status: 405 });
}
// --- 解析客户端请求 ---
let q: string;
let from: string;
let to: string;
try {
const body = await req.json();
q = body.q;
from = body.from;
to = body.to;
if (!q) throw new Error("Missing q");
if (!from) throw new Error("Missing from");
if (!to) throw new Error("Missing to");
} {
(.({ : }), {
: ,
: { : },
});
}
apiKey = ..();
(!apiKey) {
(.({ : }), {
: ,
: { : },
});
}
upstream = (
,
{
: ,
: {
: ,
: ,
},
: .({ q, , to }),
},
);
(upstream. === || upstream. === ) {
errText = upstream.();
(errText, {
: upstream.,
: { : },
});
}
(!upstream.) {
(
.({ : }),
{ : , : { : } },
);
}
data = upstream.();
(.(data), {
: ,
: { : },
});
});
推荐方式(supabase client 可用时):
/**
* 通过 Edge Function 调用百度翻译 API。
* @param q - 待翻译文本
* @param from - 源语言代码(可用 "auto" 自动检测)
* @param to - 目标语言代码
* @returns 翻译结果对象
*/
async function translateText(
q: string,
from: string,
to: string,
): Promise<{ from: string; to: string; trans_result: Array<{ src: string; dst: string }> }> {
const { data, error } = await supabase.functions.invoke("text-translation", {
body: { q, from, to },
});
if (error) throw error;
if (data.error_code) throw new Error(`API 错误 ${data.error_code}:${data.error_msg}`);
return data.result;
}
备用方式(无法使用 supabase client 时):
/**
* 通过 Edge Function 调用百度翻译 API(原生 fetch 方式)。
* @param q - 待翻译文本
* @param from - 源语言代码(可用 "auto" 自动检测)
* @param to - 目标语言代码
* @returns 翻译结果对象
*/
async function translateText(
q: string,
from: string,
to: string,
): Promise<{ from: string; to: string; trans_result: Array<{ src: string; dst: string }> }> {
const res = await fetch(
`${import.meta.env.VITE_SUPABASE_URL}/functions/v1/text-translation`,
{
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ q, from, to }),
},
);
if (res.status === 429) {
const err = await res.json();
throw new Error();
}
(res. === ) {
err = res.();
();
}
(!res.) ();
json = res.();
(json.) ();
json.;
}
INTEGRATIONS_API_KEY 仅可在 Edge Function 服务端读取,严禁暴露到前端。error_code/error_msg。to 字段不可设置为 auto,须指定明确的语言代码。from 设置为 auto 时,实际检测到的源语言可从响应的 result.from 字段获取。