Skip to content

Repository files navigation

TinyRobot

OpenTiny Logo

npm versionLicense: MIT

TinyRobot is an AI component library built for Vue 3, following the OpenTiny Design system. It provides rich AI interaction components to help developers quickly build enterprise-level AI applications.

✨ Features

  • 🤖 Rich AI Components: Comprehensive set of AI interaction components including chat bubbles, message input, conversation management, and more
  • 🎨 OpenTiny Design: Follows OpenTiny Design system for consistent UI/UX
  • 🚀 Out of the Box: Get started in minutes with minimal configuration
  • 🎯 TypeScript Support: Full TypeScript support with complete type definitions
  • 🌈 Theme Customization: Flexible theme system supporting multiple themes and custom styles
  • 📦 Tree Shaking: Optimized for tree shaking, import only what you need
  • 🔄 Streaming Support: Built-in support for streaming AI responses
  • 💾 Storage Strategy: Flexible storage strategies (LocalStorage, IndexedDB, custom)

English | 简体中文

Ask DeepWiki

📦 Packages

TinyRobot is a monorepo containing the following packages:

PackageDescriptionVersion
@opentiny/tiny-robotCore component library with all AI interaction componentsnpm
@opentiny/tiny-robot-kitUtility functions and AI client tools for model interactionsnpm
@opentiny/tiny-robot-svgsSVG icon library with all component iconsnpm

🚀 Quick Start

Prerequisites

  • Node.js >= 20.13.0
  • Vue >= 3.2.0
  • Package manager: npm, yarn, or pnpm

Installation

Core package@opentiny/tiny-robot is the main package.

# Using pnpm (recommended)
pnpm add @opentiny/tiny-robot
# Using npm
npm install @opentiny/tiny-robot
# Using yarn
yarn add @opentiny/tiny-robot

Optional packages:

  • @opentiny/tiny-robot-kit — Only needed if you use AI model request or data-processing features. Add it when required:

    pnpm add @opentiny/tiny-robot-kit
  • @opentiny/tiny-robot-svgs — Optional. Install separately only if you need to use the SVG icon library standalone or with custom icons:

    pnpm add @opentiny/tiny-robot-svgs

Basic Usage

1. Import Styles

In your main.js or main.ts:

import{createApp}from'vue'importAppfrom'./App.vue'import'@opentiny/tiny-robot/dist/style.css'constapp=createApp(App)app.mount('#app')

2. Use Components

<template>
<divclass="chat-container">
<tr-bubblerole="ai"content="Hello! I'm TinyRobot, an AI component library for Vue 3."placement="start" />
<tr-bubblerole="user"content="That's great! How can I get started?"placement="end" />
</div>
</template>
<script setup>import { TrBubble } from'@opentiny/tiny-robot'</script>

📚 Documentation

🏗️ Project Structure

tiny-robot/
├── packages/
│ ├── components/ # Core component library
│ │ ├── src/
│ │ │ ├── bubble/ # Chat bubble components
│ │ │ ├── sender/ # Message input component
│ │ │ ├── container/ # Container component
│ │ │ ├── history/ # Conversation history
│ │ │ ├── attachments/ # File attachments
│ │ │ └── ... # Other components
│ │ └── package.json
│ ├── kit/ # Utility functions and AI tools
│ │ ├── src/
│ │ │ ├── providers/ # AI provider implementations
│ │ │ ├── vue/ # Vue composables
│ │ │ │ ├── message/ # useMessage composable
│ │ │ │ └── conversation/ # useConversation composable
│ │ │ └── storage/ # Storage utilities
│ │ └── package.json
│ ├── svgs/ # SVG icon library
│ ├── playground/ # Development playground
│ └── test/ # Test suite
├── docs/ # Documentation site
│ ├── src/ # Documentation source
│ └── demos/ # Component demos
├── scripts/ # Build and utility scripts
└── package.json

🛠️ Development

Setup

# Install dependencies
pnpm install
# Start development server (playground + docs)
pnpm dev

Development Workflow

  1. Start Development Server:

    • Run pnpm dev in the project root directory
    • This starts both the playground and documentation site
    • After modifying components in packages/components/src/, changes will be automatically reflected in the documentation page
  2. Documentation:

    • Documentation source: docs/src/
    • Component demos: docs/demos/
  3. Testing:

    • Run pnpm test to execute tests

📄 License

MIT License - see LICENSE file for details.

🤝 Contributing

Contributions are welcome! Please read our Contributing Guide to understand the recommended workflow, commit message conventions, and how to submit Issues and Pull Requests.

📞 Support

🙏 Acknowledgments

Built with ❤️ by the OpenTiny team.


Note: This project is part of the OpenTiny ecosystem.

About

TinyRobot 是一个 AI 对话组件库,提供了丰富的 AI 交互组件,助力开发者快速构建企业级 AI 应用 / TinyRobot is an AI conversational component library that offers a rich set of AI interaction components, empowering developers to quickly build enterprise-level AI applications.

Topics

Resources

Contributing

Stars

91 stars

Watchers

8 watching

Forks

Releases

Packages

Used by

Contributors

Languages