This commit is contained in:
seb
2026-10-11 12:58:15 +02:00
parent 8262e35e53
commit 1149ffddcb
24 changed files with 575 additions and 261 deletions

View File

@@ -4,6 +4,7 @@ import sharp from 'sharp';
import { defineTool, ToolError } from 'libllmorbiter';
import * as dbCompanySetting from '../db/companysetting.js';
import { prepareVfs, syncVfsToDb } from './vfs.js';
import { TOOL_DESCRIPTIONS, TOOL_PARAMETER_DESCRIPTIONS } from './prompts.js';
const SERPER_ENDPOINT = 'https://google.serper.dev/images';
const SEARCH_TIMEOUT_MS = 15_000;
@@ -136,8 +137,7 @@ async function toAvif(img, { signal } = {}) {
export function createSearchImagesTool({ googleAuthId }) {
return defineTool({
name: 'search_images',
description:
'Search Google Images and download candidates to VFS as AVIF. Returns VFS paths for inspection via analyze_image.',
description: TOOL_DESCRIPTIONS.search_images,
strict: false,
parameters: {
type: 'object',
@@ -146,23 +146,23 @@ export function createSearchImagesTool({ googleAuthId }) {
properties: {
note: {
type: ['string', 'null'],
description: 'A note explaining what this image search is doing (or null). This note will be displayed to the user while executing.',
description: TOOL_PARAMETER_DESCRIPTIONS.search_images.note,
},
query: {
type: 'string',
description: 'Search query.',
description: TOOL_PARAMETER_DESCRIPTIONS.search_images.query,
},
count: {
type: ['number', 'null'],
description: `Candidate count or null. Default ${DEFAULT_COUNT}, max ${MAX_COUNT}.`,
description: TOOL_PARAMETER_DESCRIPTIONS.search_images.count,
},
gl: {
type: ['string', 'null'],
description: 'Country code or null. Default "de".',
description: TOOL_PARAMETER_DESCRIPTIONS.search_images.gl,
},
hl: {
type: ['string', 'null'],
description: 'Language code or null. Default "de".',
description: TOOL_PARAMETER_DESCRIPTIONS.search_images.hl,
},
},
},