mirror of
https://github.com/larchanka/manbot.git
synced 2026-05-13 21:42:08 +00:00
Fix: Re-added support for local_file_url in send_file for backward compatibility and updated planner prompt to use local_path.
This commit is contained in:
committed by
Mikhail Larchanka
parent
6501f232ae
commit
56f0c965d0
@@ -860,7 +860,7 @@ export class ExecutorAgent extends BaseProcess {
|
||||
const input = node.input ?? {};
|
||||
const nodeInput = input as Record<string, unknown>;
|
||||
|
||||
let localPath = (nodeInput.local_path as string) || (nodeInput.path as string);
|
||||
let localPath = (nodeInput.local_path as string) || (nodeInput.local_file_url as string) || (nodeInput.path as string);
|
||||
if (localPath && (localPath.startsWith("http://") || localPath.startsWith("https://"))) {
|
||||
throw new Error(`send_file requires a local path, but received a URL: ${localPath}. Download the file first using shell (curl/wget) if needed.`);
|
||||
}
|
||||
@@ -903,7 +903,7 @@ export class ExecutorAgent extends BaseProcess {
|
||||
if (caption) caption = resolveValue(caption).trim();
|
||||
|
||||
if (!localPath) {
|
||||
throw new Error("send_file requires local_file_url");
|
||||
throw new Error("send_file requires local_path (or local_file_url)");
|
||||
}
|
||||
if (!chatId) {
|
||||
throw new Error("send_file requires chatId");
|
||||
|
||||
@@ -39,7 +39,7 @@ The "tool-host" service supports ONLY these 3 names in the "tool" field:
|
||||
- **"shell"**: For ALL terminal commands. (Example: \`"tool": "shell", "arguments": { "command": "cat file.txt" }\`)
|
||||
- **"http_get"**: For rendering a specific URL (Playwright).
|
||||
- **"http_search"**: For finding information on the web.
|
||||
- **"send_file"** (service: "core"): For sharing files produced or found in the sandbox with the user via Telegram. (Input: \`local_file_url\`, \`brief_file_description\`).
|
||||
- **"send_file"** (service: "core"): For sharing files produced or found in the sandbox with the user via Telegram. (Input: \`local_path\`, \`brief_file_description\`).
|
||||
|
||||
## 3. GRAPH ARCHITECTURE RULES
|
||||
- **Synthesis**: Every research/tool-heavy plan **MUST** end with a "model-router" node (\`system_prompt: "analyzer"\`).
|
||||
@@ -259,7 +259,7 @@ User: "search for the latest price of Gold and create a simple text report, then
|
||||
"type": "send_file",
|
||||
"service": "core",
|
||||
"input": {
|
||||
"local_file_url": "{{create-report}}",
|
||||
"local_path": "{{create-report}}",
|
||||
"brief_file_description": "Here is the gold price report you requested."
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user