腾讯元宝对话导出器 | Tencent Yuanbao Exporter

导出腾讯元宝对话记录,支持 JSON 和 Markdown 格式。按时间正序,格式更贴近聊天界面。

作者
BlakeHansen130
日安装量
1
总安装量
3
评分
1 0 0
版本
0.2.4
创建于
2025-04-10
更新于
2025-04-10
大小
19.0 KB
许可证
Custom License
适用于

腾讯元宝对话导出器 | Tencent Yuanbao Exporter

描述 | Description

腾讯元宝对话导出器 (Tencent Yuanbao Exporter) 是一款为腾讯元宝用户设计的、功能强大且易于使用的对话记录导出工具。无论您是需要备份重要的讨论内容、整理学习笔记,还是希望与他人分享某个具体的 AI 交互过程,本脚本都能提供流畅、便捷的导出体验。

该工具支持将对话记录导出为 JSONMarkdown (MD) 两种常用格式。JSON 格式保留了原始的详细数据结构,非常适合进行后续的程序处理或深度分析;而 Markdown 格式则以清晰、美观、易于阅读的方式呈现对话,完美适用于笔记、文档分享或直接发布。通过本脚本,您可以轻松生成结构化且格式友好的对话记录文件。

除了基本的导出功能,脚本还具备以下特点:自动按对话时间正序排列;提取并包含每轮 AI 回复使用的具体模型 ID (chatModelId) 和插件 ID (pluginId);包含 AI 的思考过程(可选显示);正确处理和链接对话中包含的图片、代码、PDF 等多种文件;并对 Markdown 输出进行标题层级优化,确保最佳阅读体验。


Tencent Yuanbao Exporter is a powerful and user-friendly conversation export tool specifically designed for Tencent Yuanbao users. Whether you need to back up important discussions, organize study notes, or share specific AI interactions, this script offers a smooth and convenient export experience.

The tool supports exporting conversation records into two common formats: JSON and Markdown (MD). The JSON format retains the original detailed data structure, ideal for subsequent programmatic processing or in-depth analysis. The Markdown format presents the conversation clearly, beautifully, and readably, perfect for notes, document sharing, or direct publishing. With this script, you can easily generate structured and format-friendly conversation record files.

Beyond basic export, the script features: automatic sorting of conversations in chronological order; extraction and inclusion of the specific model ID (chatModelId) and plugin ID (pluginId) used for each AI response; inclusion of the AI's thinking process (displayable); correct handling and linking of various files included in the conversation (images, code, PDFs, etc.); and optimization of Markdown heading levels for the best reading experience.

功能特性 | Features

支持多种格式导出 | Multiple Export Formats

支持将会话导出为 JSONMarkdown (MD) 格式。JSON 格式适合开发者或需要进行数据分析的用户;Markdown 格式以用户友好的方式呈现对话,便于阅读、分享和归档。

Supports exporting conversations in both JSON and Markdown (MD) formats. JSON is suitable for developers or data analysis users; Markdown presents the conversation user-friendliness for easy reading, sharing, and archiving.

精准提取与正序排列 | Accurate Extraction & Chronological Order

脚本精确提取对话的核心要素,如发言者、时间戳、文本内容、引用的文件链接等,并自动按照对话发生的时间顺序重新排列,还原真实的交流过程。

The script accurately extracts core conversational elements like speaker, timestamp, text content, referenced file links, etc., and automatically rearranges them in chronological order to reflect the actual interaction flow.

包含详细元数据 | Detailed Metadata Inclusion

导出的记录中包含关键元数据:每轮对话的精确时间戳、每次 AI 回复所使用的具体 模型 ID (chatModelId) 以及调用的 插件 ID (pluginId),方便追溯和分析。

Exported records include key metadata: the precise timestamp for each turn, the specific Model ID (chatModelId) used for each AI response, and the invoked Plugin ID (pluginId), facilitating traceability and analysis.

支持多种内容类型 | Supports Various Content Types

脚本能识别并处理对话中的多种内容块,包括普通文本、AI 的思考过程 (think)搜索结果 (searchGuid) 以及用户上传或 AI 引用的多种文件链接(如图片、代码、PDF 等),并在 Markdown 中以适当格式展示。

The script recognizes and handles various content blocks within the conversation, including plain text, AI's thinking process (think), search results (searchGuid), and links to various files uploaded by the user or referenced by the AI (e.g., images, code, PDFs), presenting them appropriately in Markdown.

