@agentscope-ai/chat 1.1.20 → 1.1.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/client.js +1 -1
- package/components/AGUI/components/HelpModal/icons.tsx +68 -0
- package/components/AGUI/components/HelpModal/index.tsx +1 -0
- package/components/AGUI/components/HelpModal/modal.tsx +101 -0
- package/components/AGUI/components/chat/Button.tsx +18 -0
- package/components/AGUI/components/chat/Chat.tsx +780 -0
- package/components/AGUI/components/chat/ChatContext.tsx +248 -0
- package/components/AGUI/components/chat/CodeBlock.tsx +406 -0
- package/components/AGUI/components/chat/Header.tsx +22 -0
- package/components/AGUI/components/chat/Icons.tsx +237 -0
- package/components/AGUI/components/chat/ImageUploadQueue.tsx +77 -0
- package/components/AGUI/components/chat/Input.tsx +24 -0
- package/components/AGUI/components/chat/Markdown.tsx +134 -0
- package/components/AGUI/components/chat/Messages.tsx +259 -0
- package/components/AGUI/components/chat/Modal.tsx +133 -0
- package/components/AGUI/components/chat/Popup.tsx +57 -0
- package/components/AGUI/components/chat/PoweredByTag.tsx +29 -0
- package/components/AGUI/components/chat/Sidebar.tsx +74 -0
- package/components/AGUI/components/chat/Suggestion.tsx +132 -0
- package/components/AGUI/components/chat/Suggestions.tsx +20 -0
- package/components/AGUI/components/chat/Textarea.tsx +61 -0
- package/components/AGUI/components/chat/Window.tsx +152 -0
- package/components/AGUI/components/chat/index.tsx +11 -0
- package/components/AGUI/components/chat/messages/AssistantMessage.tsx +69 -0
- package/components/AGUI/components/chat/messages/RenderActionExecutionMessage.tsx +129 -0
- package/components/AGUI/components/chat/messages/RenderAgentStateMessage.tsx +116 -0
- package/components/AGUI/components/chat/messages/RenderImageMessage.tsx +64 -0
- package/components/AGUI/components/chat/messages/RenderResultMessage.tsx +26 -0
- package/components/AGUI/components/chat/messages/RenderTextMessage.tsx +51 -0
- package/components/AGUI/components/chat/messages/UserMessage.tsx +10 -0
- package/components/AGUI/components/chat/props.ts +186 -0
- package/components/AGUI/components/index.ts +1 -0
- package/components/AGUI/context/index.ts +1 -0
- package/components/AGUI/hooks/index.ts +1 -0
- package/components/AGUI/hooks/use-copilot-chat-suggestions.tsx +122 -0
- package/components/AGUI/hooks/use-copy-to-clipboard.tsx +29 -0
- package/components/AGUI/hooks/use-dark-mode.ts +10 -0
- package/components/AGUI/hooks/use-push-to-talk.tsx +166 -0
- package/components/AGUI/index.tsx +4 -0
- package/components/AGUI/lib/utils.test.ts +7 -0
- package/components/AGUI/lib/utils.ts +27 -0
- package/components/AGUI/styles.css +0 -0
- package/components/AGUI/types/css.ts +0 -0
- package/components/AGUI/types/index.ts +1 -0
- package/components/AGUI/types/suggestions.ts +6 -0
- package/components/Accordion/Accordion.tsx +203 -0
- package/components/Accordion/BodyContent.tsx +28 -0
- package/components/Accordion/DeepThinking.tsx +91 -0
- package/components/Accordion/SoftLightTitle.tsx +13 -0
- package/components/Accordion/demo/search.tsx +39 -0
- package/components/Accordion/demo/steps.tsx +135 -0
- package/components/Accordion/demo/thinking.tsx +62 -0
- package/components/Accordion/index.en-US.md +34 -0
- package/components/Accordion/index.tsx +3 -0
- package/components/Accordion/index.zh-CN.md +34 -0
- package/components/Accordion/style.ts +208 -0
- package/components/AgentScopeRuntimeWebUI/demo/index.tsx +4 -0
- package/components/AgentScopeRuntimeWebUI/index.tsx +3 -0
- package/components/AgentScopeRuntimeWebUI/lib/AgentScopeRuntime/Request/Builder.tsx +82 -0
- package/components/AgentScopeRuntimeWebUI/lib/AgentScopeRuntime/Request/Card.tsx +52 -0
- package/components/AgentScopeRuntimeWebUI/lib/AgentScopeRuntime/Response/Actions.tsx +39 -0
- package/components/AgentScopeRuntimeWebUI/lib/AgentScopeRuntime/Response/Builder.tsx +205 -0
- package/components/AgentScopeRuntimeWebUI/lib/AgentScopeRuntime/Response/Card.tsx +44 -0
- package/components/AgentScopeRuntimeWebUI/lib/AgentScopeRuntime/Response/Error.tsx +7 -0
- package/components/AgentScopeRuntimeWebUI/lib/AgentScopeRuntime/Response/Message.tsx +23 -0
- package/components/AgentScopeRuntimeWebUI/lib/AgentScopeRuntime/Response/Reasoning.tsx +16 -0
- package/components/AgentScopeRuntimeWebUI/lib/AgentScopeRuntime/Response/Tool.tsx +19 -0
- package/components/AgentScopeRuntimeWebUI/lib/AgentScopeRuntime/index.tsx +0 -0
- package/components/AgentScopeRuntimeWebUI/lib/AgentScopeRuntime/types.tsx +100 -0
- package/components/AgentScopeRuntimeWebUI/lib/Chat/Input/index.tsx +77 -0
- package/components/AgentScopeRuntimeWebUI/lib/Chat/Input/useAttachments.tsx +53 -0
- package/components/AgentScopeRuntimeWebUI/lib/Chat/MessageList/index.tsx +30 -0
- package/components/AgentScopeRuntimeWebUI/lib/Chat/Welcome/index.tsx +66 -0
- package/components/AgentScopeRuntimeWebUI/lib/Chat/Welcome/styles.ts +51 -0
- package/components/AgentScopeRuntimeWebUI/lib/Chat/hooks/index.tsx +5 -0
- package/components/AgentScopeRuntimeWebUI/lib/Chat/hooks/useChatController.tsx +130 -0
- package/components/AgentScopeRuntimeWebUI/lib/Chat/hooks/useChatMessageHandler.tsx +87 -0
- package/components/AgentScopeRuntimeWebUI/lib/Chat/hooks/useChatRequest.tsx +114 -0
- package/components/AgentScopeRuntimeWebUI/lib/Chat/hooks/useChatSessionHandler.tsx +50 -0
- package/components/AgentScopeRuntimeWebUI/lib/Chat/index.tsx +18 -0
- package/components/AgentScopeRuntimeWebUI/lib/Chat/styles.tsx +59 -0
- package/components/AgentScopeRuntimeWebUI/lib/ChatAnywhere/ComposedProvider.tsx +27 -0
- package/components/AgentScopeRuntimeWebUI/lib/ChatAnywhere/index.tsx +29 -0
- package/components/AgentScopeRuntimeWebUI/lib/Context/ChatAnywhereControl.tsx +0 -0
- package/components/AgentScopeRuntimeWebUI/lib/Context/ChatAnywhereInputContext.tsx +27 -0
- package/components/AgentScopeRuntimeWebUI/lib/Context/ChatAnywhereLayoutContext.tsx +27 -0
- package/components/AgentScopeRuntimeWebUI/lib/Context/ChatAnywhereMessagesContext.tsx +82 -0
- package/components/AgentScopeRuntimeWebUI/lib/Context/ChatAnywhereOptionsContext.tsx +76 -0
- package/components/AgentScopeRuntimeWebUI/lib/Context/ChatAnywhereSessionsContext.tsx +111 -0
- package/components/AgentScopeRuntimeWebUI/lib/Context/useChatAnywhereEventEmitter.tsx +30 -0
- package/components/AgentScopeRuntimeWebUI/lib/Header/index.tsx +45 -0
- package/components/AgentScopeRuntimeWebUI/lib/Header/styles.ts +23 -0
- package/components/AgentScopeRuntimeWebUI/lib/Layout/index.tsx +45 -0
- package/components/AgentScopeRuntimeWebUI/lib/Layout/styles.tsx +104 -0
- package/components/AgentScopeRuntimeWebUI/lib/Sessions/index.tsx +114 -0
- package/components/AgentScopeRuntimeWebUI/lib/Sessions/styles.tsx +0 -0
- package/components/AgentScopeRuntimeWebUI/lib/demo/OptionsPanel/FormItem.tsx +37 -0
- package/components/AgentScopeRuntimeWebUI/lib/demo/OptionsPanel/OptionsEditor.tsx +163 -0
- package/components/AgentScopeRuntimeWebUI/lib/demo/OptionsPanel/defaultConfig.ts +43 -0
- package/components/AgentScopeRuntimeWebUI/lib/demo/OptionsPanel/index.tsx +27 -0
- package/components/AgentScopeRuntimeWebUI/lib/demo/index.tsx +57 -0
- package/components/AgentScopeRuntimeWebUI/lib/demo/sessionApi/index.ts +51 -0
- package/components/AgentScopeRuntimeWebUI/lib/types/IChatAnywhere.ts +358 -0
- package/components/AgentScopeRuntimeWebUI/lib/types/IMessages.tsx +52 -0
- package/components/AgentScopeRuntimeWebUI/lib/types/ISessions.tsx +29 -0
- package/components/AgentScopeRuntimeWebUI/lib/types/index.tsx +3 -0
- package/components/AgentScopeRuntimeWebUI/starter/OptionsPanel/FormItem.tsx +37 -0
- package/components/AgentScopeRuntimeWebUI/starter/OptionsPanel/OptionsEditor.tsx +163 -0
- package/components/AgentScopeRuntimeWebUI/starter/OptionsPanel/defaultConfig.ts +43 -0
- package/components/AgentScopeRuntimeWebUI/starter/OptionsPanel/index.tsx +27 -0
- package/components/AgentScopeRuntimeWebUI/starter/index.tsx +57 -0
- package/components/AgentScopeRuntimeWebUI/starter/sessionApi/index.ts +51 -0
- package/components/Attachments/DropArea.tsx +97 -0
- package/components/Attachments/FileList/AudioIcon.tsx +20 -0
- package/components/Attachments/FileList/FileListCard.tsx +270 -0
- package/components/Attachments/FileList/Progress.tsx +30 -0
- package/components/Attachments/FileList/VideoIcon.tsx +20 -0
- package/components/Attachments/FileList/index.tsx +201 -0
- package/components/Attachments/PlaceholderUploader.tsx +124 -0
- package/components/Attachments/SilentUploader.tsx +39 -0
- package/components/Attachments/context.tsx +11 -0
- package/components/Attachments/demo/basic.tsx +71 -0
- package/components/Attachments/index.en-US.md.bk +10 -0
- package/components/Attachments/index.tsx +274 -0
- package/components/Attachments/index.zh-CN.md.bk +10 -0
- package/components/Attachments/style/fileCard.ts +163 -0
- package/components/Attachments/style/index.ts +232 -0
- package/components/Attachments/util.ts +56 -0
- package/components/Bubble/Avatar.tsx +39 -0
- package/components/Bubble/Bubble.tsx +131 -0
- package/components/Bubble/BubbleList.tsx +105 -0
- package/components/Bubble/Cards.tsx +61 -0
- package/components/Bubble/Footer.tsx +55 -0
- package/components/Bubble/Interrupted.tsx +82 -0
- package/components/Bubble/ScrollToBottom.tsx +42 -0
- package/components/Bubble/Spin.tsx +13 -0
- package/components/Bubble/demo/assistantWithCode.tsx +60 -0
- package/components/Bubble/demo/assistantWithErrorStatus.tsx +102 -0
- package/components/Bubble/demo/assistantWithImage.tsx +46 -0
- package/components/Bubble/demo/assistantWithProcess.tsx +103 -0
- package/components/Bubble/demo/assistantWithSearch.tsx +69 -0
- package/components/Bubble/demo/assistantWithThinking.tsx +54 -0
- package/components/Bubble/demo/basic.tsx +55 -0
- package/components/Bubble/demo/userWithFile.tsx +27 -0
- package/components/Bubble/demo/userWithImage.tsx +26 -0
- package/components/Bubble/hooks/useDisplayData.ts +0 -0
- package/components/Bubble/hooks/useListData.ts +0 -0
- package/components/Bubble/index.en-US.md +33 -0
- package/components/Bubble/index.tsx +21 -0
- package/components/Bubble/index.zh-CN.md +33 -0
- package/components/Bubble/interface.ts +71 -0
- package/components/Bubble/loading.tsx +15 -0
- package/components/Bubble/style/avatar.ts +43 -0
- package/components/Bubble/style/footer.ts +45 -0
- package/components/Bubble/style/index.ts +192 -0
- package/components/Bubble/style/list.ts +51 -0
- package/components/ChatAnywhere/Chat/Ref.tsx +20 -0
- package/components/ChatAnywhere/Chat/index.tsx +56 -0
- package/components/ChatAnywhere/Chat/style.ts +59 -0
- package/components/ChatAnywhere/Header/index.tsx +37 -0
- package/components/ChatAnywhere/Header/style.ts +27 -0
- package/components/ChatAnywhere/Input/index.tsx +158 -0
- package/components/ChatAnywhere/Input/style.ts +14 -0
- package/components/ChatAnywhere/Layout/index.tsx +70 -0
- package/components/ChatAnywhere/Layout/style.ts +51 -0
- package/components/ChatAnywhere/SessionList/index.tsx +122 -0
- package/components/ChatAnywhere/SessionList/style.ts +53 -0
- package/components/ChatAnywhere/hooks/ChatAnywhereProvider.tsx +219 -0
- package/components/ChatAnywhere/hooks/types.ts +333 -0
- package/components/ChatAnywhere/hooks/useInput.tsx +22 -0
- package/components/ChatAnywhere/hooks/useMessages.tsx +63 -0
- package/components/ChatAnywhere/hooks/useSessionList.tsx +123 -0
- package/components/ChatAnywhere/index.tsx +49 -0
- package/components/Conversations/GroupTitle.tsx +28 -0
- package/components/Conversations/Item.tsx +189 -0
- package/components/Conversations/demo/basic.tsx +107 -0
- package/components/Conversations/demo/timeline.tsx +111 -0
- package/components/Conversations/demo/timestamp.tsx +110 -0
- package/components/Conversations/hooks/useGroupable.ts +81 -0
- package/components/Conversations/index.en-US.md +32 -0
- package/components/Conversations/index.tsx +176 -0
- package/components/Conversations/index.zh-CN.md +31 -0
- package/components/Conversations/interface.ts +69 -0
- package/components/Conversations/style.ts +153 -0
- package/components/DefaultCards/DeepThinking/index.tsx +33 -0
- package/components/DefaultCards/Files/index.tsx +69 -0
- package/components/DefaultCards/Footer/index.tsx +16 -0
- package/components/DefaultCards/Images/index.tsx +53 -0
- package/components/DefaultCards/Interrupted/index.tsx +13 -0
- package/components/DefaultCards/Text/index.tsx +13 -0
- package/components/DefaultCards/index.tsx +6 -0
- package/components/DeviceAction/actionMap.tsx +100 -0
- package/components/DeviceAction/demo/index.tsx +132 -0
- package/components/DeviceAction/index.en-US.md +19 -0
- package/components/DeviceAction/index.tsx +75 -0
- package/components/DeviceAction/index.zh-CN.md +19 -0
- package/components/Disclaimer/demo/index.tsx +4 -0
- package/components/Disclaimer/demo/withLink.tsx +4 -0
- package/components/Disclaimer/index.en-US.md +23 -0
- package/components/Disclaimer/index.tsx +42 -0
- package/components/Disclaimer/index.zh-CN.md +24 -0
- package/components/Disclaimer/style.ts +17 -0
- package/components/ImageGenerator/demo/basic.tsx +23 -0
- package/components/ImageGenerator/demo/custom.tsx +56 -0
- package/components/ImageGenerator/demo/size.tsx +15 -0
- package/components/ImageGenerator/index.en-US.md +23 -0
- package/components/ImageGenerator/index.tsx +124 -0
- package/components/ImageGenerator/index.zh-CN.md +23 -0
- package/components/ImageGenerator/style.ts +99 -0
- package/components/Markdown/Markdown/AnimationNode.tsx +89 -0
- package/components/Markdown/Markdown/Markdown.tsx +61 -0
- package/components/Markdown/Markdown/core/Parser.ts +52 -0
- package/components/Markdown/Markdown/core/Renderer.ts +121 -0
- package/components/Markdown/Markdown/core/index.ts +4 -0
- package/components/Markdown/Markdown/defaultComponents/CodeBlock.tsx +113 -0
- package/components/Markdown/Markdown/defaultComponents/DisabledImage.tsx +3 -0
- package/components/Markdown/Markdown/defaultComponents/Media.tsx +71 -0
- package/components/Markdown/Markdown/hooks/index.ts +4 -0
- package/components/Markdown/Markdown/hooks/useAnimation.tsx +27 -0
- package/components/Markdown/Markdown/hooks/useCitationsData.tsx +36 -0
- package/components/Markdown/Markdown/hooks/useStreaming.ts +503 -0
- package/components/Markdown/Markdown/hooks/useTyping.ts +22 -0
- package/components/Markdown/Markdown/index.tsx +198 -0
- package/components/Markdown/Markdown/interface.ts +217 -0
- package/components/Markdown/Markdown/style.ts +152 -0
- package/components/Markdown/demo/basic.tsx +107 -0
- package/components/Markdown/demo/citations.tsx +47 -0
- package/components/Markdown/demo/cursor.tsx +9 -0
- package/components/Markdown/demo/latex.tsx +77 -0
- package/components/Markdown/demo/typing.tsx +82 -0
- package/components/Markdown/index.en-US.md +27 -0
- package/components/Markdown/index.ts +1 -0
- package/components/Markdown/index.zh-CN.md +28 -0
- package/components/Markdown/plugins/citations/CitationComponent.tsx +72 -0
- package/components/Markdown/plugins/citations/index.tsx +37 -0
- package/components/Markdown/plugins/cursor/Dot.tsx +106 -0
- package/components/Markdown/plugins/cursor/Underline.tsx +38 -0
- package/components/Markdown/plugins/cursor/index.tsx +59 -0
- package/components/Markdown/plugins/latex/index.ts +109 -0
- package/components/Markdown/plugins/type.ts +71 -0
- package/components/Mermaid/demo/basic.tsx +12 -0
- package/components/Mermaid/demo/class.tsx +31 -0
- package/components/Mermaid/demo/flowchart.tsx +13 -0
- package/components/Mermaid/demo/sequence.tsx +18 -0
- package/components/Mermaid/demo/state.tsx +16 -0
- package/components/Mermaid/demo/timeline.tsx +15 -0
- package/components/Mermaid/index.en-US.md +27 -0
- package/components/Mermaid/index.tsx +118 -0
- package/components/Mermaid/index.zh-CN.md +27 -0
- package/components/OperateCard/OperateCard.tsx +93 -0
- package/components/OperateCard/demo/index.tsx +35 -0
- package/components/OperateCard/demo/rag.tsx +19 -0
- package/components/OperateCard/demo/thinking.tsx +17 -0
- package/components/OperateCard/demo/todo.tsx +28 -0
- package/components/OperateCard/demo/toolCall.tsx +14 -0
- package/components/OperateCard/demo/webSearch.tsx +12 -0
- package/components/OperateCard/index.en-US.md +51 -0
- package/components/OperateCard/index.tsx +1 -0
- package/components/OperateCard/index.zh-CN.md +51 -0
- package/components/OperateCard/preset/Rag.tsx +90 -0
- package/components/OperateCard/preset/Thinking.tsx +45 -0
- package/components/OperateCard/preset/TodoList.tsx +73 -0
- package/components/OperateCard/preset/ToolCall.tsx +67 -0
- package/components/OperateCard/preset/WebSearch.tsx +65 -0
- package/components/OperateCard/preset/index.tsx +5 -0
- package/components/OperateCard/style.ts +268 -0
- package/components/Provider/CustomCardsProvider.tsx +17 -0
- package/components/Provider/GlobalProvider.tsx +17 -0
- package/components/Provider/index.tsx +33 -0
- package/components/Provider/types.ts +23 -0
- package/components/ResponsesAPI/index.tsx +0 -0
- package/components/Sender/ModeSelect/index.tsx +160 -0
- package/components/Sender/ModeSelect/styles.ts +0 -0
- package/components/Sender/SenderHeader.tsx +164 -0
- package/components/Sender/StopLoading.tsx +48 -0
- package/components/Sender/components/ActionButton.tsx +106 -0
- package/components/Sender/components/ClearButton.tsx +10 -0
- package/components/Sender/components/LoadingButton.tsx +26 -0
- package/components/Sender/components/SendButton.tsx +22 -0
- package/components/Sender/components/SpeechButton/RecordingIcon.tsx +68 -0
- package/components/Sender/components/SpeechButton/index.tsx +30 -0
- package/components/Sender/demo/asr.tsx +7 -0
- package/components/Sender/demo/basic.tsx +7 -0
- package/components/Sender/demo/loading.tsx +5 -0
- package/components/Sender/demo/moreMode.tsx +45 -0
- package/components/Sender/demo/morePrefixAction.tsx +40 -0
- package/components/Sender/demo/withFile.tsx +54 -0
- package/components/Sender/demo/withImage.tsx +52 -0
- package/components/Sender/index.en-US.md +29 -0
- package/components/Sender/index.tsx +491 -0
- package/components/Sender/index.zh-CN.md +30 -0
- package/components/Sender/style/index.ts +150 -0
- package/components/Sender/useSpeech.ts +133 -0
- package/components/StatusCard/demo/index.tsx +32 -0
- package/components/StatusCard/index.en-US.md +30 -0
- package/components/StatusCard/index.tsx +162 -0
- package/components/StatusCard/index.zh-CN.md +27 -0
- package/components/StatusCard/style.ts +119 -0
- package/components/Stream/index.ts +203 -0
- package/components/Util/hooks/use-proxy-imperative-handle.ts +25 -0
- package/components/Util/sleep.ts +3 -0
- package/components/Util/type.ts +1 -0
- package/components/Util/warning.ts +118 -0
- package/components/Version/index.ts +3 -0
- package/components/Voice/Recorder.tsx +3 -0
- package/components/Voice/demo/index.tsx +0 -0
- package/components/Voice/index.en-US.md +8 -0
- package/components/Voice/index.tsx +0 -0
- package/components/Voice/index.zh-CN.md +9 -0
- package/components/Welcome/demo/EyeFollower.tsx +161 -0
- package/components/Welcome/demo/demo0.tsx +14 -0
- package/components/Welcome/demo/demo1.tsx +16 -0
- package/components/Welcome/demo/demo2.tsx +30 -0
- package/components/Welcome/demo/demo3.tsx +16 -0
- package/components/Welcome/index.en-US.md +28 -0
- package/components/Welcome/index.tsx +72 -0
- package/components/Welcome/index.zh-CN.md +28 -0
- package/components/index.ts +88 -0
- package/components/overview.en-US.md +10 -0
- package/components/overview.zh-CN.md +10 -0
- package/lib/AgentScopeRuntimeWebUI/index.d.ts +1 -0
- package/lib/AgentScopeRuntimeWebUI/index.js +1 -0
- package/lib/AgentScopeRuntimeWebUI/starter/OptionsPanel/FormItem.d.ts +9 -0
- package/lib/AgentScopeRuntimeWebUI/starter/OptionsPanel/FormItem.js +33 -0
- package/lib/AgentScopeRuntimeWebUI/starter/OptionsPanel/OptionsEditor.d.ts +7 -0
- package/lib/AgentScopeRuntimeWebUI/starter/OptionsPanel/OptionsEditor.js +188 -0
- package/lib/AgentScopeRuntimeWebUI/starter/OptionsPanel/defaultConfig.d.ts +29 -0
- package/lib/AgentScopeRuntimeWebUI/starter/OptionsPanel/defaultConfig.js +35 -0
- package/lib/AgentScopeRuntimeWebUI/starter/OptionsPanel/index.d.ts +6 -0
- package/lib/AgentScopeRuntimeWebUI/starter/OptionsPanel/index.js +49 -0
- package/lib/AgentScopeRuntimeWebUI/starter/index.d.ts +1 -0
- package/lib/AgentScopeRuntimeWebUI/starter/index.js +70 -0
- package/lib/AgentScopeRuntimeWebUI/starter/sessionApi/index.d.ts +14 -0
- package/lib/AgentScopeRuntimeWebUI/starter/sessionApi/index.js +143 -0
- package/package.json +3 -2
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { WebSearch } from "@agentscope-ai/chat";
|
|
2
|
+
|
|
3
|
+
export default function () {
|
|
4
|
+
return <WebSearch
|
|
5
|
+
subTitle="Transformer 领域的重要研究"
|
|
6
|
+
list={[
|
|
7
|
+
{ title: 'Transformer登上nature,被誉为大模型基石的它到底凭什么这么火?', subTitle: '新浪新闻', link: 'https://www.baidu.com', icon: 'https://www.baidu.com/favicon.ico' },
|
|
8
|
+
{ title: 'Transformer登上nature,它的技术核心是什么?', subTitle: '网易新闻', link: 'https://www.baidu.com', icon: 'https://www.baidu.com/favicon.ico' },
|
|
9
|
+
|
|
10
|
+
]}
|
|
11
|
+
/>
|
|
12
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
---
|
|
2
|
+
order: 3
|
|
3
|
+
|
|
4
|
+
group:
|
|
5
|
+
title: Output
|
|
6
|
+
order: 3
|
|
7
|
+
title: OperateCard
|
|
8
|
+
description: A card that displays AI actions in a conversation flow
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
<DemoTitle title="OperateCard" desc="A card that displays AI actions in a conversation flow" llmTxtName="OperateCard"></DemoTitle>
|
|
12
|
+
|
|
13
|
+
<code src="./demo/index.tsx" height="auto">Example</code>
|
|
14
|
+
|
|
15
|
+
<Install>import { OperateCard } from '@agentscope-ai/chat'</Install>
|
|
16
|
+
|
|
17
|
+
#### OperateCard Examples
|
|
18
|
+
|
|
19
|
+
<code src="./demo/rag.tsx" height="auto">RAG</code>
|
|
20
|
+
<code src="./demo/toolCall.tsx" height="auto">Tool Call</code>
|
|
21
|
+
<code src="./demo/webSearch.tsx" height="auto">Web Search</code>
|
|
22
|
+
<code src="./demo/todo.tsx" height="auto">Todo List</code>
|
|
23
|
+
<code src="./demo/thinking.tsx" height="auto">Thinking</code>
|
|
24
|
+
|
|
25
|
+
#### API
|
|
26
|
+
|
|
27
|
+
##### IOperateCardProps
|
|
28
|
+
|
|
29
|
+
<ApiParser source="./OperateCard.tsx" id="IOperateCardProps"></ApiParser>
|
|
30
|
+
|
|
31
|
+
##### IRagProps
|
|
32
|
+
|
|
33
|
+
<ApiParser source="./preset/Rag.tsx" id="IRagProps"></ApiParser>
|
|
34
|
+
|
|
35
|
+
##### IThinkingProps
|
|
36
|
+
|
|
37
|
+
<ApiParser source="./preset/Thinking.tsx" id="IThinkingProps"></ApiParser>
|
|
38
|
+
|
|
39
|
+
##### ITodoListProps
|
|
40
|
+
|
|
41
|
+
<ApiParser source="./preset/TodoList.tsx" id="ITodoListProps"></ApiParser>
|
|
42
|
+
|
|
43
|
+
##### IToolCallProps
|
|
44
|
+
|
|
45
|
+
<ApiParser source="./preset/ToolCall.tsx" id="IToolCallProps"></ApiParser>
|
|
46
|
+
|
|
47
|
+
##### IWebSearchProps
|
|
48
|
+
|
|
49
|
+
<ApiParser source="./preset/WebSearch.tsx" id="IWebSearchProps"></ApiParser>
|
|
50
|
+
|
|
51
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default, type IOperateCardProps } from './OperateCard';
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
---
|
|
2
|
+
order: 3
|
|
3
|
+
|
|
4
|
+
group:
|
|
5
|
+
title: 输出
|
|
6
|
+
order: 3
|
|
7
|
+
title: OperateCard
|
|
8
|
+
description: 一种展示对话流中AI操作行为的卡片
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
<DemoTitle title="OperateCard" desc="一种展示对话流中AI操作行为的卡片" llmTxtName="OperateCard"></DemoTitle>
|
|
12
|
+
|
|
13
|
+
<code src="./demo/index.tsx" height="auto">示例</code>
|
|
14
|
+
|
|
15
|
+
<Install>import { OperateCard } from '@agentscope-ai/chat'</Install>
|
|
16
|
+
|
|
17
|
+
#### 更多 OperateCard 示例
|
|
18
|
+
|
|
19
|
+
<code src="./demo/rag.tsx" height="auto">RAG</code>
|
|
20
|
+
<code src="./demo/toolCall.tsx" height="auto"> 工具调用</code>
|
|
21
|
+
<code src="./demo/webSearch.tsx" height="auto">联网搜索</code>
|
|
22
|
+
<code src="./demo/todo.tsx" height="auto">待办</code>
|
|
23
|
+
<code src="./demo/thinking.tsx" height="auto">思考</code>
|
|
24
|
+
|
|
25
|
+
#### API
|
|
26
|
+
|
|
27
|
+
##### IOperateCardProps
|
|
28
|
+
|
|
29
|
+
<ApiParser source="./OperateCard.tsx" id="IOperateCardProps"></ApiParser>
|
|
30
|
+
|
|
31
|
+
##### IRagProps
|
|
32
|
+
|
|
33
|
+
<ApiParser source="./preset/Rag.tsx" id="IRagProps"></ApiParser>
|
|
34
|
+
|
|
35
|
+
##### IThinkingProps
|
|
36
|
+
|
|
37
|
+
<ApiParser source="./preset/Thinking.tsx" id="IThinkingProps"></ApiParser>
|
|
38
|
+
|
|
39
|
+
##### ITodoListProps
|
|
40
|
+
|
|
41
|
+
<ApiParser source="./preset/TodoList.tsx" id="ITodoListProps"></ApiParser>
|
|
42
|
+
|
|
43
|
+
##### IToolCallProps
|
|
44
|
+
|
|
45
|
+
<ApiParser source="./preset/ToolCall.tsx" id="IToolCallProps"></ApiParser>
|
|
46
|
+
|
|
47
|
+
##### IWebSearchProps
|
|
48
|
+
|
|
49
|
+
<ApiParser source="./preset/WebSearch.tsx" id="IWebSearchProps"></ApiParser>
|
|
50
|
+
|
|
51
|
+
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { OperateCard, useProviderContext, Markdown } from '@agentscope-ai/chat';
|
|
2
|
+
import { SparkBookLine } from '@agentscope-ai/icons';
|
|
3
|
+
import { ConfigProvider, Image } from 'antd';
|
|
4
|
+
import { Locale } from "antd/es/locale";
|
|
5
|
+
|
|
6
|
+
export interface IRagProps {
|
|
7
|
+
/**
|
|
8
|
+
* @description 标题
|
|
9
|
+
* @descriptionEn Title
|
|
10
|
+
* @default '知识库检索'
|
|
11
|
+
*/
|
|
12
|
+
title?: string;
|
|
13
|
+
/**
|
|
14
|
+
* @description 副标题
|
|
15
|
+
* @descriptionEn Subtitle
|
|
16
|
+
* @default ''
|
|
17
|
+
*/
|
|
18
|
+
subTitle?: string;
|
|
19
|
+
/**
|
|
20
|
+
* @description 召回知识列表
|
|
21
|
+
* @descriptionEn RAG List
|
|
22
|
+
* @default []
|
|
23
|
+
*/
|
|
24
|
+
list: {
|
|
25
|
+
title: string;
|
|
26
|
+
content: string;
|
|
27
|
+
footer: string;
|
|
28
|
+
images?: string[];
|
|
29
|
+
link?: string;
|
|
30
|
+
}[]
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function Images({ images }: { images: string[] }) {
|
|
34
|
+
const { getPrefixCls } = useProviderContext();
|
|
35
|
+
|
|
36
|
+
const prefixCls = getPrefixCls('operate-card');
|
|
37
|
+
|
|
38
|
+
return <ConfigProvider
|
|
39
|
+
locale={{
|
|
40
|
+
Image: { preview: '' }
|
|
41
|
+
} as Locale}
|
|
42
|
+
>
|
|
43
|
+
<Image.PreviewGroup>
|
|
44
|
+
<div className={`${prefixCls}-rag-item-images`}>
|
|
45
|
+
{images.map((image, index) => <Image src={image} key={index} />)}
|
|
46
|
+
</div>
|
|
47
|
+
</Image.PreviewGroup>
|
|
48
|
+
</ConfigProvider>
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
export default function (props: IRagProps) {
|
|
55
|
+
const { getPrefixCls } = useProviderContext();
|
|
56
|
+
const prefixCls = getPrefixCls('operate-card');
|
|
57
|
+
const { title = '知识库检索', subTitle } = props;
|
|
58
|
+
|
|
59
|
+
return <OperateCard
|
|
60
|
+
header={{
|
|
61
|
+
icon: <SparkBookLine />,
|
|
62
|
+
title: title,
|
|
63
|
+
description: subTitle,
|
|
64
|
+
}}
|
|
65
|
+
body={{
|
|
66
|
+
defaultOpen: true,
|
|
67
|
+
children: <OperateCard.LineBody>
|
|
68
|
+
{props.list.map((item, index) => {
|
|
69
|
+
return <div key={index} className={`${prefixCls}-rag-item`}>
|
|
70
|
+
<div className={`${prefixCls}-rag-item-title`}>{item.title}</div>
|
|
71
|
+
<div className={`${prefixCls}-rag-item-content`}>
|
|
72
|
+
<Markdown content={item.content} />
|
|
73
|
+
|
|
74
|
+
{
|
|
75
|
+
item.images && <Images images={item.images} />
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
{
|
|
79
|
+
item.link ? <a onClick={() => {
|
|
80
|
+
window.open(item.link, '_blank');
|
|
81
|
+
}} className={`${prefixCls}-rag-item-footer`} href={item.link} target="_blank">{item.footer}</a> :
|
|
82
|
+
<div className={`${prefixCls}-rag-item-footer`}>{item.footer}</div>
|
|
83
|
+
}
|
|
84
|
+
</div>
|
|
85
|
+
</div>
|
|
86
|
+
})}
|
|
87
|
+
</OperateCard.LineBody>
|
|
88
|
+
}}
|
|
89
|
+
/>
|
|
90
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { OperateCard, useProviderContext } from '@agentscope-ai/chat';
|
|
2
|
+
import { SparkMemoryLine } from '@agentscope-ai/icons';
|
|
3
|
+
|
|
4
|
+
export interface IThinkingProps {
|
|
5
|
+
/**
|
|
6
|
+
* @description 标题
|
|
7
|
+
* @descriptionEn Title
|
|
8
|
+
* @default ''
|
|
9
|
+
*/
|
|
10
|
+
title: string;
|
|
11
|
+
/**
|
|
12
|
+
* @description 副标题
|
|
13
|
+
* @descriptionEn Subtitle
|
|
14
|
+
* @default ''
|
|
15
|
+
*/
|
|
16
|
+
subTitle?: string;
|
|
17
|
+
/**
|
|
18
|
+
* @description 思考内容
|
|
19
|
+
* @descriptionEn Thinking Content
|
|
20
|
+
* @default ''
|
|
21
|
+
*/
|
|
22
|
+
content: string;
|
|
23
|
+
}
|
|
24
|
+
export default function (props: IThinkingProps) {
|
|
25
|
+
const { getPrefixCls } = useProviderContext();
|
|
26
|
+
const prefixCls = getPrefixCls('operate-card');
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
return <OperateCard
|
|
30
|
+
|
|
31
|
+
header={{
|
|
32
|
+
icon: <SparkMemoryLine />,
|
|
33
|
+
title: props.title,
|
|
34
|
+
description: props.subTitle,
|
|
35
|
+
}}
|
|
36
|
+
body={{
|
|
37
|
+
defaultOpen: true,
|
|
38
|
+
children: <OperateCard.LineBody>
|
|
39
|
+
<div className={`${prefixCls}-thinking`}>
|
|
40
|
+
{props.content}
|
|
41
|
+
</div>
|
|
42
|
+
</OperateCard.LineBody>
|
|
43
|
+
}}
|
|
44
|
+
/>
|
|
45
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { OperateCard, useProviderContext } from '@agentscope-ai/chat';
|
|
2
|
+
import { SparkCheckCircleLine, SparkLoadingLine, SparkProjectNoLine } from '@agentscope-ai/icons';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
export interface ITodoListProps {
|
|
7
|
+
/**
|
|
8
|
+
* @description 标题
|
|
9
|
+
* @descriptionEn Title
|
|
10
|
+
* @default 'Task List'
|
|
11
|
+
*/
|
|
12
|
+
title?: string;
|
|
13
|
+
/**
|
|
14
|
+
* @description 默认展开
|
|
15
|
+
* @descriptionEn Default Open
|
|
16
|
+
* @default false
|
|
17
|
+
*/
|
|
18
|
+
defaultOpen?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* @description Todo 列表
|
|
21
|
+
* @descriptionEn Todo List
|
|
22
|
+
* @default []
|
|
23
|
+
*/
|
|
24
|
+
list: {
|
|
25
|
+
title: string;
|
|
26
|
+
status: 'done' | 'todo' | 'running';
|
|
27
|
+
}[]
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export default function (props: ITodoListProps) {
|
|
31
|
+
|
|
32
|
+
const { getPrefixCls } = useProviderContext();
|
|
33
|
+
const prefixCls = getPrefixCls('operate-card');
|
|
34
|
+
const { title = 'Task List' } = props;
|
|
35
|
+
const doneCount = props.list.filter((item) => item.status === 'done').length;
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
return <OperateCard
|
|
40
|
+
header={{
|
|
41
|
+
icon: <SparkProjectNoLine />,
|
|
42
|
+
title: title,
|
|
43
|
+
description: `· ${doneCount ? doneCount + ' of ' : ''} ${props.list.length}`,
|
|
44
|
+
}}
|
|
45
|
+
body={{
|
|
46
|
+
defaultOpen: props.defaultOpen,
|
|
47
|
+
children: <div className={`${prefixCls}-todo-list`}>
|
|
48
|
+
{props.list.map((item) => {
|
|
49
|
+
return <div key={item.title} className={classNames({
|
|
50
|
+
[`${prefixCls}-todo-list-item`]: true,
|
|
51
|
+
[`${prefixCls}-todo-list-item-${item.status}`]: true,
|
|
52
|
+
})}>
|
|
53
|
+
<div className={`${prefixCls}-todo-list-item-icon`}>
|
|
54
|
+
{{
|
|
55
|
+
'done': <SparkCheckCircleLine />,
|
|
56
|
+
'todo': <SparkCheckCircleLine />,
|
|
57
|
+
'running': <SparkLoadingLine spin={true} />,
|
|
58
|
+
}[item.status]}
|
|
59
|
+
</div>
|
|
60
|
+
<div className={`${prefixCls}-todo-list-item-title`} style={{
|
|
61
|
+
textDecoration: item.status === 'done' ? 'line-through' : 'none',
|
|
62
|
+
}}>
|
|
63
|
+
{item.title}
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
66
|
+
})}
|
|
67
|
+
|
|
68
|
+
</div>
|
|
69
|
+
}}
|
|
70
|
+
/>
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
|
|
2
|
+
import { OperateCard, useProviderContext } from '@agentscope-ai/chat';
|
|
3
|
+
import { SparkToolLine } from '@agentscope-ai/icons';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
function Block(props: {
|
|
7
|
+
title: string;
|
|
8
|
+
content: string | Record<string, any>
|
|
9
|
+
}) {
|
|
10
|
+
const { getPrefixCls } = useProviderContext();
|
|
11
|
+
const prefixCls = getPrefixCls('operate-card');
|
|
12
|
+
const contentString = typeof props.content === 'string' ? props.content : JSON.stringify(props.content, null, 2);
|
|
13
|
+
return <div className={`${prefixCls}-tool-call-block`}>
|
|
14
|
+
<div className={`${prefixCls}-tool-call-block-title`}>{props.title}</div>
|
|
15
|
+
<div className={`${prefixCls}-tool-call-block-content`}>{contentString}</div>
|
|
16
|
+
</div>
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface IToolCallProps {
|
|
20
|
+
/**
|
|
21
|
+
* @description 标题
|
|
22
|
+
* @descriptionEn Title
|
|
23
|
+
* @default 'Call Tool'
|
|
24
|
+
*/
|
|
25
|
+
title?: string;
|
|
26
|
+
/**
|
|
27
|
+
* @description 副标题
|
|
28
|
+
* @descriptionEn Subtitle
|
|
29
|
+
* @default ''
|
|
30
|
+
*/
|
|
31
|
+
subTitle?: string;
|
|
32
|
+
/**
|
|
33
|
+
* @description 工具调用入参
|
|
34
|
+
* @descriptionEn Tool Call Input
|
|
35
|
+
* @default ''
|
|
36
|
+
*/
|
|
37
|
+
input: string | Record<string, any>;
|
|
38
|
+
/**
|
|
39
|
+
* @description 工具调用输出
|
|
40
|
+
* @descriptionEn Tool Call Output
|
|
41
|
+
* @default ''
|
|
42
|
+
*/
|
|
43
|
+
output: string | Record<string, any>;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export default function (props: IToolCallProps) {
|
|
47
|
+
|
|
48
|
+
const { title = 'Call Tool', subTitle } = props;
|
|
49
|
+
|
|
50
|
+
return <OperateCard
|
|
51
|
+
|
|
52
|
+
header={{
|
|
53
|
+
icon: <SparkToolLine />,
|
|
54
|
+
title: title,
|
|
55
|
+
description: subTitle,
|
|
56
|
+
}}
|
|
57
|
+
|
|
58
|
+
body={{
|
|
59
|
+
defaultOpen: true,
|
|
60
|
+
children: <OperateCard.LineBody>
|
|
61
|
+
<Block title="Input" content={props.input} />
|
|
62
|
+
<Block title="Output" content={props.output} />
|
|
63
|
+
</OperateCard.LineBody>
|
|
64
|
+
}}
|
|
65
|
+
>
|
|
66
|
+
</OperateCard>
|
|
67
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { OperateCard, useProviderContext } from '@agentscope-ai/chat';
|
|
2
|
+
import { SparkSearchLine } from '@agentscope-ai/icons';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
export interface IWebSearchProps {
|
|
7
|
+
/**
|
|
8
|
+
* @description 标题
|
|
9
|
+
* @descriptionEn Title
|
|
10
|
+
* @default '联网搜索'
|
|
11
|
+
*/
|
|
12
|
+
title?: string;
|
|
13
|
+
/**
|
|
14
|
+
* @description 副标题
|
|
15
|
+
* @descriptionEn Subtitle
|
|
16
|
+
* @default ''
|
|
17
|
+
*/
|
|
18
|
+
subTitle?: string;
|
|
19
|
+
/**
|
|
20
|
+
* @description 列表
|
|
21
|
+
* @descriptionEn List
|
|
22
|
+
* @default []
|
|
23
|
+
*/
|
|
24
|
+
list: {
|
|
25
|
+
title: string;
|
|
26
|
+
subTitle?: string;
|
|
27
|
+
link: string;
|
|
28
|
+
icon: string;
|
|
29
|
+
}[]
|
|
30
|
+
}
|
|
31
|
+
export default function (props: IWebSearchProps) {
|
|
32
|
+
|
|
33
|
+
const { getPrefixCls } = useProviderContext();
|
|
34
|
+
const prefixCls = getPrefixCls('operate-card');
|
|
35
|
+
const { title = '联网搜索', subTitle } = props;
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
return <OperateCard
|
|
39
|
+
header={{
|
|
40
|
+
icon: <SparkSearchLine />,
|
|
41
|
+
title: title,
|
|
42
|
+
description: subTitle,
|
|
43
|
+
}}
|
|
44
|
+
body={{
|
|
45
|
+
defaultOpen: true,
|
|
46
|
+
children: <OperateCard.LineBody>{
|
|
47
|
+
props.list.map((item) => {
|
|
48
|
+
return <div key={item.title} className={classNames({
|
|
49
|
+
[`${prefixCls}-web-search-item`]: true,
|
|
50
|
+
})} onClick={() => {
|
|
51
|
+
window.open(item.link, '_blank');
|
|
52
|
+
}}>
|
|
53
|
+
<img className={`${prefixCls}-web-search-item-icon`} src={item.icon} alt={item.title} />
|
|
54
|
+
|
|
55
|
+
<div className={`${prefixCls}-web-search-item-title`}>{item.title}</div>
|
|
56
|
+
{
|
|
57
|
+
item.subTitle && <div className={`${prefixCls}-web-search-item-subTitle`}>{item.subTitle}</div>
|
|
58
|
+
}
|
|
59
|
+
</div>
|
|
60
|
+
})
|
|
61
|
+
|
|
62
|
+
}</OperateCard.LineBody>
|
|
63
|
+
}}
|
|
64
|
+
/>
|
|
65
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { default as Thinking, type IThinkingProps } from './Thinking'
|
|
2
|
+
export { default as TodoList, type ITodoListProps } from './TodoList'
|
|
3
|
+
export { default as ToolCall, type IToolCallProps } from './ToolCall'
|
|
4
|
+
export { default as WebSearch, type IWebSearchProps } from './WebSearch'
|
|
5
|
+
export { default as Rag, type IRagProps } from './Rag'
|