### Install Dependencies and Run Dev Server Source: https://github.com/agentscope-ai/agentscope-spark-design/blob/main/packages/spark-chat/docs/documents/vite.en-US.md Navigate into the project directory, install dependencies, and start the development server. Access the application at http://localhost:5173/. ```bash $ cd spark-chat-demo $ npm install $ npm run dev ``` -------------------------------- ### Start the App Source: https://github.com/agentscope-ai/agentscope-spark-design/blob/main/packages/clawd-chat-ui/native/README.md Execute this command to start the Expo development server and run the application. ```bash npx expo start ``` -------------------------------- ### Install Dependencies Source: https://github.com/agentscope-ai/agentscope-spark-design/blob/main/packages/clawd-chat-ui/native/README.md Run this command in your terminal to install all necessary project dependencies. ```bash npm install ``` -------------------------------- ### Install Dependencies Source: https://github.com/agentscope-ai/agentscope-spark-design/blob/main/packages/clawd-chat-ui/README.md Install project dependencies for both the web and native subdirectories. ```bash cd web && npm install cd native && npm install ``` -------------------------------- ### Quick Start Chat Interface Source: https://github.com/agentscope-ai/agentscope-spark-design/blob/main/packages/spark-chat/llms/all.llms.txt Set up a basic chat interface using React components and the Agentscope design system. Ensure @agentscope-ai/design and @agentscope-ai/chat are installed. ```tsx import React from 'react'; import { DemoContextProvider } from './DemoContext'; import Chat from './Chat'; import { ConfigProvider, carbonTheme } from '@agentscope-ai/design'; export default function () { return
} ``` -------------------------------- ### Start Umi Development Server Source: https://github.com/agentscope-ai/agentscope-spark-design/blob/main/packages/spark-chat/llms/all.llms.txt Starts the Umi development server. Access the application via the provided local URL. ```bash npm run dev umi dev info - Umi v4.4.12 ╔════════════════════════════════════════════════════╗ ║ App listening at: ║ > Local: http://localhost:8000 ║ ready - ║ > Network: http://*********:8000 ║ ║ ║ ║ Now you can open browser with the above addresses↑ ╚════════════════════════════════════════════════════╝ ``` -------------------------------- ### Start spark-design Development Server Source: https://github.com/agentscope-ai/agentscope-spark-design/blob/main/README.md Run this command to start the development server specifically for the spark-design package. ```bash pnpm run start:spark-design ``` -------------------------------- ### Install Dependencies for Spark Design Source: https://github.com/agentscope-ai/agentscope-spark-design/blob/main/packages/spark-design/docs/guide/overview.en-US.md Install the necessary packages for Alibaba Cloud Spark Design, including Ant Design, Spark Icons, and Spark Design itself. This command is used for initial setup. ```bash npm install antd @agentscope-ai/icons @agentscope-ai/design --save ``` -------------------------------- ### Start Native Project and Run on Android Source: https://github.com/agentscope-ai/agentscope-spark-design/blob/main/packages/clawd-chat-ui/README.md Start the native project and run it on an Android device or emulator after building web assets. ```bash cd native npm run start npm run android ``` -------------------------------- ### FileIcon Example Source: https://github.com/agentscope-ai/agentscope-spark-design/blob/main/packages/spark-design/src/components/commonComponents/FileIcon/index.en-US.md Demonstrates the usage of the FileIcon component. This example shows how to render a file icon. ```typescript ``` -------------------------------- ### Start spark-chat Development Server Source: https://github.com/agentscope-ai/agentscope-spark-design/blob/main/README.md Run this command to start the development server specifically for the spark-chat package. ```bash pnpm run start:spark-chat ``` -------------------------------- ### Steps With Description Example Source: https://github.com/agentscope-ai/agentscope-spark-design/blob/main/packages/spark-design/src/components/commonComponents/Steps/index.en-US.md Shows how to include detailed descriptions for each step in the navigation. ```tsx import { Steps } from '@agentscope-ai/design'; const App = () => { return ( ); }; export default App; ``` -------------------------------- ### Install Spark Design Packages Source: https://github.com/agentscope-ai/agentscope-spark-design/blob/main/packages/spark-design/docs/guide/fromAntd.en-US.md Install the necessary packages for Spark Design and icons using npm. ```bash $ npm install @agentscope-ai/icons @agentscope-ai/design --save ``` -------------------------------- ### Install Agentscope Runtime WebUI Source: https://github.com/agentscope-ai/agentscope-spark-design/blob/main/packages/bailian-high-code-webui/README.md Run this command to install the necessary dependencies for the Agentscope Runtime WebUI. ```bash npm run install ``` -------------------------------- ### CLI Command Examples Source: https://github.com/agentscope-ai/agentscope-spark-design/blob/main/packages/spark-chat/README.md Examples of common commands for the agentscope-runtime-webui CLI, including specifying port, backend API URL, and authentication token. ```bash # Start with default configuration (port 3000) agentscope-runtime-webui # Specify port agentscope-runtime-webui --port 8080 # Specify backend API URL agentscope-runtime-webui --url http://api.example.com # Specify authentication token agentscope-runtime-webui --token your-auth-token # Combine options agentscope-runtime-webui -p 8080 -u http://api.example.com -t your-token ``` -------------------------------- ### Install @agentscope-ai/design and Ant Design Source: https://github.com/agentscope-ai/agentscope-spark-design/blob/main/packages/spark-design/README.md Install the Spark Design library and Ant Design using npm, pnpm, or yarn. ```bash # Using npm npm install @agentscope-ai/design antd --save # Using pnpm pnpm add @agentscope-ai/design antd # Using yarn yarn add @agentscope-ai/design antd ``` -------------------------------- ### Install and Run CLI Tool Source: https://github.com/agentscope-ai/agentscope-spark-design/blob/main/packages/spark-chat/README.md Install the Spark Chat CLI globally or use npx to run the web UI. The CLI tool helps in quickly setting up the chat environment. ```bash # Option 1: Install globally (recommended) npm install -g @agentscope-ai/chat agentscope-runtime-webui -p 3000 # Option 2: Use npx (no installation required) npx @agentscope-ai/chat agentscope-runtime-webui -p 3000 # Option 3: Local development (npm link first) npm link agentscope-runtime-webui -p 3000 ``` -------------------------------- ### Install Project Dependencies with pnpm Source: https://github.com/agentscope-ai/agentscope-spark-design/blob/main/README.md Use this command to install all project dependencies. pnpm is the recommended package manager. ```bash pnpm install ``` -------------------------------- ### Install Agentscope Packages Source: https://github.com/agentscope-ai/agentscope-spark-design/blob/main/packages/spark-chat/llms/all.llms.txt Install the necessary Agentscope packages using npm. Recommended for environments with poor network conditions. ```bash $ npm install antd --save $ npm install @agentscope-ai/design --save $ npm install @agentscope-ai/chat --save ``` -------------------------------- ### Basic Switch Example Source: https://github.com/agentscope-ai/agentscope-spark-design/blob/main/packages/spark-design/src/components/commonComponents/Switch/index.en-US.md Demonstrates the basic usage of the Switch component. Import it from '@agentscope-ai/design'. ```tsx import { Switch } from '@agentscope-ai/design' function App() { return ( ) } ``` -------------------------------- ### DeviceAction Demo Example Source: https://github.com/agentscope-ai/agentscope-spark-design/blob/main/packages/spark-chat/components/DeviceAction/index.en-US.md This example demonstrates the usage of the DeviceAction component in a demo environment. It requires the DeviceAction component to be imported. ```tsx import { DeviceAction } from '@agentscope-ai/chat' export default function Page() { return ( ) } ``` -------------------------------- ### TimePicker Basic Example Source: https://github.com/agentscope-ai/agentscope-spark-design/blob/main/packages/spark-design/src/components/commonComponents/TimePicker/index.en-US.md A basic example demonstrating the TimePicker component. Ensure the TimePicker component is imported before use. ```tsx import { TimePicker } from '@agentscope-ai/design' function App() { return ( ) } ``` -------------------------------- ### Install Spark Chat and Design Packages Source: https://github.com/agentscope-ai/agentscope-spark-design/blob/main/packages/spark-chat/docs/documents/overview.en-US.md Install the necessary packages for Spark Chat and Design using npm. For internal Alibaba developers, use tnpm. ```bash $ npm install antd --save $ npm install @agentscope-ai/design --save $ npm install @agentscope-ai/chat --save ``` ```bash tnpm install @ali/agentscope-ai-chat @ali/agentscope-ai-design --save ``` -------------------------------- ### Install Dependencies for Existing Projects Source: https://github.com/agentscope-ai/agentscope-spark-design/blob/main/packages/spark-chat/docs/documents/agentscope-runtime-webui.en-US.md Install AgentScope design and chat packages into your existing Vite, Next.js, or Umi project. ```bash $ npm install antd @agentscope-ai/design @agentscope-ai/chat --save ``` -------------------------------- ### Basic Input Example Source: https://github.com/agentscope-ai/agentscope-spark-design/blob/main/packages/spark-design/src/components/commonComponents/Input/index.en-US.md Demonstrates the basic usage of the Input component. ```tsx import { Input } from '@agentscope-ai/design' export default () => { return ( ) } ``` -------------------------------- ### Button Example Source: https://github.com/agentscope-ai/agentscope-spark-design/blob/main/packages/spark-design/src/components/commonComponents/Button/index.en-US.md Demonstrates a basic usage of the Button component. ```tsx import React from 'react'; import { Button } from '@agentscope-ai/design'; const App: React.FC = () => { return ( ); }; export default App; ``` -------------------------------- ### Basic Radio Example Source: https://github.com/agentscope-ai/agentscope-spark-design/blob/main/packages/spark-design/src/components/commonComponents/Radio/index.en-US.md Demonstrates the basic usage of the Radio component. Import it from '@agentscope-ai/design'. ```tsx import { Radio } from '@agentscope-ai/design' Example ``` -------------------------------- ### Basic IconButton Example Source: https://github.com/agentscope-ai/agentscope-spark-design/blob/main/packages/spark-design/src/components/commonComponents/IconButton/index.en-US.md Demonstrates the basic usage of the IconButton component. Import it from '@agentscope-ai/design'. ```tsx import { IconButton } from '@agentscope-ai/design' } /> ``` -------------------------------- ### Start Development Server Source: https://github.com/agentscope-ai/agentscope-spark-design/blob/main/packages/spark-chat/docs/documents/agentscope-runtime-webui.en-US.md Execute this command to launch the development server and access the WebUI in your browser. ```bash $ npm run dev ``` -------------------------------- ### HistoryPanel with Timestamp Source: https://github.com/agentscope-ai/agentscope-spark-design/blob/main/packages/spark-chat/components/Conversations/index.en-US.md Shows how to display timestamps within the HistoryPanel. This example builds upon the basic setup. ```tsx import { HistoryPanel, type Conversation, } from '@agentscope-ai/chat'; const conversations: Conversation[] = [ { id: '1', content: 'Hello!', sender: 'user', timestamp: new Date(), }, { id: '2', content: 'Hi there!', sender: 'ai', timestamp: new Date(), }, ]; function App() { return ; } export default App; ``` -------------------------------- ### Create Umi Project Source: https://github.com/agentscope-ai/agentscope-spark-design/blob/main/packages/spark-chat/llms/all.llms.txt Initializes a new Umi project. Select 'Simple App' for a basic setup. ```bash mkdir spark-chat-demo-umi cd spark-chat-demo-umi npm create umi ``` -------------------------------- ### Basic WelcomePrompts Example Source: https://github.com/agentscope-ai/agentscope-spark-design/blob/main/packages/spark-chat/components/WelcomePrompts/index.en-US.md Demonstrates the basic usage of the WelcomePrompts component. Ensure the WelcomePrompts component is imported from '@agentscope-ai/chat'. ```tsx import { WelcomePrompts, type IWelcomePromptsProps } from '@agentscope-ai/chat'; const App = (props: IWelcomePromptsProps) => { return ; }; export default App; ``` -------------------------------- ### Create and Initialize Umi Project Source: https://github.com/agentscope-ai/agentscope-spark-design/blob/main/packages/spark-chat/docs/documents/umi.en-US.md Use these commands to create a new Umi project and install necessary dependencies. ```bash mkdir spark-chat-demo-umi cd spark-chat-demo-umi npm create umi ``` ```bash npm install antd @agentscope-ai/design @agentscope-ai/chat --save ``` ```bash npm run dev umi dev info - Umi v4.4.12 ╔════════════════════════════════════════════════════╗ ║ App listening at: ║ ║ > Local: http://localhost:8000 ║ ready - ║ > Network: http://*********:8000 ║ ║ ║ ║ Now you can open browser with the above addresses↑ ╚════════════════════════════════════════════════════╝ ``` -------------------------------- ### AgentScope Runtime WebUI Demo Source: https://github.com/agentscope-ai/agentscope-spark-design/blob/main/packages/spark-chat/docs/documents/agentscope.en-US.md Use this component to debug and experience your developed AgentScope agents directly in the online WebUI. Configure the URL of your agent to get started. ```typescript import React from "react"; import { AgentScopeRuntimeWebUI, IAgentScopeRuntimeWebUIOptions, } from "@agentscope/react-agentscope-runtime-webui"; const App = () => { const options: IAgentScopeRuntimeWebUIOptions = { // Configuration options for the AgentScopeRuntimeWebUI // Example: setting a specific agent URL // agentUrl: "http://your-agent-url.com", }; return ( ); }; export default App; ``` -------------------------------- ### Reset Project Source: https://github.com/agentscope-ai/agentscope-spark-design/blob/main/packages/clawd-chat-ui/native/README.md Use this command to reset the project to its initial state, moving starter code to 'app-example' and creating a blank 'app' directory for new development. ```bash npm run reset-project ``` -------------------------------- ### Start Web Development Server Source: https://github.com/agentscope-ai/agentscope-spark-design/blob/main/packages/clawd-chat-ui/README.md Run the web development server to modify the UI or business logic. ```bash cd web npm run dev ``` -------------------------------- ### Message Component Example Source: https://github.com/agentscope-ai/agentscope-spark-design/blob/main/packages/spark-design/src/components/commonComponents/Message/index.en-US.md Basic example demonstrating the usage of the Message component. ```tsx import { Message } from '@agentscope-ai/design' // Example usage Example ``` -------------------------------- ### Skeleton Example Source: https://github.com/agentscope-ai/agentscope-spark-design/blob/main/packages/spark-design/src/components/commonComponents/Skeleton/index.en-US.md This is a basic example of how to use the Skeleton component. It displays a placeholder for content. ```tsx import { Skeleton } from '@agentscope-ai/design' ``` -------------------------------- ### Basic Spinner Example Source: https://github.com/agentscope-ai/agentscope-spark-design/blob/main/packages/spark-design/src/components/commonComponents/Spinner/index.en-US.md A simple example of how to use the Spinner component to indicate a loading state. ```tsx import { Spinner } from '@agentscope-ai/design'; function App() { return ( Example ); } ``` -------------------------------- ### Select Npm Client Source: https://github.com/agentscope-ai/agentscope-spark-design/blob/main/packages/spark-chat/llms/all.llms.txt Choose your preferred npm client. 'npm' is a common choice. ```bash ? Pick Npm Client › - Use arrow-keys. Return to submit. npm cnpm tnpm yarn pnpm ``` -------------------------------- ### Basic Pagination Example Source: https://github.com/agentscope-ai/agentscope-spark-design/blob/main/packages/spark-design/src/components/commonComponents/Pagination/index.en-US.md Demonstrates a basic implementation of the Pagination component. Import the Pagination component from '@agentscope-ai/design'. ```tsx import { Pagination } from '@agentscope-ai/design'; function App() { return ( ); } ``` -------------------------------- ### Install Agentscope AI Design Source: https://github.com/agentscope-ai/agentscope-spark-design/blob/main/packages/spark-design/docs/guide/start/fromBailianUI.md Install the new Agentscope AI Design package and save it as a dependency. ```shell tnpm install @ali/agentscope-ai-design --save ``` -------------------------------- ### Install Spark Design Source: https://github.com/agentscope-ai/agentscope-spark-design/blob/main/packages/spark-design/docs/guide/fromScratch.en-US.md Install the necessary packages for Spark Design, including Ant Design and its icons. ```bash $ npm install antd @agentscope-ai/icons @agentscope-ai/design --save ``` -------------------------------- ### Basic Steps Example Source: https://github.com/agentscope-ai/agentscope-spark-design/blob/main/packages/spark-design/src/components/commonComponents/Steps/index.en-US.md Demonstrates the fundamental usage of the Steps component for a simple navigation flow. ```tsx import { Steps } from '@agentscope-ai/design'; const App = () => { return ( ); }; export default App; ``` -------------------------------- ### Audio Component Example Source: https://github.com/agentscope-ai/agentscope-spark-design/blob/main/packages/spark-design/src/components/commonComponents/Audio/index.en-US.md Demonstrates how to use the Audio component. Ensure the Audio component is imported from '@agentscope-ai/design'. ```tsx import { Audio } from '@agentscope-ai/design'