用户友好的下载按钮 | User-Friendly Download Buttons

在加载具体的元宝对话页面后,脚本会在页面右侧生成两个简洁的下载按钮(下载 JSON / 下载 MD)。只需点击即可完成导出,无需复杂配置,按钮状态会指示是否已成功捕获到对话数据。

After loading a specific Yuanbao conversation page, the script generates two simple download buttons on the right side (Download JSON / Download MD). Exporting is done with a single click without complex configuration. The button status indicates whether conversation data has been successfully captured.

Markdown 格式优化 | Markdown Format Optimization

导出为 Markdown 时,脚本会自动进行标题层级调整,确保 AI 回复中原有的 Markdown 标题不会与导出文件本身的结构冲突,保持良好的可读性。

When exporting to Markdown, the script automatically adjusts heading levels to ensure that original Markdown headings within AI responses do not conflict with the structure of the exported file itself, maintaining good readability.

使用方法 | Usage Instructions

1. 安装油猴脚本管理器 | Install Tampermonkey

您需要在浏览器中安装 Tampermonkey 或类似的脚本管理器(如 Violentmonkey, Greasemonkey)。

You need to install Tampermonkey or a similar script manager (like Violentmonkey, Greasemonkey) in your browser.

2. 安装脚本 | Install Script

在 Greasy Fork 或其他来源安装 腾讯元宝对话导出器 (Tencent Yuanbao Exporter) 脚本。

Install the Tencent Yuanbao Exporter script from Greasy Fork or another source.

3. 访问元宝对话 | Access Yuanbao Conversation

打开腾讯元宝网页版 (https://yuanbao.tencent.com/),并进入一个具体的对话页面

Open the Tencent Yuanbao web version (https://yuanbao.tencent.com/) and navigate to a specific conversation page.

4. 等待数据捕获 | Wait for Data Capture

脚本会自动监听网络请求。进入对话页面后,请稍等片刻,让页面加载完成,脚本会自动捕获对话详情数据。当右侧的下载按钮变为绿色时,表示数据已准备好。

The script automatically listens for network requests. After entering the conversation page, wait a moment for the page to fully load, allowing the script to capture the conversation detail data. When the download buttons on the right turn green, the data is ready.

5. 点击导出 | Click to Export

点击“下载JSON”或“下载MD”按钮,即可将当前对话导出为您选择的格式。

Click the "Download JSON" or "Download MD" button to export the current conversation in your chosen format.

6. 文件命名 | File Naming

导出的文件名会自动包含对话的标题和导出时间戳,方便管理。

The exported filename will automatically include the conversation title and an export timestamp for easy management.

注意事项 | Notes

  • 依赖特定API: 本脚本依赖腾讯元宝的 /api/user/agent/conversation/v1/detail 接口获取数据。如果未来元宝更改此接口的地址或返回的数据结构,脚本可能需要更新才能继续工作。 (This script relies on Tencent Yuanbao's /api/user/agent/conversation/v1/detail endpoint. Future changes to this API's URL or data structure by Yuanbao might require script updates.)
  • 文件内容: 脚本导出的是指向用户上传或 AI 引用的文件的链接和元数据,并非文件本身的内容。您需要通过链接自行访问或下载文件。 (The script exports links and metadata for user-uploaded or AI-referenced files, not the file content itself. You need to access or download the files via the provided links.)
  • AI生成媒体: 对于 AI 直接生成并展示在对话中的图片等媒体(如果元宝支持此功能),脚本可能只包含其引用信息或链接,不包含媒体文件本身。 (For images or other media generated directly by the AI and displayed in the chat (if Yuanbao supports this), the script might only include reference information or links, not the media file itself.)
  • 首次使用: 首次安装或在某个对话页面首次使用时,如果按钮不变绿,尝试刷新页面或与 AI 进行一次新的交互,以确保脚本能捕获到网络请求。 (On first use or on a specific conversation page for the first time, if the buttons don't turn green, try refreshing the page or making a new interaction with the AI to ensure the script captures the network request.)

作者 | Author

  • 作者 | Author: Gao + Gemini 2.5 Pro
  • 致谢 | Acknowledgments:感谢 Gemini 2.5 Pro Preview 03-25 在脚本开发过程中提供的思路和代码生成支持。

Thanks to Gemini 2.5 Pro Preview 03-25 for providing ideas and code generation support during the script's development.