* Transforms an array of `PipeTool` objects into an array of objects containing * tool call strings, import paths, and tool file names. * * @param tools - An array of `PipeTool` objects to be transformed. * @returns An array of objects, each containing: * - `toolCall`: A string representing the
(tools: PipeTool[])
| 202 | * - `toolFileName`: A string representing the file name of the tool. |
| 203 | */ |
| 204 | function getToolsPipeData(tools: PipeTool[]) { |
| 205 | return tools.map(tool => { |
| 206 | const toolFileName = slugify(tool.function.name); |
| 207 | const toolName = `${camelCase(tool.function.name)}Tool`; |
| 208 | const importPath = `import ${toolName} from '../tools/${toolFileName}';`; |
| 209 | |
| 210 | return { |
| 211 | toolCall: `${toolName}()`, |
| 212 | importPath, |
| 213 | toolFileName |
| 214 | }; |
| 215 | }); |
| 216 | } |
| 217 | |
| 218 | /** |
| 219 | * Asynchronously creates a local pipe configuration file. |