Skip to content

AgentChat Block

Complete block composing header, history, events, approval, and prompt input.

Demo

AgentChatOne public API for H5 and Wevu
Live state
Release readiness workflowAgentChat
Varo Agent工具调用与外部操作始终可见、可确认 就绪

请检查这次发布是否满足双端要求。

Varo Agent

已完成检查,H5 与小程序均通过。

registry.inspect44 surfaces

发布检查

双端组件已经通过。

需要你的确认确认发布动作发布属于外部副作用。

Install

bash
pnpm add @varo-ui/ai
pnpm dlx @varo-ui/cli add --target h5 blocks/agent-chat
pnpm dlx @varo-ui/cli add --target weapp blocks/agent-chat

Registry installs the UI component into your project, so import it from @/components/agent-ui; @varo-ui/ai provides the event protocol, stream controller, and Markdown primitives—not Vue/Wevu UI components.

Basic Usage

vue
<script setup lang="ts">
import AgentChat from '@/components/blocks/agent-chat.vue'
</script>

<template>
  <AgentChat v-model="prompt" :messages="messages" :snapshot="snapshot" @submit="send" />
</template>

Props

PropTypeDefaultDescription
modelValuestring''Prompt
busybooleanfalseBusy
closeLabelstring关闭 AgentClose button name
messagesAgentConversationMessage[][]Messages
snapshotAgentStreamSnapshotSnapshot
subtitlestringSubtitle
suggestionsstring[][]Suggestions
titlestringVaro AgentTitle

Events

EventPayloadDescription
approvestringApprove
closevoidClose
rejectvoidReject
retryvoidRetry
submitstringSubmit
update:modelValuestringUpdate prompt

Target Notes

TargetImport
H5@/components/blocks/agent-chat.vue
weapp@/components/blocks/agent-chat.vue

The public API stays aligned across targets; DOM/WXML, scheduling, and native events are target-owned.