Update ImageShowTool render message and WebSearchTool image handling
Browse files
src/tools/ImageShowTool/UI.tsx
CHANGED
|
@@ -155,7 +155,7 @@ export function ImageDisplay({
|
|
| 155 |
// ── Tool rendering functions ──
|
| 156 |
|
| 157 |
export function renderToolUseMessage(): React.ReactNode {
|
| 158 |
-
return "
|
| 159 |
}
|
| 160 |
|
| 161 |
export function renderToolUseProgressMessage(): React.ReactNode {
|
|
|
|
| 155 |
// ── Tool rendering functions ──
|
| 156 |
|
| 157 |
export function renderToolUseMessage(): React.ReactNode {
|
| 158 |
+
return "Image";
|
| 159 |
}
|
| 160 |
|
| 161 |
export function renderToolUseProgressMessage(): React.ReactNode {
|
src/tools/WebSearchTool/WebSearchTool.ts
CHANGED
|
@@ -94,7 +94,7 @@ async function searchSearXNG(
|
|
| 94 |
title: r.title,
|
| 95 |
url: r.url,
|
| 96 |
snippet: r.content,
|
| 97 |
-
image: r.thumbnail || undefined,
|
| 98 |
}))
|
| 99 |
} catch (error) {
|
| 100 |
logError('SearXNG search failed', error)
|
|
@@ -307,6 +307,9 @@ export const WebSearchTool = buildTool({
|
|
| 307 |
} else {
|
| 308 |
r.content.forEach((item: any, i: number) => {
|
| 309 |
text += `${i + 1}. ${item.title}\n${item.url}\n${item.snippet || ''}\n`
|
|
|
|
|
|
|
|
|
|
| 310 |
})
|
| 311 |
}
|
| 312 |
}
|
|
|
|
| 94 |
title: r.title,
|
| 95 |
url: r.url,
|
| 96 |
snippet: r.content,
|
| 97 |
+
image: r.img_src || r.thumbnail || undefined,
|
| 98 |
}))
|
| 99 |
} catch (error) {
|
| 100 |
logError('SearXNG search failed', error)
|
|
|
|
| 307 |
} else {
|
| 308 |
r.content.forEach((item: any, i: number) => {
|
| 309 |
text += `${i + 1}. ${item.title}\n${item.url}\n${item.snippet || ''}\n`
|
| 310 |
+
if (item.image) {
|
| 311 |
+
text += `Image: ${item.image}\n`
|
| 312 |
+
}
|
| 313 |
})
|
| 314 |
}
|
| 315 |
}
|