fix: allow empty text field when doc_ids supplied to all tool APIs
dbnToolsString was called with required=true (default), so it aborted before dbnToolsInjectDocContent could inject content from the doc picker. Now passes required=false and validates after injection so doc-only submissions work in timeline, redact, ask, and summarize. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+4
-1
@@ -11,7 +11,10 @@ if ($ftRemaining >= 0) { header('X-Credits-Remaining: ' . $ftRemaining); }
|
||||
$input = dbnToolsJsonInput(400000);
|
||||
|
||||
dbnToolsWithTelemetry('redact', '', function () use ($input): array {
|
||||
$text = dbnToolsInjectDocContent($input, dbnToolsString($input, 'text', 128000));
|
||||
$text = dbnToolsInjectDocContent($input, dbnToolsString($input, 'text', 128000, false));
|
||||
if (mb_strlen(trim($text), 'UTF-8') < 10) {
|
||||
dbnToolsAbort('Paste text, upload a file, or select a document before running.', 422, 'empty_text');
|
||||
}
|
||||
$mode = (string)($input['mode'] ?? 'standard');
|
||||
$region = dbnToolsNormalizeRegion($input['region'] ?? 'nordic');
|
||||
$language = dbnToolsNormalizeLanguage($input['language'] ?? 'en');
|
||||
|
||||
Reference in New Issue
Block a user