diff --git a/.dumi/theme/layouts/GlobalLayout.tsx b/.dumi/theme/layouts/GlobalLayout.tsx index 6080adf69..985280d23 100644 --- a/.dumi/theme/layouts/GlobalLayout.tsx +++ b/.dumi/theme/layouts/GlobalLayout.tsx @@ -1,25 +1,24 @@ import { - NaNLinter, - StyleProvider, createCache, extractStyle, legacyNotSelectorLinter, + NaNLinter, parentSelectorLinter, + StyleProvider, } from '@ant-design/cssinjs'; import { getSandpackCssText } from '@codesandbox/sandpack-react'; -import { App, theme as antdTheme } from 'antd'; -import { createSearchParams, useOutlet, useSearchParams, useServerInsertedHTML } from 'dumi'; -import React, { useCallback, useEffect, Suspense } from 'react'; - import type { MappingAlgorithm } from 'antd'; +import { App, theme as antdTheme } from 'antd'; import type { DirectionType, ThemeConfig } from 'antd/es/config-provider'; +import { createSearchParams, useOutlet, useSearchParams, useServerInsertedHTML } from 'dumi'; +import React, { Suspense, useCallback, useEffect } from 'react'; import { DarkContext } from '../../hooks/useDark'; import useLayoutState from '../../hooks/useLayoutState'; import useLocation from '../../hooks/useLocation'; -import SiteThemeProvider from '../SiteThemeProvider'; import PeterCat from '../common/PeterCat'; import type { ThemeName } from '../common/ThemeSwitch'; +import SiteThemeProvider from '../SiteThemeProvider'; import type { SiteContextProps } from '../slots/SiteContext'; import SiteContext from '../slots/SiteContext'; diff --git a/docs/playground/agent-tbox.en-US.md b/docs/playground/agent-tbox.en-US.md new file mode 100644 index 000000000..4e52776e9 --- /dev/null +++ b/docs/playground/agent-tbox.en-US.md @@ -0,0 +1,10 @@ +--- +group: + title: Agent Sample + order: 1 +title: Tbox +description: Tbox X Agent +order: 0 +--- + + diff --git a/docs/playground/agent-tbox.tsx b/docs/playground/agent-tbox.tsx new file mode 100644 index 000000000..c2bc30a13 --- /dev/null +++ b/docs/playground/agent-tbox.tsx @@ -0,0 +1,682 @@ +import { + AppstoreAddOutlined, + CopyOutlined, + DeleteOutlined, + DislikeOutlined, + EditOutlined, + EllipsisOutlined, + FileSearchOutlined, + HeartOutlined, + LikeOutlined, + PlusOutlined, + ProductOutlined, + QuestionCircleOutlined, + ReloadOutlined, + ScheduleOutlined, + ShareAltOutlined, + SmileOutlined, +} from '@ant-design/icons'; +import { + Bubble, + Conversations, + Prompts, + Sender, + useXAgent, + useXChat, + Welcome, +} from '@ant-design/x'; +import { Avatar, Button, Flex, type GetProp, message, Space, Spin } from 'antd'; +import { createStyles } from 'antd-style'; +import dayjs from 'dayjs'; +import React, { useEffect, useRef, useState } from 'react'; +import { TboxClient } from 'tbox-nodejs-sdk'; + +const tboxClient = new TboxClient({ + httpClientConfig: { + authorization: 'your-api-key', // Replace with your API key + isAntdXDemo: true, // Only for Ant Design X demo + }, +}); + +const zhCN = { + whatIsTbox: '什么是百宝箱 Tbox.cn?', + whatCanTboxDo: '百宝箱可以做什么?', + today: '今天', + yesterday: '昨天', + hotTopics: '最热话题', + designGuide: '设计指南', + intent: '意图', + role: '角色', + aiUnderstandsUserNeeds: 'AI 理解用户需求并提供解决方案', + aiPublicImage: 'AI 的公众形象', + dynamic: '动态', + component: '组件', + guide: '指南', + tutorial: '教程', + newConversation: '新会话', + rename: '重命名', + delete: '删除', + requestInProgress: '请求正在进行中,请等待请求完成。', + demoButtonNoFunction: '演示按钮,无实际功能', + helloAntdXTboxAgent: '你好, 我是 Ant Design X & 百宝箱智能体', + antdXTboxDescription: + '基于 Ant Design 的 AGI 产品界面解决方案,打造更卓越的智能视觉体验,集成了百宝箱 Tbox.cn 的智能体能力,助力产品设计与开发。', + askMeAnything: '向我提问吧', + loadingMessage: '加载中💗', +}; + +const enUS = { + whatIsTbox: 'What is Tbox.cn?', + whatCanTboxDo: 'What can Tbox.cn do?', + today: 'Today', + yesterday: 'Yesterday', + hotTopics: 'Hot Topics', + designGuide: 'Design Guide', + intent: 'Intent', + role: 'Role', + aiUnderstandsUserNeeds: 'AI understands user needs and provides solutions', + aiPublicImage: "AI's public image", + dynamic: 'Dynamic', + component: 'Component', + guide: 'Guide', + tutorial: 'Tutorial', + newConversation: 'New Conversation', + rename: 'Rename', + delete: 'Delete', + requestInProgress: 'Request is in progress, please wait for the request to complete.', + demoButtonNoFunction: 'Demo button, no actual function', + helloAntdXTboxAgent: 'Hello, I am Ant Design X & Tbox Agent', + antdXTboxDescription: + 'An AGI product interface solution based on Ant Design, creating a superior intelligent visual experience, integrating the capabilities of Tbox.cn agents to assist in product design and development.', + askMeAnything: 'Ask me anything...', + loadingMessage: 'Loading...', +}; + +type BubbleDataType = { + role: string; + content: string; +}; + +const isZhCN = window.parent?.location?.pathname?.includes('-cn'); +const t = isZhCN ? zhCN : enUS; + +const DEFAULT_CONVERSATIONS_ITEMS = [ + { + key: 'default-0', + label: t.whatIsTbox, + group: t.today, + }, + { + key: 'default-2', + label: t.whatCanTboxDo, + group: t.yesterday, + }, +]; + +const HOT_TOPICS = { + key: '1', + label: t.hotTopics, + children: [ + { + key: '1-1', + description: t.whatIsTbox, + icon: 1, + }, + { + key: '1-2', + description: t.whatCanTboxDo, + icon: 2, + }, + ], +}; + +const DESIGN_GUIDE = { + key: '2', + label: t.designGuide, + children: [ + { + key: '2-1', + icon: , + label: t.intent, + description: t.aiUnderstandsUserNeeds, + }, + { + key: '2-2', + icon: , + label: t.role, + description: t.aiPublicImage, + }, + ], +}; + +const SENDER_PROMPTS: GetProp = [ + { + key: '1', + description: t.dynamic, + icon: , + }, + { + key: '2', + description: t.component, + icon: , + }, + { + key: '3', + description: t.guide, + icon: , + }, + { + key: '4', + description: t.tutorial, + icon: , + }, +]; + +const useStyle = createStyles(({ token, css }) => { + return { + layout: css` + width: 100%; + min-width: 1000px; + height: 100vh; + display: flex; + background: ${token.colorBgContainer}; + font-family: AlibabaPuHuiTi, ${token.fontFamily}, sans-serif; + `, + // sider 样式 + sider: css` + background: ${token.colorBgLayout}80; + width: 280px; + height: 100%; + display: flex; + flex-direction: column; + padding: 0 12px; + box-sizing: border-box; + `, + logo: css` + display: flex; + align-items: center; + justify-content: start; + padding: 0 24px; + box-sizing: border-box; + gap: 8px; + margin: 24px 0; + + span { + font-weight: bold; + color: ${token.colorText}; + font-size: 16px; + } + `, + addBtn: css` + background: #1677ff0f; + border: 1px solid #1677ff34; + height: 40px; + `, + conversations: css` + flex: 1; + overflow-y: auto; + margin-top: 12px; + padding: 0; + + .ant-conversations-list { + padding-inline-start: 0; + } + `, + siderFooter: css` + border-top: 1px solid ${token.colorBorderSecondary}; + height: 40px; + display: flex; + align-items: center; + justify-content: space-between; + `, + // chat list 样式 + chat: css` + height: 100%; + width: 100%; + box-sizing: border-box; + display: flex; + flex-direction: column; + padding-block: ${token.paddingLG}px; + gap: 16px; + `, + chatPrompt: css` + .ant-prompts-label { + color: #000000e0 !important; + } + .ant-prompts-desc { + color: #000000a6 !important; + width: 100%; + } + .ant-prompts-icon { + color: #000000a6 !important; + } + `, + chatList: css` + flex: 1; + overflow: auto; + `, + loadingMessage: css` + background-image: linear-gradient(90deg, #ff6b23 0%, #af3cb8 31%, #53b6ff 89%); + background-size: 100% 2px; + background-repeat: no-repeat; + background-position: bottom; + `, + placeholder: css` + padding-top: 32px; + `, + // sender 样式 + sender: css` + width: 100%; + max-width: 700px; + margin: 0 auto; + `, + speechButton: css` + font-size: 18px; + color: ${token.colorText} !important; + `, + senderPrompt: css` + width: 100%; + max-width: 700px; + margin: 0 auto; + color: ${token.colorText}; + `, + }; +}); + +const Independent: React.FC = () => { + const { styles } = useStyle(); + const streamRef = useRef(null); // 存储 tbox stream 对象 + const abortControllerRef = useRef(null); // 存储 AbortController + + // ==================== State ==================== + const [messageHistory, setMessageHistory] = useState>({}); + + const [conversations, setConversations] = useState(DEFAULT_CONVERSATIONS_ITEMS); + const [curConversation, setCurConversation] = useState(DEFAULT_CONVERSATIONS_ITEMS[0].key); + + const [inputValue, setInputValue] = useState(''); + + /** + * 🔔 Please replace the BASE_URL, PATH, MODEL, API_KEY with your own values. + */ + + // ==================== Runtime ==================== + const [agent] = useXAgent({ + request: async ({ message }, { onUpdate, onSuccess, onError, onStream }) => { + const stream = tboxClient.chat({ + appId: 'your-app-id', // Replace with your app ID + query: message.content, + userId: 'antd-x', + }); + + streamRef.current = stream; + const abortController = new AbortController(); + const originalAbort = abortController.abort.bind(abortController); + abortController.abort = () => { + stream.abort(); + originalAbort(); + }; + onStream?.(abortController); + + const dataArr = [] as string[]; + + stream.on('data', (data) => { + let parsedPayload: { text?: string } | undefined; + try { + const payload = (data as any).data?.payload || '{}'; + parsedPayload = JSON.parse(payload); + } catch (e) { + console.error('Failed to parse payload:', e); + return; + } + + if (parsedPayload?.text) { + dataArr.push(parsedPayload.text); + onUpdate(parsedPayload.text); + } + }); + + stream.on('error', (error) => { + onError(error); + }); + + stream.on('end', () => { + onSuccess(dataArr); + }); + + stream.on('abort', () => { + onSuccess(dataArr); + }); + }, + }); + const loading = agent.isRequesting(); + + const { onRequest, messages, setMessages } = useXChat({ + agent, + requestPlaceholder: () => { + return { + content: t.loadingMessage, + role: 'assistant', + }; + }, + requestFallback: (_, { error }) => { + if (error.name === 'AbortError') { + return { + content: 'Request is aborted', + role: 'assistant', + }; + } + return { + content: 'Request failed, please try again!', + role: 'assistant', + }; + }, + transformMessage: (info) => { + const { originMessage, chunk } = info || {}; + if (!chunk) { + return { + content: originMessage?.content || '', + role: 'assistant', + }; + } + + const content = originMessage?.content || ''; + return { + content: content + chunk, + role: 'assistant', + }; + }, + resolveAbortController: (controller) => { + // 存储传入的 controller,这个已经包装了 stream.abort() 方法 + abortControllerRef.current = controller; + }, + }); + + // ==================== Event ==================== + const onSubmit = (val: string) => { + if (!val) return; + + if (loading) { + message.error('Request is in progress, please wait for the request to complete.'); + return; + } + + onRequest({ + stream: true, + message: { role: 'user', content: val }, + }); + }; + + const onFooterButtonClick = () => { + message.info(t.demoButtonNoFunction); + }; + + // ==================== Nodes ==================== + const chatSider = ( +
+ {/* 🌟 Logo */} +
+ logo + Ant Design X +
+ + {/* 🌟 添加会话 */} + + + {/* 🌟 会话管理 */} + { + if (agent.isRequesting()) { + message.error(t.requestInProgress); + return; + } + abortControllerRef.current?.abort(); + // The abort execution will trigger an asynchronous requestFallback, which may lead to timing issues. + // In future versions, the sessionId capability will be added to resolve this problem. + setTimeout(() => { + setCurConversation(val); + setMessages(messageHistory?.[val] || []); + }, 100); + }} + groupable + styles={{ item: { padding: '0 8px' } }} + menu={(conversation) => ({ + items: [ + { + label: t.rename, + key: 'rename', + icon: , + }, + { + label: t.delete, + key: 'delete', + icon: , + danger: true, + onClick: () => { + const newList = conversations.filter((item) => item.key !== conversation.key); + const newKey = newList?.[0]?.key; + setConversations(newList); + // The delete operation modifies curConversation and triggers onActiveChange, so it needs to be executed with a delay to ensure it overrides correctly at the end. + // This feature will be fixed in a future version. + setTimeout(() => { + if (conversation.key === curConversation) { + setCurConversation(newKey); + setMessages(messageHistory?.[newKey] || []); + } + }, 200); + }, + }, + ], + })} + /> + +
+ +
+
+ ); + const chatList = ( +
+ {messages?.length ? ( + /* 🌟 消息列表 */ + ({ + ...i.message, + classNames: { + content: i.status === 'loading' ? styles.loadingMessage : '', + }, + typing: i.status === 'loading' ? { suffix: <>💗 } : false, + }))} + style={{ height: '100%', paddingInline: 'calc(calc(100% - 700px) /2)' }} + roles={{ + assistant: { + placement: 'start', + footer: ( +
+
+ ), + loadingRender: () => , + }, + user: { placement: 'end' }, + }} + /> + ) : ( + + +
+ ); + const chatSender = ( + <> + {/* 🌟 提示词 */} + { + onSubmit(info.data.description as string); + }} + styles={{ + item: { padding: '6px 12px' }, + }} + className={styles.senderPrompt} + /> + {/* 🌟 输入框 */} + { + onSubmit(inputValue); + setInputValue(''); + }} + onChange={setInputValue} + onCancel={() => { + abortControllerRef.current?.abort(); + }} + loading={loading} + className={styles.sender} + actions={(_, info) => { + const { SendButton, LoadingButton } = info.components; + return ( + + {loading ? : } + + ); + }} + placeholder={t.askMeAnything} + /> + + ); + + useEffect(() => { + // history mock + if (messages?.length) { + setMessageHistory((prev) => ({ + ...prev, + [curConversation]: messages, + })); + } + }, [messages]); + + // ==================== Render ================= + return ( +
+ {chatSider} + +
+ {chatList} + {chatSender} +
+
+ ); +}; + +export default Independent; diff --git a/docs/playground/agent-tbox.zh-CN.md b/docs/playground/agent-tbox.zh-CN.md new file mode 100644 index 000000000..28dc16561 --- /dev/null +++ b/docs/playground/agent-tbox.zh-CN.md @@ -0,0 +1,10 @@ +--- +group: + title: 智能体样板间 + order: 1 +title: 百宝箱 +description: 百宝箱 X 智能体 +order: 0 +--- + + diff --git a/docs/playground/copilot.en-US.md b/docs/playground/copilot.en-US.md index eb601e744..485dd9f51 100644 --- a/docs/playground/copilot.en-US.md +++ b/docs/playground/copilot.en-US.md @@ -1,7 +1,7 @@ --- group: - title: Sample - order: 1 + title: Model Sample + order: 0 title: Copilot description: A sample room in copilot mode order: 1 diff --git a/docs/playground/copilot.zh-CN.md b/docs/playground/copilot.zh-CN.md index f775996f9..851c4ebec 100644 --- a/docs/playground/copilot.zh-CN.md +++ b/docs/playground/copilot.zh-CN.md @@ -1,6 +1,6 @@ --- group: - title: 样板间 + title: 模型样板间 order: 0 title: 助手式 order: 1 diff --git a/docs/playground/independent.en-US.md b/docs/playground/independent.en-US.md index 881e22617..7da9f58ec 100644 --- a/docs/playground/independent.en-US.md +++ b/docs/playground/independent.en-US.md @@ -1,6 +1,6 @@ --- group: - title: Sample + title: Model Sample order: 0 title: Independent description: Natural language is dominant. diff --git a/docs/playground/independent.zh-CN.md b/docs/playground/independent.zh-CN.md index 64b7d8375..2ece85b85 100644 --- a/docs/playground/independent.zh-CN.md +++ b/docs/playground/independent.zh-CN.md @@ -1,6 +1,6 @@ --- group: - title: 样板间 + title: 模型样板间 order: 0 title: 独立式 order: 0 diff --git a/docs/react/agent-use-tbox.en-US.md b/docs/react/agent-use-tbox.en-US.md new file mode 100644 index 000000000..2e9df3871 --- /dev/null +++ b/docs/react/agent-use-tbox.en-US.md @@ -0,0 +1,62 @@ +--- +group: + order: 2 + title: Agent Integration +title: Tbox +order: 1 +tag: Updated +--- + +This guide will introduce how to integrate the agent service provided by Tbox into an application built with Ant Design X. + +## Documentation + +- Tbox Open platform - [https://alipaytbox.yuque.com/sxs0ba/doc/tbox_open_overview](https://alipaytbox.yuque.com/sxs0ba/doc/tbox_open_overview) +- Tbox Open Token - [https://alipaytbox.yuque.com/sxs0ba/doc/tbox_open_token](https://alipaytbox.yuque.com/sxs0ba/doc/tbox_open_token) +- OpenAPI - [https://alipaytbox.yuque.com/sxs0ba/doc/tbox_openapi_overview](https://alipaytbox.yuque.com/sxs0ba/doc/tbox_openapi_overview) + +## Use Open API + +```tsx +import { TboxClient } from 'tbox-nodejs-sdk'; +import { useXAgent, useXChat, Sender, Bubble } from '@ant-design/x'; + +const tboxClient = new TboxClient({ + httpClientConfig: { + authorization: 'TBox-Token-xxx', // 替换真实 token + }, +}); + +const ChatDemo = () => { + const [agent] = useXAgent({ + request: async ({ message }, { onUpdate, onSuccess }) => { + const stream = tboxClient.chat({ + appId: '2025*****xxx', // 替换真实 AppID + query: message, + userId: '用户唯一标识', + }); + + let content = ''; + stream.on('data', (data) => { + content += JSON.stringify(data); + onUpdate(content); + }); + stream.on('end', () => onSuccess(content)); + }, + }); + + const { onRequest, messages } = useXChat({ agent }); + + return ( +
+ ({ + key: msg.id, + content: msg.message, + }))} + /> + +
+ ); +}; +``` diff --git a/docs/react/agent-use-tbox.zh-CN.md b/docs/react/agent-use-tbox.zh-CN.md new file mode 100644 index 000000000..866864b1a --- /dev/null +++ b/docs/react/agent-use-tbox.zh-CN.md @@ -0,0 +1,62 @@ +--- +group: + order: 2 + title: 智能体接入 +title: 百宝箱 +order: 1 +tag: Updated +--- + +这篇指南将介绍如何在使用 Ant Design X 搭建的应用中接入百宝箱智能体服务。 + +## 相关文档 + +- 百宝箱开放平台概述 - [https://alipaytbox.yuque.com/sxs0ba/doc/tbox_open_overview](https://alipaytbox.yuque.com/sxs0ba/doc/tbox_open_overview) +- 授权管理 - [https://alipaytbox.yuque.com/sxs0ba/doc/tbox_open_token](https://alipaytbox.yuque.com/sxs0ba/doc/tbox_open_token) +- OpenAPI - [https://alipaytbox.yuque.com/sxs0ba/doc/tbox_openapi_overview](https://alipaytbox.yuque.com/sxs0ba/doc/tbox_openapi_overview) + +## 使用 Open API + +```tsx +import { TboxClient } from 'tbox-nodejs-sdk'; +import { useXAgent, useXChat, Sender, Bubble } from '@ant-design/x'; + +const tboxClient = new TboxClient({ + httpClientConfig: { + authorization: 'TBox-Token-xxx', // 替换真实 token + }, +}); + +const ChatDemo = () => { + const [agent] = useXAgent({ + request: async ({ message }, { onUpdate, onSuccess }) => { + const stream = tboxClient.chat({ + appId: '2025*****xxx', // 替换真实 AppID + query: message, + userId: '用户唯一标识', + }); + + let content = ''; + stream.on('data', (data) => { + content += JSON.stringify(data); + onUpdate(content); + }); + stream.on('end', () => onSuccess(content)); + }, + }); + + const { onRequest, messages } = useXChat({ agent }); + + return ( +
+ ({ + key: msg.id, + content: msg.message, + }))} + /> + +
+ ); +}; +``` diff --git a/docs/react/contributing.en-US.md b/docs/react/contributing.en-US.md index b166b57da..b6071db2c 100644 --- a/docs/react/contributing.en-US.md +++ b/docs/react/contributing.en-US.md @@ -1,6 +1,7 @@ --- group: title: Other + order: 4 order: 1 title: Contributing --- diff --git a/docs/react/contributing.zh-CN.md b/docs/react/contributing.zh-CN.md index d67104228..f98da3b26 100644 --- a/docs/react/contributing.zh-CN.md +++ b/docs/react/contributing.zh-CN.md @@ -1,6 +1,7 @@ --- group: title: 其他 + order: 4 order: 1 title: 贡献指南 --- diff --git a/docs/react/dangerously-api-key.en-US.md b/docs/react/dangerously-api-key.en-US.md index 75bd0ee1f..34584fef2 100644 --- a/docs/react/dangerously-api-key.en-US.md +++ b/docs/react/dangerously-api-key.en-US.md @@ -1,6 +1,7 @@ --- group: title: Other + order: 4 order: 2 title: dangerouslyApiKey Explanation --- diff --git a/docs/react/dangerously-api-key.zh-CN.md b/docs/react/dangerously-api-key.zh-CN.md index 914aa39a8..2ee46dc34 100644 --- a/docs/react/dangerously-api-key.zh-CN.md +++ b/docs/react/dangerously-api-key.zh-CN.md @@ -1,12 +1,13 @@ --- group: title: 其他 + order: 4 order: 2 title: dangerouslyApiKey 说明 tag: New --- -:::warning +:::warning 请认真阅读,这很重要 !!! 我们在 `useXAgent` 、 `XRequest` 里提供了 `dangerouslyApiKey` 这里对其做一个详细的说明。 ::: diff --git a/docs/react/faq.en-US.md b/docs/react/faq.en-US.md index 78b7fee56..4eea745ea 100644 --- a/docs/react/faq.en-US.md +++ b/docs/react/faq.en-US.md @@ -1,6 +1,7 @@ --- group: title: Other + order: 4 order: 2 title: FAQ --- diff --git a/docs/react/faq.zh-CN.md b/docs/react/faq.zh-CN.md index 2869d71b7..873f76810 100644 --- a/docs/react/faq.zh-CN.md +++ b/docs/react/faq.zh-CN.md @@ -1,6 +1,7 @@ --- group: title: 其他 + order: 4 order: 2 title: FAQ --- diff --git a/docs/react/model-use-openai.en-US.md b/docs/react/model-use-openai.en-US.md index ad29bc8b5..833f8ea23 100644 --- a/docs/react/model-use-openai.en-US.md +++ b/docs/react/model-use-openai.en-US.md @@ -1,9 +1,9 @@ --- group: title: Model Integration + order: 1 title: OpenAI order: 0 -tag: Updated --- This guide will explain how to integrate OpenAI's model service into an application built using Ant Design X. diff --git a/docs/react/model-use-openai.zh-CN.md b/docs/react/model-use-openai.zh-CN.md index d1e73c718..a9bd8ee90 100644 --- a/docs/react/model-use-openai.zh-CN.md +++ b/docs/react/model-use-openai.zh-CN.md @@ -1,9 +1,9 @@ --- group: title: 模型接入 + order: 1 title: OpenAI order: 0 -tag: Updated --- 这篇指南将介绍如何在使用 Ant Design X 搭建的应用中接入 OpenAI 提供的模型服务。 diff --git a/docs/react/model-use-other.en-US.md b/docs/react/model-use-other.en-US.md index 1e8f202c8..5c07f51ea 100644 --- a/docs/react/model-use-other.en-US.md +++ b/docs/react/model-use-other.en-US.md @@ -1,6 +1,7 @@ --- group: title: Model Integration + order: 1 title: Others order: 2 --- @@ -17,9 +18,8 @@ To address this, **X** provides tools to help developers resolve protocol compat import { XStream } from '@ant-design/x'; async function request() { - const response = - await fetch(); - // ... + const response = await fetch(); + // ... // ..... for await (const chunk of XStream({ diff --git a/docs/react/model-use-other.zh-CN.md b/docs/react/model-use-other.zh-CN.md index e6d8f8d4a..6c873ec43 100644 --- a/docs/react/model-use-other.zh-CN.md +++ b/docs/react/model-use-other.zh-CN.md @@ -1,6 +1,7 @@ --- group: title: 模型接入 + order: 1 title: 其他 order: 2 --- @@ -17,9 +18,8 @@ order: 2 import { XStream } from '@ant-design/x'; async function request() { - const response = - await fetch(); - // ... + const response = await fetch(); + // ... // ..... for await (const chunk of XStream({ diff --git a/docs/react/model-use-qwen.en-US.md b/docs/react/model-use-qwen.en-US.md index 573e80f5e..2204ec51e 100644 --- a/docs/react/model-use-qwen.en-US.md +++ b/docs/react/model-use-qwen.en-US.md @@ -1,9 +1,9 @@ --- group: title: Model Integration + order: 1 title: Qwen order: 1 -tag: Updated --- This guide will introduce how to integrate the model service provided by Qwen into an application built with Ant Design X. diff --git a/docs/react/model-use-qwen.zh-CN.md b/docs/react/model-use-qwen.zh-CN.md index d61be9d33..3de130bdd 100644 --- a/docs/react/model-use-qwen.zh-CN.md +++ b/docs/react/model-use-qwen.zh-CN.md @@ -1,9 +1,9 @@ --- group: title: 模型接入 + order: 1 title: 通义千问 order: 1 -tag: Updated --- 这篇指南将介绍如何在使用 Ant Design X 搭建的应用中接入 Qwen 提供的模型服务。 diff --git a/docs/react/use-with-create-react-app.en-US.md b/docs/react/use-with-create-react-app.en-US.md index a84a659f0..0e0e7914c 100644 --- a/docs/react/use-with-create-react-app.en-US.md +++ b/docs/react/use-with-create-react-app.en-US.md @@ -1,6 +1,7 @@ --- group: title: Basic Usage + order: 3 order: 1 title: Usage with create-react-app --- diff --git a/docs/react/use-with-create-react-app.zh-CN.md b/docs/react/use-with-create-react-app.zh-CN.md index f5d175ca8..4e4a3214e 100644 --- a/docs/react/use-with-create-react-app.zh-CN.md +++ b/docs/react/use-with-create-react-app.zh-CN.md @@ -1,6 +1,7 @@ --- group: title: 如何使用 + order: 3 order: 1 title: 在 create-react-app 中使用 --- diff --git a/docs/react/use-with-next.en-US.md b/docs/react/use-with-next.en-US.md index c49a6941d..3d0853380 100644 --- a/docs/react/use-with-next.en-US.md +++ b/docs/react/use-with-next.en-US.md @@ -1,6 +1,7 @@ --- group: title: Basic Usage + order: 3 order: 3 title: Usage with Next.js --- diff --git a/docs/react/use-with-next.zh-CN.md b/docs/react/use-with-next.zh-CN.md index 0787a8ef6..d1b91d461 100644 --- a/docs/react/use-with-next.zh-CN.md +++ b/docs/react/use-with-next.zh-CN.md @@ -1,6 +1,7 @@ --- group: title: 如何使用 + order: 3 order: 3 title: 在 Next.js 中使用 --- diff --git a/docs/react/use-with-rsbuild.en-US.md b/docs/react/use-with-rsbuild.en-US.md index 496d56a1c..8365df3c6 100644 --- a/docs/react/use-with-rsbuild.en-US.md +++ b/docs/react/use-with-rsbuild.en-US.md @@ -1,6 +1,7 @@ --- group: title: Basic Usage + order: 3 order: 5 title: Usage with Rsbuild --- diff --git a/docs/react/use-with-rsbuild.zh-CN.md b/docs/react/use-with-rsbuild.zh-CN.md index 895f2f859..e7cf5f998 100644 --- a/docs/react/use-with-rsbuild.zh-CN.md +++ b/docs/react/use-with-rsbuild.zh-CN.md @@ -1,6 +1,7 @@ --- group: title: 如何使用 + order: 3 order: 5 title: 在 Rsbuild 中使用 --- diff --git a/docs/react/use-with-umi.en-US.md b/docs/react/use-with-umi.en-US.md index d1db7ffe5..01b501f8e 100644 --- a/docs/react/use-with-umi.en-US.md +++ b/docs/react/use-with-umi.en-US.md @@ -1,6 +1,7 @@ --- group: title: Basic Usage + order: 3 order: 4 title: Usage with Umi --- diff --git a/docs/react/use-with-umi.zh-CN.md b/docs/react/use-with-umi.zh-CN.md index 7b838cde2..cebf006d0 100644 --- a/docs/react/use-with-umi.zh-CN.md +++ b/docs/react/use-with-umi.zh-CN.md @@ -1,6 +1,7 @@ --- group: title: 如何使用 + order: 3 order: 4 title: 在 Umi 中使用 --- diff --git a/docs/react/use-with-vite.en-US.md b/docs/react/use-with-vite.en-US.md index 0eea85450..bae35e533 100644 --- a/docs/react/use-with-vite.en-US.md +++ b/docs/react/use-with-vite.en-US.md @@ -1,6 +1,7 @@ --- group: title: Basic Usage + order: 3 order: 2 title: Usage with Vite --- diff --git a/docs/react/use-with-vite.zh-CN.md b/docs/react/use-with-vite.zh-CN.md index edeac4af8..f24cc2d4b 100644 --- a/docs/react/use-with-vite.zh-CN.md +++ b/docs/react/use-with-vite.zh-CN.md @@ -1,6 +1,7 @@ --- group: title: 如何使用 + order: 3 order: 2 title: 在 Vite 中使用 --- diff --git a/package.json b/package.json index 5ef8ec908..37ae820f4 100644 --- a/package.json +++ b/package.json @@ -88,7 +88,8 @@ "@babel/runtime": "^7.25.6", "classnames": "^2.5.1", "rc-motion": "^2.9.2", - "rc-util": "^5.43.0" + "rc-util": "^5.43.0", + "tbox-nodejs-sdk": "^0.0.13" }, "devDependencies": { "@ant-design/tools": "^19.0.2",