i18n(image-gen): translate AI-facing tool response text to English

The tool result content is consumed by AI agents (Claude/Cursor/...).
Converted four user-facing strings to clear English:

- Missing-token error message
- No-URL-in-response error message
- Success summary (added expiry note for AI to act on)
- Generation-failure error message

Code comments and tool description/describes are untouched in this commit.
This commit is contained in:
2026-09-04 12:52:10 +08:00
parent 594650510b
commit a29ffd9aa5
+6 -6
View File
@@ -137,7 +137,7 @@ function buildServer() {
{
type: "text",
text:
"缺少鉴权 token。",
"Missing authentication token. The caller must provide a Zhipu API token via an HTTP request header (e.g. `X-Image-Gen-Token: <token>` or `Authorization: Bearer <token>`). The server is configured to read the token from the request header on every call, not from the tool arguments, so the token cannot be supplied here.",
},
],
};
@@ -163,19 +163,19 @@ function buildServer() {
content: [
{
type: "text",
text: `调用成功但未返回图片 URL:${JSON.stringify(data)}`,
text: `The Zhipu API call succeeded but returned no image URL. Raw response: ${JSON.stringify(data)}`,
},
],
};
}
const summary = urls
.map((u, i) => `图片 ${i + 1}: ${u}`)
.map((u, i) => `Image ${i + 1}: ${u}`)
.join("\n");
return {
content: [
{
type: "text",
text: `模型: ${model}\n提示词: ${args.prompt}\n${summary}`,
text: `Model: ${model}\nPrompt: ${args.prompt}\n${summary}\n\nThe image is hosted on a signed Zhipu URL and will expire (typically within 24 hours, see the URL's Expires parameter). If the user needs to keep it, download or copy the image right away.`,
},
...urls.map((u) => ({ type: "text", text: u })),
],
@@ -186,8 +186,8 @@ function buildServer() {
content: [
{
type: "text",
text: `生成图片失败: ${e.message}${
e.detail ? `\n详情: ${JSON.stringify(e.detail)}` : ""
text: `Failed to generate image: ${e.message}${
e.detail ? `\nDetails: ${JSON.stringify(e.detail)}` : ""
}`,
},
],