This commit is contained in:
seb
2026-10-11 13:06:38 +02:00
parent 1149ffddcb
commit 0621416aa8
5 changed files with 31 additions and 31 deletions

View File

@@ -7,7 +7,7 @@ import env from '../config/env.js';
import { getImageByHash } from '../db/pic.js';
import { prepareVfs, syncVfsToDb, extractFullHash, isReadOnlyDatabasePath } from './vfs.js';
import { resolveOpenRouterKey, resolveImageModel } from './llm-key.js';
import { TOOL_DESCRIPTIONS } from './prompts.js';
import { TOOL_DESCRIPTIONS, TOOL_PARAMETER_DESCRIPTIONS } from './prompts.js';
/**
* edit-image — generate or edit images using the modelslugimage company setting.
@@ -261,15 +261,15 @@ export function createEditImageTool({ googleAuthId, model: fallbackModel }) {
properties: {
note: {
type: ['string', 'null'],
description: 'A note explaining what this image generation or edit is doing (or null). This note will be displayed to the user while the image is being generated or edited.',
description: TOOL_PARAMETER_DESCRIPTIONS.edit_image.note,
},
prompt: {
type: 'string',
description: 'Description of the image to generate, or edit/transformation instructions when attachments are provided.',
description: TOOL_PARAMETER_DESCRIPTIONS.edit_image.prompt,
},
attachments: {
type: ['array', 'null'],
description: 'Optional reference image(s) for editing/image-to-image or null. Omit for text-to-image generation.',
description: TOOL_PARAMETER_DESCRIPTIONS.edit_image.attachments,
items: {
type: 'object',
additionalProperties: false,
@@ -277,11 +277,11 @@ export function createEditImageTool({ googleAuthId, model: fallbackModel }) {
properties: {
vfsfilename: {
type: 'string',
description: 'VFS path (e.g. "images/sample.png") or database path ("image/<hash>").',
description: TOOL_PARAMETER_DESCRIPTIONS.edit_image.attachment_vfsfilename,
},
high: {
type: ['boolean', 'null'],
description: 'Feed image in high quality/resolution if true; low quality/resolution if false or null (default).',
description: TOOL_PARAMETER_DESCRIPTIONS.edit_image.attachment_high,
},
},
},
@@ -289,16 +289,16 @@ export function createEditImageTool({ googleAuthId, model: fallbackModel }) {
size: {
type: ['string', 'null'],
enum: [...VALID_SIZES, null],
description: 'Resolution tier (3 choices): "1K" (standard, default), "2K" (high quality), "4K" (ultra high), or null.',
description: TOOL_PARAMETER_DESCRIPTIONS.edit_image.size,
},
ratio: {
type: ['string', 'null'],
enum: [...VALID_RATIOS, null],
description: 'Aspect ratio (3 choices): "1:1" (square, default), "4:3" (landscape), "3:4" (portrait), or null.',
description: TOOL_PARAMETER_DESCRIPTIONS.edit_image.ratio,
},
vfsoutputfilename: {
type: ['string', 'null'],
description: 'VFS path where the output image should be saved (e.g. "images/edited.avif") or null. Defaults to "images/generated-<timestamp>.avif". Output is always converted to AVIF.',
description: TOOL_PARAMETER_DESCRIPTIONS.edit_image.vfsoutputfilename,
},
},
},

View File

@@ -1,5 +1,5 @@
import { defineTool, ToolError } from 'libllmorbiter';
import { TOOL_DESCRIPTIONS } from './prompts.js';
import { TOOL_DESCRIPTIONS, TOOL_PARAMETER_DESCRIPTIONS } from './prompts.js';
const DEFAULT_TAX_RATE = 19;
const DEFAULT_PRECISION = 6;
@@ -118,36 +118,36 @@ export function createNetGrossCalcTool() {
properties: {
note: {
type: 'string',
description: 'A note explaining what this price calculation is doing. This note will be displayed to the user while executing.',
description: TOOL_PARAMETER_DESCRIPTIONS.net_gross_calc.note,
},
gross: {
type: ['number', 'null'],
description: 'Gross price (incl. VAT) or null. When provided, computes net price and tax amount.',
description: TOOL_PARAMETER_DESCRIPTIONS.net_gross_calc.gross,
},
net: {
type: ['number', 'null'],
description: 'Net price (excl. VAT) or null. When provided, computes gross price and tax amount.',
description: TOOL_PARAMETER_DESCRIPTIONS.net_gross_calc.net,
},
taxRate: {
type: ['number', 'null'],
description: `Tax/VAT rate percentage (e.g. 19 for 19%, 7 for 7%) or null. Default ${DEFAULT_TAX_RATE}.`,
description: TOOL_PARAMETER_DESCRIPTIONS.net_gross_calc.taxRate,
},
amount: {
type: ['number', 'null'],
description: 'Generic price amount or null when used with "from" ("gross" or "net").',
description: TOOL_PARAMETER_DESCRIPTIONS.net_gross_calc.amount,
},
from: {
type: ['string', 'null'],
enum: ['gross', 'net', null],
description: 'Direction when using "amount": "gross" (default) or "net".',
description: TOOL_PARAMETER_DESCRIPTIONS.net_gross_calc.from,
},
precision: {
type: ['number', 'null'],
description: `Decimal precision for net price API value or null (default ${DEFAULT_PRECISION}, between 2 and 8).`,
description: TOOL_PARAMETER_DESCRIPTIONS.net_gross_calc.precision,
},
items: {
type: ['array', 'null'],
description: 'Optional array of prices or objects for batch calculation: [19.99, 49.95] or [{ gross: 19.99, taxRate: 7 }].',
description: TOOL_PARAMETER_DESCRIPTIONS.net_gross_calc.items,
items: {
type: 'object',
additionalProperties: false,

View File

@@ -227,7 +227,7 @@ export const TOOL_PARAMETER_DESCRIPTIONS = {
taxRate: 'Tax/VAT rate percentage (e.g. 19 for 19%, 7 for 7%) or null. Default 19.',
amount: 'Generic price amount or null when used with "from" ("gross" or "net").',
from: 'Direction when using "amount": "gross" (default) or "net".',
precision: 'Decimal precision for net price API value or null (default 4, between 2 and 8).',
precision: 'Decimal precision for net price API value or null (default 6, between 2 and 8).',
items: 'Optional array of prices or objects for batch calculation: [19.99, 49.95] or [{ gross: 19.99, taxRate: 7 }].',
},

View File

@@ -1,6 +1,6 @@
import { defineTool, ToolError } from 'libllmorbiter';
import { getStore, getProvider } from '../db/store.js';
import { TOOL_DESCRIPTIONS } from './prompts.js';
import { TOOL_DESCRIPTIONS, TOOL_PARAMETER_DESCRIPTIONS } from './prompts.js';
const DEFAULT_LIMIT = 3;
const MAX_LIMIT = 20;
@@ -32,19 +32,19 @@ export function createSearchArticlesTool({ googleAuthId, companyId }) {
properties: {
searchquery: {
type: ['string', 'null'],
description: 'Words that must all match across name, brand, EAN, SKU, or supplier SKU (AND logic, order-independent) or null.',
description: TOOL_PARAMETER_DESCRIPTIONS.search_articles.searchquery,
},
excludewords: {
type: ['string', 'null'],
description: 'Words that if all match exclude the article (AND logic, order-independent) or null.',
description: TOOL_PARAMETER_DESCRIPTIONS.search_articles.excludewords,
},
offset: {
type: ['integer', 'null'],
description: 'Pagination offset or null. Default 0.',
description: TOOL_PARAMETER_DESCRIPTIONS.search_articles.offset,
},
limit: {
type: ['integer', 'null'],
description: `Result window size (1–${MAX_LIMIT}) or null. Default ${DEFAULT_LIMIT}.`,
description: TOOL_PARAMETER_DESCRIPTIONS.search_articles.limit,
},
},
},

View File

@@ -1,6 +1,6 @@
import { defineTool, ToolError } from 'libllmorbiter';
import * as dbCompanySetting from '../db/companysetting.js';
import { TOOL_DESCRIPTIONS } from './prompts.js';
import { TOOL_DESCRIPTIONS, TOOL_PARAMETER_DESCRIPTIONS } from './prompts.js';
const SERPER_SEARCH_ENDPOINT = 'https://google.serper.dev/search';
const SEARCH_TIMEOUT_MS = 15_000;
@@ -98,28 +98,28 @@ export function createWebSearchTool({ googleAuthId }) {
properties: {
note: {
type: ['string', 'null'],
description: 'A note explaining what this search is doing (or null). This note will be displayed to the user while the search is executing.',
description: TOOL_PARAMETER_DESCRIPTIONS.web_search.note,
},
query: {
type: 'string',
description: 'Search query.',
description: TOOL_PARAMETER_DESCRIPTIONS.web_search.query,
},
timePeriod: {
type: ['string', 'null'],
enum: ['day', 'week', 'month', 'year', null],
description: 'Time filter: "day", "week", "month", or "year", or null.',
description: TOOL_PARAMETER_DESCRIPTIONS.web_search.timePeriod,
},
gl: {
type: ['string', 'null'],
description: 'Country code or null. Default "de".',
description: TOOL_PARAMETER_DESCRIPTIONS.web_search.gl,
},
hl: {
type: ['string', 'null'],
description: 'Language code or null. Default "de".',
description: TOOL_PARAMETER_DESCRIPTIONS.web_search.hl,
},
page: {
type: ['number', 'null'],
description: 'Result page number (10/page) or null. Default 1.',
description: TOOL_PARAMETER_DESCRIPTIONS.web_search.page,
},
},
},