跳到主要内容

对话

功能概述

对话界面是 MimirQ 的核心交互入口,支持 RAG 增强的多轮对话、Streaming 输出、引用展示和语音模式。

路由

路由页面文件功能
/app/page.tsx对话主页面
/historyapp/history/page.tsx对话历史列表

组件架构

核心交互

操作API说明
创建对话chatApi.createConversation()新建 conversation
发送消息chatApi.chat()流式 SSE 响应
消息历史chatApi.getMessages()分页加载
对话列表chatApi.listConversations()历史对话
导出对话chatApi.exportConversation()Markdown / JSON
摘要chatApi.getConversationSummary()对话摘要

Streaming 流程

RAG 设置

对话输入区提供 RAG 参数调整 Popover:

  • 数据集选择
  • Prompt 模板选择
  • 元数据过滤模式 (all / exclude_qa / qa_only / custom)
  • 检索模式配置
提示

ChatArea 约 1350 行,ChatMessageItem 约 1330 行。建议通过搜索 useChat hook 理解数据流。

相关链接