(toolName: string)
| 133 | }; |
| 134 | |
| 135 | function inspectToolCode(toolName: string) { |
| 136 | const tool = tools[toolName]; |
| 137 | if (tool) { |
| 138 | const functionCode = tool.function.toString(); |
| 139 | const stateCode = tool.state.toString(); |
| 140 | return `Tool Name: ${toolName}\nFunction Code:\n${functionCode}\n\nState Code:\n${stateCode}`; |
| 141 | } else { |
| 142 | return `Tool ${toolName} not found.`; |
| 143 | } |
| 144 | } |
| 145 | |
| 146 | // Helper function to extract function signature |
| 147 | function getFunctionSignature(func: (...args: unknown[]) => unknown) { |