1 line
1.5 KiB
Plaintext
1 line
1.5 KiB
Plaintext
{"version":3,"file":"CopilotChatToolCallsView.cjs","names":["useRenderToolCall","React"],"sources":["../../../src/components/chat/CopilotChatToolCallsView.tsx"],"sourcesContent":["import { useRenderToolCall } from \"@/hooks\";\nimport type { AssistantMessage, Message, ToolMessage } from \"@ag-ui/core\";\nimport React from \"react\";\n\nexport type CopilotChatToolCallsViewProps = {\n message: AssistantMessage;\n messages?: Message[];\n};\n\nexport function CopilotChatToolCallsView({\n message,\n messages = [],\n}: CopilotChatToolCallsViewProps) {\n const renderToolCall = useRenderToolCall();\n\n if (!message.toolCalls || message.toolCalls.length === 0) {\n return null;\n }\n\n return (\n <>\n {message.toolCalls.map((toolCall) => {\n const toolMessage = messages.find(\n (m) => m.role === \"tool\" && m.toolCallId === toolCall.id,\n ) as ToolMessage | undefined;\n\n return (\n <React.Fragment key={toolCall.id}>\n {renderToolCall({\n toolCall,\n toolMessage,\n })}\n </React.Fragment>\n );\n })}\n </>\n );\n}\n\nexport default CopilotChatToolCallsView;\n"],"mappings":";;;;;;;;AASA,SAAgB,yBAAyB,EACvC,SACA,WAAW,EAAE,IACmB;CAChC,MAAM,iBAAiBA,gDAAmB;AAE1C,KAAI,CAAC,QAAQ,aAAa,QAAQ,UAAU,WAAW,EACrD,QAAO;AAGT,QACE,mFACG,QAAQ,UAAU,KAAK,aAAa;EACnC,MAAM,cAAc,SAAS,MAC1B,MAAM,EAAE,SAAS,UAAU,EAAE,eAAe,SAAS,GACvD;AAED,SACE,2CAACC,cAAM,sBACJ,eAAe;GACd;GACA;GACD,CAAC,IAJiB,SAAS,GAKb;GAEnB,GACD"} |