TinyRobot v1.0 Ships a Complete Vue 3 AI Chat Suite with Tool Approval Built In
TinyRobot is an open-source Vue 3 AI component library and application development kit from the OpenTiny community, helping developers quickly build intelligent conversational applications and business assistants.
Recently, TinyRobot v1.0 was officially released! 🎉
• Open source address: https://github.com/opentiny/tiny-robot (Star ⭐ welcome) • Official website: https://opentiny.design/tiny-robot
Previously we launched TinyRobot Skills to help developers quickly build AI conversational applications with Vue 3. Now we have gone a step further, wrapping the complete chat page as an independent Chat kit, and adding a model selector, unified extension panel, and tool-call confirmation—you can directly use the kit's combined chat flow, or choose components and tools as needed to integrate into existing business.
The v1.0 release mainly introduces the following new features:
- New TrChat chat suite: a ready-to-use complete chat page
- New model selector: supports flexible switching and extension of models
- New unified extension panel: pluggable AI capabilities
- New tool-call confirmation: makes Agent execution safer and more controllable
- New conversation management capability: supports multi-turn conversation persistence
This article will break down TinyRobot v1.0's technical architecture and new features in order.
1. TinyRobot Architecture Overview
TinyRobot's parts can be combined according to project needs: use the Chat suite to build a complete chat page, or select interface components and conversation tools individually to integrate into existing projects.
- Complete Chat Suite (
@opentiny/tiny-robot-chat): Combines the chat interface and conversation logic into a configurable, complete chat page, suitable for building chat applications or adding an assistant to business pages. - UI Components (
@opentiny/tiny-robot): When you already have a page design, you can select and combine chat interaction components as needed; the page structure is arranged by the application. - Session and Model Request Kit (
@opentiny/tiny-robot-kit): Manages conversation state, model requests, and extension calls; it can also work independently with a custom interface. - Engineering Tool CLI (
@opentiny/tiny-robot-cli): Creates example projects for trial, and can generate chat modules in existing Vue projects to help integrate Chat.
For Vue projects, integrating TinyRobot also brings these advantages:
- Use familiar development methods. Components and Chat are based on Vue 3 and TypeScript, and the interface can be customized through props, events, and slots; Kit organizes conversation and request logic through composables. The interface follows the OpenTiny Design system, and can adapt brand appearance and light/dark modes through CSS variables and theme configuration.
- Quickly integrate into existing business. You can add Components or the Chat interface into existing pages as needed, retaining the application's original conversation and sending logic; model requests, conversation storage, and tool calls can be connected to your own services through the Chat suite or the standalone Kit. Business authentication, file upload, and specific business operations are implemented by the application.
Next, we start with the Chat suite's integration methods, then look at how model selection, extension management, and tool-call confirmation work with the chat flow.
2. New Features in TinyRobot v1.0
1. TrChat Chat Suite: Quickly Build an AI Chat Application
In a chat page built with Chat, users can switch conversations, continue asking, and view streaming replies; with the application's attachment handling, they can also send image messages. v1.0 integrates these interactions into the independent @opentiny/tiny-robot-chat package, providing the complete chat page TrChat and the standalone chat interface TrChatUI.
Image upload is handled by the application, and the model used must support image input.
To make the chat interface adapt to different conversation and model request logic, TrChat introduces a Runtime. It uniformly provides the conversation, message, and input state needed by the interface, as well as operations such as sending, canceling, and switching conversations. When using TrChatUI standalone, the application supplies the data directly and receives user operations through events.
Both TrChat and TrChatUI can configure the layout and input area via the ui option. For example, ui.sender.toolbar can reorder or hide the model selector and MCP entry, and can also add the application's own buttons.
How to Integrate
You can choose the corresponding usage based on the source of your project's conversation and request logic:
- Use the suite's conversation and request logic: Use
TrChat+useChatRuntime, starting from the model service configuration to build the chat page. - Keep your own conversation and send logic: Use
TrChatUI, where the application provides interface data and handles submission. - Keep an existing Kit conversation: Use
TrChat+useChatRuntimeFromConversationto adapt an existing conversation to the complete chat page.
For manual integration, install Chat and the base components in an existing project.
pnpm add @opentiny/[email protected] @opentiny/[email protected]
Method 1: Use the suite's conversation and request logic
First, build a text-only chat page. Put the example in App.vue, fill in the model ID and a browser-accessible endpoint, and you can send text and view streaming replies.
The endpoint must be compatible with OpenAI's /chat/completions and support streaming responses. If a key is needed, use a backend forwarding address and let the server handle authentication.
<script setup lang="ts">
import { TrChat, useChatRuntime } from '@opentiny/tiny-robot-chat'
import '@opentiny/tiny-robot/dist/style.css'
import '@opentiny/tiny-robot-chat/dist/style.css'
const runtime = useChatRuntime({
modelProviders: [
{
type: 'openai',
apiUrl: 'https://your-service.example.com/v1/chat/completions',
models: [{ id: 'your-model-id', label: '应用助手' }],
},
],
})
</script>
<template>
<TrChat :runtime="runtime" />
</template>
Method 2: Keep your own conversation and send logic
If you already have your own conversation and send logic, you can keep using it to integrate the chat interface. TrChatUI is responsible for displaying messages; input and submission are still handled by the application.
Use the same two packages and put the following example in App.vue. The application holds the input draft and message list, and passes messages to TrChatUI through chatViewData for display. After clicking send, the application's handleAppSubmit updates the messages and clears the input. The example uses local mock replies; when integrating into real business, you can call your own endpoint here.
<script setup lang="ts">
import { computed, ref } from 'vue'
import { TrChatUI, type ChatMessageItem, type ChatUIData } from '@opentiny/tiny-robot-chat'
import '@opentiny/tiny-robot/dist/style.css'
import '@opentiny/tiny-robot-chat/dist/style.css'
// Keep the business's original draft and message list; use local state for demo.
const appDraft = ref('')
const appMessages = ref<ChatMessageItem[]>([])
// Add interface adaptation: convert business data to TrChatUI format; conversation info is demo only.
const chatViewData = computed<ChatUIData>(() => ({
conversation: { activeId: 'demo', title: '应用助手' },
bubble: { messages: appMessages.value },
}))
function handleAppSubmit({ text }: { text: string }) {
if (!text.trim()) return
appMessages.value.push({ role: 'user', content: text }, { role: 'assistant', content: `已收到:${text}` })
appDraft.value = ''
}
</script>
<template>
<TrChatUI :data="chatViewData" v-model:input-value="appDraft" @submit="handleAppSubmit" />
</template>
Method 3: Reuse an existing Kit conversation
If your project already manages conversations with Kit, you can keep using the existing model request and conversation configuration. Pass the return value of the existing useConversation call to useChatRuntimeFromConversation, then pass the Runtime to TrChat to integrate the complete chat page.
<script setup lang="ts">
import { TrChat, useChatRuntimeFromConversation } from '@opentiny/tiny-robot-chat'
import '@opentiny/tiny-robot/dist/style.css'
import '@opentiny/tiny-robot-chat/dist/style.css'
// appConversation is the return value of the business's existing useConversation
const runtime = useChatRuntimeFromConversation({ conversation: appConversation })
</script>
<template>
<TrChat :runtime="runtime" />
</template>
Full documentation for interface configuration and data integration is in the v1.0 Chat integration doc.
Support for Long-Conversation Navigation
When a conversation gets long, a message outline can help you find previous questions. Click a question to jump back to the corresponding message; the outline also highlights the current item when you manually scroll.
The message outline reuses the Anchor component's navigation capability, and v1.0 integrates it into Chat. The outline is off by default; enable it via ui.anchor, and it will be generated from user messages. By default it shows when the viewport width reaches 768px.
<TrChat :runtime="runtime" :ui="{ anchor: {} }" />
Support for Chat Floating Window
In workbenches or business pages, you can open the chat page as a floating window, allowing users to view business content and converse with the assistant simultaneously. v1.0 brings Layout's existing floating-window capability into Chat. When dragging or resizing, the conversation list, message area, and input box move or resize together with the window.
Both TrChat and TrChatUI configure the display mode through ui.layout.surface. The floating window is draggable by default; setting resizable: true also allows dragging the window's edges to resize.
<TrChat
:runtime="runtime"
:ui="{ layout: { surface: { mode: 'floating', floatingOptions: { resizable: true } } } }"
/>
2. Model Selector: Switching and Settings in One Place
After configuring multiple models for an assistant, users can browse, search, and switch between them in the same panel, and adjust available settings like thinking intensity and web search. The new model selector in v1.0 is integrated into Chat and can also be used standalone in your own interface.
When using Chat, configure models in modelProviders and declare adjustable settings with features; the built-in selector then appears in the input area. Continuing the previous text-chat example, replace the runtime creation part with the following configuration; fill in real values for the Alibaba Bailian backend proxy address and model ID, with authentication handled by the backend.
const runtime = useChatRuntime({
modelProviders: [{
type: 'qwen',
apiUrl: 'https://your-service.example.com/v1/chat/completions',
models: [{
id: 'your-model-id',
label: '联网助手',
features: [{ key: 'search', label: '联网搜索', type: 'switch' }],
}],
}],
})
The Runtime maps settings to request parameters according to the model service preset; the qwen preset above maps search to enable_search in the request. When a service uses different parameter conventions, you can override the mapping with mapFeatureValues in the model configuration. The actual available functionality still depends on the model service.
If you only need the selection interface, you can use TrModelSelector standalone. The example below lets you browse and search models, and adjust thinking intensity for a 'reasoning assistant'; it only demonstrates selection and result display, without invoking a model service.
<script setup lang="ts">
import { ref } from 'vue'
import { TrModelSelector, type ModelSelectorOption, type ModelSelectorSnapshot } from '@opentiny/tiny-robot'
import '@opentiny/tiny-robot/dist/style.css'
const selection = ref<ModelSelectorSnapshot>()
const models: ModelSelectorOption[] = [
{ id: 'general', label: '通用助手', group: '通用模型' },
{
id: 'reasoner',
label: '推理助手',
group: '推理模型',
features: [{
key: 'reasoning',
label: '思考强度',
type: 'select',
options: [{ value: 'balanced', label: '均衡' }, { value: 'deep', label: '深度' }],
}],
},
]
function handleChange(current: ModelSelectorSnapshot) {
selection.value = current
}
</script>
<template>
<TrModelSelector
default-value="general"
:models="models"
searchable
:close-on-select="false"
@change="handleChange"
/>
<p v-if="selection">{{ selection.modelId }} · {{ selection.featureValues.reasoning }}</p>
</template>
In this example, group determines grouping, features declares setting items; the change event provides the current selection, and the application displays the model ID and settings below the selector. When connecting to a real service, model requests and parameter conversion are still handled by the application.
3. Extension Panel: Unified Entry for Tools and Skills
When an assistant integrates multiple tools and skills, a unified extension panel lets users view and manage them from one entry. v1.0 adds this panel, consolidating MCP services, Skills, and the application's own extensions, and adds supporting interfaces for skill import, details, and more.
When using Chat, configure existing services in mcpServers; the default adapter handles installation state management, start/stop, tool discovery, and invocation. Replace the runtime creation part in the earlier text-chat example with the following configuration. Fill in real values for the model proxy address, model ID, and tool address; model authentication is handled by the backend, and the tool service must support Streamable HTTP and be accessible from a browser.
const runtime = useChatRuntime({
modelProviders: [{
type: 'openai',
apiUrl: 'https://your-service.example.com/v1/chat/completions',
models: [{ id: 'your-model-id', label: '项目助手' }],
}],
mcpServers: [{
id: 'project-tools',
name: '项目工具',
baseUrl: 'https://your-service.example.com/mcp/project-tools',
// installed: true, // Load tools at initialization; still need to enable manually; default false
}],
})
The panel groups by installation status installed into installed and installable groups, and supports search and tag filtering.
Skills or business tool pages can be added to Chat through ui.extensions.tabs. Continue with the same runtime above; businessTabs is an array of tabs provided by the application (IDs cannot use the reserved mcp), and handleBusinessAction is the function that processes actions and updates entries:
<TrChat
:runtime="runtime"
:ui="{ extensions: { tabs: businessTabs } }"
@extension-action="handleBusinessAction"
/>
Custom tab actions are returned to the application via extension-action. Kit can load, store, and use Skills in conversations; the application is responsible for connecting management entries to these flows.
If you only need the management interface, you can use TrExtensionManager standalone. Clicking actions like 'Install' triggers an action event, and the application executes and updates the entry. The example below simulates installation status changes with a 'Schedule Assistant' without connecting to a real service.
<script setup lang="ts">
import { reactive } from 'vue'
import { TrExtensionManager, type ExtensionManagerActionEvent, type ExtensionManagerTab } from '@opentiny/tiny-robot'
import '@opentiny/tiny-robot/dist/style.css'
const calendar = reactive<ExtensionManagerTab['items'][number]>({
id: 'calendar',
name: '日程助手',
installed: false,
actions: [{ id: 'install', type: 'button', label: '安装' }],
})
const tabs = [{ id: 'mcp', label: 'MCP', items: [calendar] }]
function handleAction({ action }: ExtensionManagerActionEvent) {
if (action.id !== 'install') return
calendar.installed = true
calendar.actions = []
}
</script>
<template>
<TrExtensionManager :tabs="tabs" @action="handleAction" />
</template>
4. Tool-Call Confirmation: Let Users Decide Whether to Execute
When an assistant needs to save content or modify business data, the application can ask the user to confirm first. v1.0 adds pause, resume, and reject operations on top of Kit's existing tool-call capability. Users choose 'Allow' or 'Deny' on the conversation card to decide whether that tool call continues; after saving the pending confirmation state and original conversation messages, users can continue confirming after a page refresh.
Below, using Kit's tool-call plugin toolPlugin as an example, configure shouldPauseToolCall so that the 'Save Weekly Report' tool waits for confirmation before executing.
toolPlugin({
getTools,
callTool,
shouldPauseToolCall: (call) => call.function.name === 'save_report',
})
After the user clicks 'Allow' or 'Deny', the application passes the result to the current conversation, continuing or rejecting the corresponding tool call.
Complete Runnable ExampleThis example requires configuring a conversation storage strategy. You can specify it via the
storageproperty ofuseConversationand setautoSaveMessagestotrueto automatically save the paused state and messages. After refreshing, reopen the original conversation to continue confirming.
Install Kit in a project that already has Chat and base components.
pnpm add @opentiny/[email protected]
Put the following code in App.vue, type 'Save weekly report' and send it to try the confirmation card. The example uses a local mock; conversation data is stored in browser local storage. If the data is still there, you can reopen the pending conversation from the conversation list after refreshing.
<script setup lang="ts">
import { TrChat, useChatRuntimeFromConversation, type ChatBubbleEventPayload } from '@opentiny/tiny-robot-chat'
import {
localStorageStrategyFactory,
TOOL_REJECT_COMMAND,
TOOL_RESUME_COMMAND,
toolPlugin,
useConversation,
type ResponseProvider,
} from '@opentiny/tiny-robot-kit'
import '@opentiny/tiny-robot/dist/style.css'
import '@opentiny/tiny-robot-chat/dist/style.css'
const tool = {
type: 'function' as const,
function: { name: 'save_report', description: '保存周报', parameters: { type: 'object', properties: {} } },
}
const saved = '周报已保存到演示工作区。'
const responseProvider: ResponseProvider = async ({ messages }) => {
const last = messages.at(-1)
const id = crypto.randomUUID()
const hasResult = last?.role === 'tool'
return {
id,
object: 'chat.completion',
created: 0,
model: 'local-demo',
system_fingerprint: null,
choices: [{
index: 0,
delta: undefined,
logprobs: null,
finish_reason: hasResult ? 'stop' : 'tool_calls',
message: hasResult
? { role: 'assistant', content: last.content === saved ? saved : '已取消保存。' }
: {
role: 'assistant',
content: '周报已整理好,请确认是否保存。',
tool_calls: [{ id, index: 0, type: 'function', function: { name: tool.function.name, arguments: '{}' } }],
},
}],
}
}
const conversation = useConversation({
storage: localStorageStrategyFactory({ key: 'chat-tool-approval' }),
autoSaveMessages: true,
useMessageOptions: {
responseProvider,
plugins: [toolPlugin({
getTools: () => [tool],
callTool: async () => saved,
shouldPauseToolCall: (call) => call.function.name === tool.function.name,
})],
},
})
const runtime = useChatRuntimeFromConversation({ conversation })
async function handleBubbleEvent({ name, payload }: ChatBubbleEventPayload) {
if (name !== 'tool-call:resume' && name !== 'tool-call:reject') return
if (!payload || typeof payload !== 'object' || !('toolCallId' in payload)) return
const { toolCallId } = payload
if (typeof toolCallId !== 'string' || !toolCallId) return
const command = name === 'tool-call:resume' ? TOOL_RESUME_COMMAND : TOOL_REJECT_COMMAND
await conversation.activeConversation.value?.engine.dispatchCommand(command, { toolCallId })
}
</script>
<template>
<TrChat :runtime="runtime" @bubble-event="handleBubbleEvent" />
</template>
5. Multi-line Input First-line Hint
When the same input box is used for multiple tasks, a first-line label can remind users whether they are drafting a 'customer reply' or generating a 'handoff summary'. v1.0 adds the input-prefix slot to Sender, allowing custom content like labels to be displayed on the first line of the multi-line input box. The application updates the task label and keeps the original input state, so users can continue editing the body text they have already typed.
The slot only occupies the first line; after a line break, the body text starts from the left of the input area. The following example has the application save the task and draft separately, keep the draft when switching tasks, and record both the selected task and the body text on submission.
View task switching and submission example<script setup lang="ts">
import { ref } from 'vue'
import { TrSender } from '@opentiny/tiny-robot'
import '@opentiny/tiny-robot/dist/style.css'
const labels = { reply: '客户回复', handoff: '交接摘要' }
type Task = keyof typeof labels
const task = ref<Task | null>(null)
const draft = ref('')
const submitted = ref<{ task: Task; text: string } | null>(null)
function submit(text: string) {
if (!task.value) return
submitted.value = { task: task.value, text }
draft.value = ''
}
</script>
<template>
<button type="button" @click="task = 'reply'">起草客户回复</button>
<button type="button" @click="task = 'handoff'">生成交接摘要</button>
<TrSender v-model="draft" mode="multiple" submit-type="ctrlEnter" :disabled="!task" @submit="submit">
<template v-if="task" #input-prefix><span>{{ labels[task] }}</span></template>
</TrSender>
<p v-if="submitted">已提交 · {{ labels[submitted.task] }} · {{ submitted.text }}</p>
</template>
3. Other Updates and Upgrade Notes
New Capabilities
- Sender template dropdown menu can specify a mount container via
templateOptions.appendTo, for example an input panel inside a modal. by @SonyLeo in #394 - TrChat lets the application prefill prompts, clear input text, or move focus to the input box. by @SonyLeo in #464
- Kit can limit the number of tool-call batches in a single user turn with
maxToolRounds; a single batch can contain multiple tool calls. by @gene9831 in #406
Bug Fixes
- Sender fixes lost characters during Chinese IME composition input, and loss of mention data when both templates and @ mentions are enabled. by @SonyLeo in #472 #482
- TrChat fixes the issue where messages with only attachments could not be submitted. by @SonyLeo in #485
- BubbleList fixes the issue where, after enabling auto-scroll, the message area did not continue auto-scrolling to the bottom when images and other content load lazily. by @gene9831 in #421
- Layout fixes the issue where the drawer sidebar was clipped on narrow screens. by @gene9831 in #489
Upgrade Notes
Before upgrading an existing project to v1.0, note the following integration changes:
McpServerPickerandContainerare deprecated. Existing code still works; new integrations should useExtensionManagerandLayout.- The CLI's
add chatoutput structure changes tosrc/tiny-robot-chat/directory, with chat components, configuration, and styles concentrated in that module. Existing integrations need to check import paths and verify style imports and environment configuration against the generated README. v1.0 also adds change preview and runtime version options, so you can confirm the integration scope before generation.
For a full list of changes, see the changelog.
4. Quick Start
To quickly experience the chat flow, use the CLI to create an example project. Environment requirements: Vue 3.3+, Node.js 22.12+, pnpm recommended.
pnpm dlx @opentiny/[email protected] create my-chat
cd my-chat
cp .env.example .env.local
# Edit .env.local and fill in the test key for the model service you use:
# Alibaba Bailian: VITE_ALIYUN_DASHSCOPE_KEY; DeepSeek: VITE_DEEPSEEK_API_KEY
pnpm install
pnpm dev
After startup, you will see the chat page and can select a model from the configured service to send test messages.
In an existing Vue 3 + Vite project, you can generate a chat module from the project root.
pnpm dlx @opentiny/[email protected] add chat
cp -n .env.example .env.local
# Edit .env.local and fill in the test key for the service you use (as above).
Then merge the following code snippet into your existing src/App.vue, keeping the original business content:
<script setup lang="ts">
import TinyRobotChat from './tiny-robot-chat/TinyRobotChat.vue'
</script>
<template>
<!-- Existing business content -->
<TinyRobotChat />
</template>
After completing environment configuration and component integration, install dependencies and use the project's original startup command. The following uses pnpm as an example:
pnpm install
pnpm dev
After startup, an AI avatar entry appears in the bottom right of the page; clicking it opens the chat floating window. Full options are in the CLI integration doc.
Complete component usage and configuration can be found in the official documentation.
Summary
v1.0 is a new starting point for further refining TinyRobot's component capabilities.
- Complete kit for reuse. The independent Chat suite integrates the interface and conversation logic, reducing repeated assembly when building a chat page.
- More centralized selection and management. Model search, switching, and feature settings are in the same panel, and tools, skills, and business extensions have a unified management entry.
- Tool execution can be confirmed by the user. The application can pause a tool call before execution and let the user choose allow or deny, preserving a confirmation step for modifying business data.
You can use the complete chat page to build a new conversational application, or add chat components as needed to an existing project while keeping your original conversation and request logic.
In the future, TinyRobot will continue to improve component capabilities and refine the development experience, making it easier for developers to build AI assistants tailored to business needs.
About OpenTiny NEXT
OpenTiny NEXT is an enterprise intelligent front-end development solution built on two core technologies: generative UI and WebMCP. It upgrades existing traditional products like the TinyVue component library and the TinyEngine low-code engine, and constructs new products for Agent applications such as front-end NEXT-SDKs, AI Extension, TinyRobot intelligent assistant, and GenUI, enabling AI to understand user intent and autonomously complete tasks, accelerating the intelligent transformation of enterprise applications.
Welcome to join the OpenTiny open-source community. Add the WeChat assistant: opentiny-official to discuss front-end technology together~
TinyRobot official website: https://opentiny.design/tiny-robot
TinyRobot code repository: https://github.com/opentiny/tiny-robot (Star ⭐ welcome)
If you also want to contribute, you can go to the code repository, find the good first issue label, and join in the open-source contribution~ If you have any questions, feel free to leave a comment!