mirror of
https://gitee.com/wanwujie/deer-flow
synced 2026-04-23 22:24:46 +08:00
feat: enhance search_image
This commit is contained in:
@@ -222,22 +222,37 @@ function ToolCall({
|
|||||||
if (typeof args.query === "string") {
|
if (typeof args.query === "string") {
|
||||||
label = t.toolCalls.searchForRelatedImagesFor(args.query);
|
label = t.toolCalls.searchForRelatedImagesFor(args.query);
|
||||||
}
|
}
|
||||||
|
const results = (
|
||||||
|
result as {
|
||||||
|
results: {
|
||||||
|
source_url: string;
|
||||||
|
thumbnail_url: string;
|
||||||
|
image_url: string;
|
||||||
|
title: string;
|
||||||
|
}[];
|
||||||
|
}
|
||||||
|
)?.results;
|
||||||
return (
|
return (
|
||||||
<ChainOfThoughtStep key={id} label={label} icon={SearchIcon}>
|
<ChainOfThoughtStep key={id} label={label} icon={SearchIcon}>
|
||||||
{Array.isArray(result) && (
|
{Array.isArray(results) && (
|
||||||
<ChainOfThoughtSearchResults>
|
<ChainOfThoughtSearchResults>
|
||||||
{result.map((item) => (
|
{Array.isArray(results) &&
|
||||||
<ChainOfThoughtSearchResult key={item.url}>
|
results.map((item) => (
|
||||||
<a href={item.url} target="_blank" rel="noreferrer">
|
<a
|
||||||
|
className="size-24 overflow-hidden rounded-lg object-cover"
|
||||||
|
key={item.image_url}
|
||||||
|
href={item.source_url}
|
||||||
|
target="_blank"
|
||||||
|
rel="noreferrer"
|
||||||
|
>
|
||||||
<img
|
<img
|
||||||
className="size-24 rounded-md object-cover"
|
className="size-24 object-cover"
|
||||||
src={item.url}
|
src={item.thumbnail_url}
|
||||||
alt={item.title}
|
alt={item.title}
|
||||||
width={100}
|
width={100}
|
||||||
height={100}
|
height={100}
|
||||||
/>
|
/>
|
||||||
</a>
|
</a>
|
||||||
</ChainOfThoughtSearchResult>
|
|
||||||
))}
|
))}
|
||||||
</ChainOfThoughtSearchResults>
|
</ChainOfThoughtSearchResults>
|
||||||
)}
|
)}
|
||||||
|
|||||||
Reference in New Issue
Block a user