markdown output polish
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
{"_type": "metadata", "key": "api:default", "created_at": "2026-03-14T21:43:22.940821", "updated_at": "2026-03-14T22:06:40.270077", "metadata": {}, "last_consolidated": 0}
|
||||
{"_type": "metadata", "key": "api:default", "created_at": "2026-03-14T21:43:22.940821", "updated_at": "2026-03-14T22:10:46.450968", "metadata": {}, "last_consolidated": 0}
|
||||
{"role": "user", "content": "你是谁", "timestamp": "2026-03-14T21:43:23.163485"}
|
||||
{"role": "user", "content": "hi", "timestamp": "2026-03-14T21:49:14.751350"}
|
||||
{"role": "user", "content": "你好", "timestamp": "2026-03-14T21:53:53.701083"}
|
||||
@@ -19,3 +19,7 @@
|
||||
{"role": "assistant", "content": "我是 nanobot 🐈,一个 AI AI 助手。", "reasoning_content": "用户问\"你是\",这是一个不完整的问题,可能是在问\"你是谁\"。我应该简洁地回答我的身份。", "timestamp": "2026-03-14T22:06:16.951664"}
|
||||
{"role": "user", "content": "你能干啥,详细一点", "timestamp": "2026-03-14T22:06:40.270030"}
|
||||
{"role": "assistant", "content": "我是 nanobot 🐈,一个功能丰富的 AI 助手。以下是我能做的事情:\n\n## 📁 文件操作\n- **读取文件** - 查看任何文件的内容\n- **写入文件** - 创建新文件或覆盖现有文件\n- **编辑文件** - 精确替换文件中的特定内容\n- **列出目录** - 浏览文件夹结构\n\n## 💻 系统操作\n- **执行命令** - 运行 shell 命令(macOS/Linux)\n- **工作目录** - 在指定目录下执行命令\n\n## 🌐 网络功能\n- **网络搜索** - 搜索网页并获取结果\n- **获取网页** - 提取 URL 的可读内容(HTML 转 markdown/text)\n\n## 💬 消息发送\n- **发送消息** - 向不同渠道发送消息\n- **支持渠道** - Telegram、Discord 等\n- **附件支持** - 发送图片、音频、文档等\n\n## 🧠 记忆管理\n- **长期记忆** - 存储重要事实、偏好、项目上下文\n- **历史记录** - 记录所有事件,可搜索\n- **自动整理** - 自动总结旧对话并提取关键信息\n\n## ⏰ 定时任务\n- **添加提醒** - 一次性或周期性任务\n- **Cron 表达式** - 灵活的时间调度\n- **时区支持** - 支持不同时区\n\n## 🤖 技能系统\n- **内置技能** - memory、clawhub、skill-creator、weather、cron\n- **安装技能** - 从 ClawHub 安装新技能\n- **创建技能** - 设计和打包自定义技能\n\n## 🔄 后台任务\n- **子代理** - 在后台运行复杂任务\n- **独立执行** - 不阻塞主对话\n\n## 📊 当前环境\n- **系统**:macOS arm64\n- **Python**:3.11.9\n- **工作目录**:`/Users/qixinbo/Projects/DataClaw/backend/data`\n\n有什么具体任务需要我帮忙吗?", "reasoning_content": "用户问我能做什么,想要详细的介绍。我应该详细介绍我的能力。", "timestamp": "2026-03-14T22:06:40.270072"}
|
||||
{"role": "user", "content": "你好", "timestamp": "2026-03-14T22:10:32.816891"}
|
||||
{"role": "assistant", "content": "你好!有什么我可以帮助你的吗?😊\n\n当前时间是 2026-03-14 22:10 (CST),星期六。", "reasoning_content": "用户发送了一个包含运行时上下文的消息,显示当前时间是 2026-03-14 22:10 (CST),星期六,渠道是 api,聊天 ID 是 api:default。用户只是说了\"你好\"。\n\n我应该简单地回应问候。", "timestamp": "2026-03-14T22:10:32.816901"}
|
||||
{"role": "user", "content": "你能帮我干啥", "timestamp": "2026-03-14T22:10:46.450962"}
|
||||
{"role": "assistant", "content": "我可以帮你做很多事情!以下是我的主要能力:\n\n## 📁 文件操作\n- 读取、写入、编辑文件\n- 浏览目录结构\n\n## 💻 系统操作\n- 执行 shell 命令\n- 在指定目录下运行命令\n\n## 🌐 网络功能\n- 搜索网页信息\n- 获取并提取网页内容\n\n## 💬 消息发送\n- 发送消息到 Telegram、Discord 等渠道\n- 支持发送图片、文档等附件\n\n## 🧠 记忆管理\n- 存储重要信息和偏好\n- 记录和搜索历史事件\n\n## ⏰ 定时任务\n- 设置提醒和周期性任务\n- 使用 Cron 表达式调度\n\n## 🤖 技能系统\n- 安装新技能(从 ClawHub)\n- 创建自定义技能\n\n## 🔄 后台任务\n- 在后台运行复杂任务\n\n你有什么具体需求吗?比如:\n- 处理某个文件?\n- 搜索信息?\n- 设置提醒?\n- 其他任务?", "reasoning_content": "用户问\"你能帮我干啥\",这是在询问我的能力。我应该用中文简洁地介绍我的主要功能。", "timestamp": "2026-03-14T22:10:46.450967"}
|
||||
|
||||
Generated
+1653
-1
File diff suppressed because it is too large
Load Diff
@@ -21,8 +21,11 @@
|
||||
"react": "^19.2.4",
|
||||
"react-dom": "^19.2.4",
|
||||
"react-grid-layout": "^2.2.2",
|
||||
"react-markdown": "^10.1.0",
|
||||
"react-router-dom": "^7.13.1",
|
||||
"recharts": "^3.8.0",
|
||||
"rehype-raw": "^7.0.0",
|
||||
"remark-gfm": "^4.0.1",
|
||||
"shadcn": "^4.0.6",
|
||||
"tailwind-merge": "^3.5.0",
|
||||
"tw-animate-css": "^1.4.0",
|
||||
@@ -30,6 +33,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.39.4",
|
||||
"@tailwindcss/typography": "^0.5.19",
|
||||
"@types/node": "^24.12.0",
|
||||
"@types/react": "^19.2.14",
|
||||
"@types/react-dom": "^19.2.3",
|
||||
|
||||
@@ -8,6 +8,9 @@ import { useVisualizationStore } from "@/store/visualizationStore";
|
||||
import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover";
|
||||
import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList } from "@/components/ui/command";
|
||||
import { cn } from "@/lib/utils";
|
||||
import ReactMarkdown from 'react-markdown';
|
||||
import remarkGfm from 'remark-gfm';
|
||||
import rehypeRaw from 'rehype-raw';
|
||||
|
||||
interface Message {
|
||||
id: string;
|
||||
@@ -238,7 +241,7 @@ export function ChatInterface() {
|
||||
</Popover>
|
||||
</div>
|
||||
|
||||
<ScrollArea className="flex-1">
|
||||
<ScrollArea className="flex-1 h-[calc(100vh-100px)]">
|
||||
|
||||
<div className="min-h-full">
|
||||
{messages.length <= 1 ? (
|
||||
@@ -309,7 +312,7 @@ export function ChatInterface() {
|
||||
</div>
|
||||
</div>
|
||||
) : (
|
||||
<div className="max-w-3xl mx-auto py-8 px-4 pb-32 space-y-8">
|
||||
<div className="max-w-3xl mx-auto pt-24 px-4 pb-48 space-y-8">
|
||||
{messages.map((msg) => (
|
||||
<div
|
||||
key={msg.id}
|
||||
@@ -324,10 +327,18 @@ export function ChatInterface() {
|
||||
className={`rounded-2xl px-5 py-3.5 text-[15px] leading-relaxed max-w-[85%] shadow-sm ${
|
||||
msg.role === "user"
|
||||
? "bg-zinc-100 text-zinc-800"
|
||||
: "bg-white border border-zinc-100 text-zinc-700"
|
||||
: "bg-white border border-zinc-100 text-zinc-700 overflow-hidden"
|
||||
}`}
|
||||
>
|
||||
{msg.content}
|
||||
{msg.role === "assistant" ? (
|
||||
<div className="prose prose-sm prose-zinc max-w-none prose-p:leading-normal prose-p:my-2 prose-headings:my-3 prose-ul:my-2 prose-li:my-0.5 prose-pre:bg-zinc-50 prose-pre:text-zinc-800 prose-pre:border prose-pre:border-zinc-200">
|
||||
<ReactMarkdown remarkPlugins={[remarkGfm]} rehypePlugins={[rehypeRaw]}>
|
||||
{msg.content}
|
||||
</ReactMarkdown>
|
||||
</div>
|
||||
) : (
|
||||
msg.content
|
||||
)}
|
||||
</div>
|
||||
{msg.role === "user" && (
|
||||
<div className="w-8 h-8 rounded-full bg-zinc-200 flex items-center justify-center text-zinc-500 shrink-0 mt-1">
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
@import "@fontsource-variable/geist";
|
||||
@import "tailwindcss";
|
||||
@plugin "@tailwindcss/typography";
|
||||
|
||||
/* @plugin "tw-animate-css"; */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user