@copilotkit/react-core
Version:
<img src="https://github.com/user-attachments/assets/0a6b64d9-e193-4940-a3f6-60334ac34084" alt="banner" style="border-radius: 12px; border: 2px solid #d6d4fa;" />
1 lines • 796 B
Source Map (JSON)
{"version":3,"sources":["../src/hooks/use-frontend-tool.ts"],"sourcesContent":["import { useCopilotAction } from \"./use-copilot-action\";\nimport { FrontendAction } from \"../types/frontend-action\";\nimport { Parameter } from \"@copilotkit/shared\";\n\ntype UseToolCallArgs<T extends Parameter[] | [] = []> = {\n available?: \"disabled\" | \"enabled\";\n} & Pick<\n FrontendAction<T>,\n \"name\" | \"description\" | \"parameters\" | \"handler\" | \"followUp\" | \"render\"\n>;\n\nexport function useFrontendTool<const T extends Parameter[] | [] = []>(\n tool: UseToolCallArgs<T>,\n dependencies?: any[],\n) {\n // Use the existing useCopilotAction hook\n useCopilotAction<T>(tool, dependencies);\n}\n"],"mappings":";;;;;AAWO,SAAS,gBACd,MACA,cACA;AAEA,mBAAoB,MAAM,YAAY;AACxC;","names":[]}