From d787b1ca5405fbb4360e494957bc1d131461eb8e Mon Sep 17 00:00:00 2001 From: Henry Li Date: Thu, 29 Jan 2026 08:59:55 +0800 Subject: [PATCH] feat: support image_search --- .../workspace/messages/message-group.tsx | 26 +++++++++++++++++++ frontend/src/core/i18n/locales/en-US.ts | 3 +++ frontend/src/core/i18n/locales/types.ts | 2 ++ frontend/src/core/i18n/locales/zh-CN.ts | 2 ++ 4 files changed, 33 insertions(+) diff --git a/frontend/src/components/workspace/messages/message-group.tsx b/frontend/src/components/workspace/messages/message-group.tsx index 4174eac..e2cfcba 100644 --- a/frontend/src/components/workspace/messages/message-group.tsx +++ b/frontend/src/components/workspace/messages/message-group.tsx @@ -217,6 +217,32 @@ function ToolCall({ )} ); + } else if (name === "image_search") { + let label: React.ReactNode = t.toolCalls.searchForRelatedImages; + if (typeof args.query === "string") { + label = t.toolCalls.searchForRelatedImagesFor(args.query); + } + return ( + + {Array.isArray(result) && ( + + {result.map((item) => ( + + + {item.title} + + + ))} + + )} + + ); } else if (name === "web_fetch") { const url = (args as { url: string })?.url; let title = url; diff --git a/frontend/src/core/i18n/locales/en-US.ts b/frontend/src/core/i18n/locales/en-US.ts index 805170a..94a13af 100644 --- a/frontend/src/core/i18n/locales/en-US.ts +++ b/frontend/src/core/i18n/locales/en-US.ts @@ -101,6 +101,9 @@ export const enUS: Translations = { needYourHelp: "Need your help", useTool: (toolName: string) => `Use "${toolName}" tool`, searchForRelatedInfo: "Search for related information", + searchForRelatedImages: "Search for related images", + searchForRelatedImagesFor: (query: string) => + `Search for related images for "${query}"`, searchOnWebFor: (query: string) => `Search on the web for "${query}"`, viewWebPage: "View web page", listFolder: "List folder", diff --git a/frontend/src/core/i18n/locales/types.ts b/frontend/src/core/i18n/locales/types.ts index bb2fab9..efba270 100644 --- a/frontend/src/core/i18n/locales/types.ts +++ b/frontend/src/core/i18n/locales/types.ts @@ -96,6 +96,8 @@ export interface Translations { needYourHelp: string; useTool: (toolName: string) => string; searchForRelatedInfo: string; + searchForRelatedImages: string; + searchForRelatedImagesFor: (query: string) => string; searchOnWebFor: (query: string) => string; viewWebPage: string; listFolder: string; diff --git a/frontend/src/core/i18n/locales/zh-CN.ts b/frontend/src/core/i18n/locales/zh-CN.ts index 8441a82..78ee548 100644 --- a/frontend/src/core/i18n/locales/zh-CN.ts +++ b/frontend/src/core/i18n/locales/zh-CN.ts @@ -99,6 +99,8 @@ export const zhCN: Translations = { needYourHelp: "需要你的协助", useTool: (toolName: string) => `使用 “${toolName}” 工具`, searchForRelatedInfo: "搜索相关信息", + searchForRelatedImages: "搜索相关图片", + searchForRelatedImagesFor: (query: string) => `搜索相关图片 “${query}”`, searchOnWebFor: (query: string) => `在网络上搜索 “${query}”`, viewWebPage: "查看网页", listFolder: "列出文件夹",