u
This commit is contained in:
@@ -3,7 +3,7 @@ import path from 'path';
|
||||
import { optimizeImage } from 'wasm-image-optimization';
|
||||
import { defineTool, ToolError } from 'libllmorbiter';
|
||||
import * as dbCompanySetting from '../db/companysetting.js';
|
||||
import { prepareVfs, syncVfsToDb } from './vfs.js';
|
||||
import { prepareVfs } from './vfs.js';
|
||||
import { TOOL_DESCRIPTIONS, TOOL_PARAMETER_DESCRIPTIONS } from './prompts.js';
|
||||
|
||||
const SERPER_ENDPOINT = 'https://google.serper.dev/images';
|
||||
@@ -249,16 +249,7 @@ export function createSearchImagesTool({ googleAuthId }) {
|
||||
});
|
||||
}
|
||||
|
||||
if (results.length > 0) {
|
||||
try {
|
||||
await syncVfsToDb({ googleAuthId, vfsRoot });
|
||||
} catch (err) {
|
||||
// Non-fatal: the files are on disk and will be picked up by the next
|
||||
// javascript_execute / patch sync. Losing the images because a DB write
|
||||
// failed would be a worse outcome than a slightly stale store.
|
||||
console.warn('[search_images] failed to persist candidates:', err.message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const result = {
|
||||
query: term,
|
||||
|
||||
Reference in New Issue
Block a user