mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-05 16:23:36 +00:00
Make Tool inputSchema optional
This commit is contained in:
8 files changed
+40
-52
No files matched your search
@@ -325,7 +325,14 @@ export class SessionManager {
|
||||
}
|
||||
|
||||
try {
|
||||
const toolArgs = tool.inputSchema.parse(JSON.parse(functionToolCall.function.arguments));
|
||||
let toolArgs: unknown;
|
||||
if (tool.inputSchema) {
|
||||
toolArgs = tool.inputSchema.parse(JSON.parse(functionToolCall.function.arguments));
|
||||
} else {
|
||||
// For tools without inputSchema, use empty object or parsed arguments as-is
|
||||
const rawArgs = functionToolCall.function.arguments;
|
||||
toolArgs = rawArgs ? JSON.parse(rawArgs) : {};
|
||||
}
|
||||
const content = await tool.execute(toolArgs);
|
||||
await this.addToolMessage(projectId, functionToolCall.id, content);
|
||||
} catch (error) {
|
||||
|
||||
Reference in new issue
Block a user