@gensx/react
Version:
React hooks and components for GenSX AI workflows.
1 lines • 950 B
Source Map (JSON)
{"version":3,"file":"tools.cjs","sources":["@gensx/react/../../../../src/tools.ts"],"sourcesContent":["import {\n InferToolParams,\n InferToolResult,\n ToolBox,\n ToolImplementations,\n} from \"@gensx/core\";\n\n// Helper to create tool implementations with type safety\nexport function createToolImplementations<T extends ToolBox>(implementations: {\n [K in keyof T]: (\n params: InferToolParams<T, K>,\n ) => InferToolResult<T, K> | Promise<InferToolResult<T, K>>;\n}): ToolImplementations<T> {\n return Object.fromEntries(\n Object.entries(implementations).map(([name, impl]) => [\n name,\n { execute: impl as unknown },\n ]),\n ) as ToolImplementations<T>;\n}\n"],"names":[],"mappings":";;;;;;;;AAOA;AACM,SAAU,yBAAyB,CAAoB,eAI5D,EAAA;IACC,OAAO,MAAM,CAAC,WAAW,CACvB,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK;QACpD,IAAI;QACJ,EAAE,OAAO,EAAE,IAAe,EAAE;AAC7B,KAAA,CAAC,CACuB;AAC7B;;;;"}