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