mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-04 22:32:12 +03:00
feat: inject fallback tool names to prevent upstream 400 errors (#1775)
This commit is contained in:
@@ -281,6 +281,9 @@ export class BaseExecutor {
|
||||
if (toolFunction && typeof toolFunction === "object" && !Array.isArray(toolFunction)) {
|
||||
const func = { ...(toolFunction as JsonRecord) };
|
||||
if (func.description === "") delete func.description;
|
||||
if (typeof func.name !== "string" || func.name.trim() === "") {
|
||||
func.name = "unnamed_tool";
|
||||
}
|
||||
return { ...toolRecord, function: func };
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user