mirror of
https://gitee.com/wanwujie/deer-flow
synced 2026-04-19 04:14:46 +08:00
feat: support image_search
This commit is contained in:
@@ -217,6 +217,32 @@ function ToolCall({
|
|||||||
)}
|
)}
|
||||||
</ChainOfThoughtStep>
|
</ChainOfThoughtStep>
|
||||||
);
|
);
|
||||||
|
} else if (name === "image_search") {
|
||||||
|
let label: React.ReactNode = t.toolCalls.searchForRelatedImages;
|
||||||
|
if (typeof args.query === "string") {
|
||||||
|
label = t.toolCalls.searchForRelatedImagesFor(args.query);
|
||||||
|
}
|
||||||
|
return (
|
||||||
|
<ChainOfThoughtStep key={id} label={label} icon={SearchIcon}>
|
||||||
|
{Array.isArray(result) && (
|
||||||
|
<ChainOfThoughtSearchResults>
|
||||||
|
{result.map((item) => (
|
||||||
|
<ChainOfThoughtSearchResult key={item.url}>
|
||||||
|
<a href={item.url} target="_blank" rel="noreferrer">
|
||||||
|
<img
|
||||||
|
className="size-24 rounded-md object-cover"
|
||||||
|
src={item.url}
|
||||||
|
alt={item.title}
|
||||||
|
width={100}
|
||||||
|
height={100}
|
||||||
|
/>
|
||||||
|
</a>
|
||||||
|
</ChainOfThoughtSearchResult>
|
||||||
|
))}
|
||||||
|
</ChainOfThoughtSearchResults>
|
||||||
|
)}
|
||||||
|
</ChainOfThoughtStep>
|
||||||
|
);
|
||||||
} else if (name === "web_fetch") {
|
} else if (name === "web_fetch") {
|
||||||
const url = (args as { url: string })?.url;
|
const url = (args as { url: string })?.url;
|
||||||
let title = url;
|
let title = url;
|
||||||
|
|||||||
@@ -101,6 +101,9 @@ export const enUS: Translations = {
|
|||||||
needYourHelp: "Need your help",
|
needYourHelp: "Need your help",
|
||||||
useTool: (toolName: string) => `Use "${toolName}" tool`,
|
useTool: (toolName: string) => `Use "${toolName}" tool`,
|
||||||
searchForRelatedInfo: "Search for related information",
|
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}"`,
|
searchOnWebFor: (query: string) => `Search on the web for "${query}"`,
|
||||||
viewWebPage: "View web page",
|
viewWebPage: "View web page",
|
||||||
listFolder: "List folder",
|
listFolder: "List folder",
|
||||||
|
|||||||
@@ -96,6 +96,8 @@ export interface Translations {
|
|||||||
needYourHelp: string;
|
needYourHelp: string;
|
||||||
useTool: (toolName: string) => string;
|
useTool: (toolName: string) => string;
|
||||||
searchForRelatedInfo: string;
|
searchForRelatedInfo: string;
|
||||||
|
searchForRelatedImages: string;
|
||||||
|
searchForRelatedImagesFor: (query: string) => string;
|
||||||
searchOnWebFor: (query: string) => string;
|
searchOnWebFor: (query: string) => string;
|
||||||
viewWebPage: string;
|
viewWebPage: string;
|
||||||
listFolder: string;
|
listFolder: string;
|
||||||
|
|||||||
@@ -99,6 +99,8 @@ export const zhCN: Translations = {
|
|||||||
needYourHelp: "需要你的协助",
|
needYourHelp: "需要你的协助",
|
||||||
useTool: (toolName: string) => `使用 “${toolName}” 工具`,
|
useTool: (toolName: string) => `使用 “${toolName}” 工具`,
|
||||||
searchForRelatedInfo: "搜索相关信息",
|
searchForRelatedInfo: "搜索相关信息",
|
||||||
|
searchForRelatedImages: "搜索相关图片",
|
||||||
|
searchForRelatedImagesFor: (query: string) => `搜索相关图片 “${query}”`,
|
||||||
searchOnWebFor: (query: string) => `在网络上搜索 “${query}”`,
|
searchOnWebFor: (query: string) => `在网络上搜索 “${query}”`,
|
||||||
viewWebPage: "查看网页",
|
viewWebPage: "查看网页",
|
||||||
listFolder: "列出文件夹",
|
listFolder: "列出文件夹",
|
||||||
|
|||||||
Reference in New Issue
Block a user