[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-bramses--chatgpt-md":3,"tool-bramses--chatgpt-md":64},[4,17,27,35,43,56],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":16},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,3,"2026-04-05T11:01:52",[13,14,15],"开发框架","图像","Agent","ready",{"id":18,"name":19,"github_repo":20,"description_zh":21,"stars":22,"difficulty_score":23,"last_commit_at":24,"category_tags":25,"status":16},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",138956,2,"2026-04-05T11:33:21",[13,15,26],"语言模型",{"id":28,"name":29,"github_repo":30,"description_zh":31,"stars":32,"difficulty_score":23,"last_commit_at":33,"category_tags":34,"status":16},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",107662,"2026-04-03T11:11:01",[13,14,15],{"id":36,"name":37,"github_repo":38,"description_zh":39,"stars":40,"difficulty_score":23,"last_commit_at":41,"category_tags":42,"status":16},3704,"NextChat","ChatGPTNextWeb\u002FNextChat","NextChat 是一款轻量且极速的 AI 助手，旨在为用户提供流畅、跨平台的大模型交互体验。它完美解决了用户在多设备间切换时难以保持对话连续性，以及面对众多 AI 模型不知如何统一管理的痛点。无论是日常办公、学习辅助还是创意激发，NextChat 都能让用户随时随地通过网页、iOS、Android、Windows、MacOS 或 Linux 端无缝接入智能服务。\n\n这款工具非常适合普通用户、学生、职场人士以及需要私有化部署的企业团队使用。对于开发者而言，它也提供了便捷的自托管方案，支持一键部署到 Vercel 或 Zeabur 等平台。\n\nNextChat 的核心亮点在于其广泛的模型兼容性，原生支持 Claude、DeepSeek、GPT-4 及 Gemini Pro 等主流大模型，让用户在一个界面即可自由切换不同 AI 能力。此外，它还率先支持 MCP（Model Context Protocol）协议，增强了上下文处理能力。针对企业用户，NextChat 提供专业版解决方案，具备品牌定制、细粒度权限控制、内部知识库整合及安全审计等功能，满足公司对数据隐私和个性化管理的高标准要求。",87618,"2026-04-05T07:20:52",[13,26],{"id":44,"name":45,"github_repo":46,"description_zh":47,"stars":48,"difficulty_score":23,"last_commit_at":49,"category_tags":50,"status":16},2268,"ML-For-Beginners","microsoft\u002FML-For-Beginners","ML-For-Beginners 是由微软推出的一套系统化机器学习入门课程，旨在帮助零基础用户轻松掌握经典机器学习知识。这套课程将学习路径规划为 12 周，包含 26 节精炼课程和 52 道配套测验，内容涵盖从基础概念到实际应用的完整流程，有效解决了初学者面对庞大知识体系时无从下手、缺乏结构化指导的痛点。\n\n无论是希望转型的开发者、需要补充算法背景的研究人员，还是对人工智能充满好奇的普通爱好者，都能从中受益。课程不仅提供了清晰的理论讲解，还强调动手实践，让用户在循序渐进中建立扎实的技能基础。其独特的亮点在于强大的多语言支持，通过自动化机制提供了包括简体中文在内的 50 多种语言版本，极大地降低了全球不同背景用户的学习门槛。此外，项目采用开源协作模式，社区活跃且内容持续更新，确保学习者能获取前沿且准确的技术资讯。如果你正寻找一条清晰、友好且专业的机器学习入门之路，ML-For-Beginners 将是理想的起点。",84991,"2026-04-05T10:45:23",[14,51,52,53,15,54,26,13,55],"数据工具","视频","插件","其他","音频",{"id":57,"name":58,"github_repo":59,"description_zh":60,"stars":61,"difficulty_score":10,"last_commit_at":62,"category_tags":63,"status":16},3128,"ragflow","infiniflow\u002Fragflow","RAGFlow 是一款领先的开源检索增强生成（RAG）引擎，旨在为大语言模型构建更精准、可靠的上下文层。它巧妙地将前沿的 RAG 技术与智能体（Agent）能力相结合，不仅支持从各类文档中高效提取知识，还能让模型基于这些知识进行逻辑推理和任务执行。\n\n在大模型应用中，幻觉问题和知识滞后是常见痛点。RAGFlow 通过深度解析复杂文档结构（如表格、图表及混合排版），显著提升了信息检索的准确度，从而有效减少模型“胡编乱造”的现象，确保回答既有据可依又具备时效性。其内置的智能体机制更进一步，使系统不仅能回答问题，还能自主规划步骤解决复杂问题。\n\n这款工具特别适合开发者、企业技术团队以及 AI 研究人员使用。无论是希望快速搭建私有知识库问答系统，还是致力于探索大模型在垂直领域落地的创新者，都能从中受益。RAGFlow 提供了可视化的工作流编排界面和灵活的 API 接口，既降低了非算法背景用户的上手门槛，也满足了专业开发者对系统深度定制的需求。作为基于 Apache 2.0 协议开源的项目，它正成为连接通用大模型与行业专有知识之间的重要桥梁。",77062,"2026-04-04T04:44:48",[15,14,13,26,54],{"id":65,"github_repo":66,"name":67,"description_en":68,"description_zh":69,"ai_summary_zh":69,"readme_en":70,"readme_zh":71,"quickstart_zh":72,"use_case_zh":73,"hero_image_url":74,"owner_login":75,"owner_name":76,"owner_avatar_url":77,"owner_bio":78,"owner_company":79,"owner_location":80,"owner_email":81,"owner_twitter":81,"owner_website":82,"owner_url":83,"languages":84,"stars":97,"forks":98,"last_commit_at":99,"license":100,"difficulty_score":23,"env_os":101,"env_gpu":102,"env_ram":102,"env_deps":103,"category_tags":106,"github_topics":81,"view_count":107,"oss_zip_url":81,"oss_zip_packed_at":81,"status":16,"created_at":108,"updated_at":109,"faqs":110,"releases":151},132,"bramses\u002Fchatgpt-md","chatgpt-md","A (nearly) seamless integration of ChatGPT into Obsidian.","ChatGPT MD 是一款专为 Obsidian 用户打造的 AI 插件，能将 ChatGPT、OpenRouter.ai 以及本地大模型（通过 Ollama 或 LM Studio）无缝集成到笔记环境中。它解决了在知识管理过程中频繁切换应用、上下文割裂的问题，让用户直接在笔记里与 AI 对话、获取信息或整理思路，无需离开 Obsidian。\n\n这款插件特别适合重度使用 Obsidian 的知识工作者，如研究人员、学生、内容创作者或效率爱好者——无论你是希望借助云端模型快速生成内容，还是偏好用本地模型保障隐私、节省费用，都能灵活配置。\n\n其亮点包括“智能体（Agents）系统”，可创建带自定义角色设定和参数的 AI 助手；以及注重隐私的“工具调用”功能：AI 若需查阅笔记或联网搜索，必须经用户明确授权，确保数据始终可控。设置简单，支持快捷键唤出对话，也允许在单篇笔记中指定不同模型，兼顾易用性与灵活性。","# ChatGPT MD\n\n🚀 A seamless integration of ChatGPT, OpenRouter.ai and local LLMs via Ollama\u002FLM Studio into Obsidian.\n\n![Chatting with links about vacation plans](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fbramses_chatgpt-md_readme_7bc7f9bddc58.gif)\n\n## 🚀 What's New\n\n### v3.1.0: Agents System\n\n**Create reusable AI personas with custom system prompts, models, and temperature settings.**\n\nDefine agents as Markdown files with frontmatter and a system prompt body. Apply an agent to any note with the `Choose Agent` command, or create new agents with the **AI Wizard**—describe what you want, and AI generates the name, temperature, and a comprehensive system prompt for you.\n\n### v3.0.0: Privacy-First AI Tool Calling (off by default - Settings → ChatGPT MD → Tool Calling)\n\n**Your AI assistant can now actively search your vault, read files, and query the web—with a human-in-the-loop architecture that keeps you in control.**\n\nTool calling built on privacy-first principles. When your AI needs information, it requests permission to use tools—you approve execution, review results, and control exactly what gets shared back to the model. Nothing leaves your vault without explicit consent.\n\n\n## A simple and quick Start 🏁\nGet started in just a few simple steps:\n\n1. **Install ChatGPT MD**: Go to `Settings > Community Plugins > Browse`, search for `ChatGPT MD` and click `Install`.\n2. **Add your OpenAI API key**: In the plugin settings, add your OpenAI API key and\u002For install Ollama and local LLMs of your choice.\n3. **Start chatting**: Use the `ChatGPT MD: Chat` command (`cmd + p` or `ctrl + p`) to start a conversation from any note.\n\n💡 *Pro tip*: Set up a hotkey for the best experience! Go to `Settings > Hotkeys`, search for `ChatGPT MD: Chat` and add your preferred keybinding (e.g., `cmd + j`).\n\nStart chatting, don't worry too much about the more advanced features. They will come naturally :-) \n\n## Local LLM Setup (Ollama & LM Studio) 🏠\n\nWant to keep your conversations private and avoid API costs? Use local LLMs with ChatGPT MD!\n\n### Ollama Setup\n\n1. **Install Ollama**: Download from [ollama.ai](https:\u002F\u002Follama.ai) and install on your system\n2. **Download a model**: Run in terminal:\n   ```bash\n   ollama pull llama3.2    # or any model of your choice\n   ollama pull qwen2.5     # another popular option\n   ```\n3. **Configure ChatGPT MD**:\n   - Go to `Settings > ChatGPT MD > Ollama Defaults`\n   - The Ollama URL should already be set to `http:\u002F\u002Flocalhost:11434`\n   - Set your default model in the settings (e.g., `ollama@llama3.2`)\n4. **Start chatting**: Use the `ChatGPT MD: Chat` command to start conversations with your configured default model, or override it in individual notes:\n   ```yaml\n   ---\n   model: ollama@llama3.2  # Override default if needed\n   temperature: 0.7\n   ---\n   ```\n\n### LM Studio Setup\n\n1. **Install LM Studio**: Download from [lmstudio.ai](https:\u002F\u002Flmstudio.ai)\n2. **Download and load a model** in LM Studio\n3. **Start the server**: In LM Studio, go to Local Server and start it\n4. **Configure ChatGPT MD**:\n   - Go to `Settings > ChatGPT MD > LM Studio Defaults`\n   - The LM Studio URL should be set to `http:\u002F\u002Flocalhost:1234`\n   - Set your default model in the settings (e.g., `lmstudio@your-model-name`)\n5. **Start chatting**: Use the `ChatGPT MD: Chat` command to start conversations with your configured default model, or override it in individual notes:\n   ```yaml\n   ---\n   model: lmstudio@your-model-name  # Override default if needed\n   temperature: 0.7\n   ---\n   ```\n\n### Finding Your Model Names\n\n- **Ollama**: Run `ollama list` in terminal to see installed models\n- **LM Studio**: Check the model name in LM Studio's interface when the model is loaded\n\n### Important Notes for Local LLMs\n\n- **Default Model Configuration**: Set your preferred local model as the default in settings - it works just like cloud services\n- **Per-Note Overrides**: You can override the default model in individual notes using frontmatter, same as with other providers\n- **Model Discovery**: Use `ollama list` (Ollama) or check LM Studio interface to find your available model names for configuration\n\n## Features\n* **Interactive conversations**: \n  * Engage directly with ChatGPT, OpenRouter.ai models, and Ollama from any Markdown note, edit questions or responses on-the-fly, and continue the chat seamlessly.\n* **Privacy & Zero API Costs:** \n  * Use local LLMs via Ollama, keeping your chats on your computer and avoiding API costs.\n* **Web Access Models:**\n  * Get real-time information from the web with OpenAI's `gpt-4o-search-preview` and Perplexity's `openrouter@perplexity\u002Fllama-3.1-sonar-small-128k-online` (via openrouter.ai).\n* **Multiple AI Providers:**\n  * Choose from OpenAI, OpenRouter.ai (with access to models like Gemini, Claude, DeepSeek, Llama, Perplexity), or local models via Ollama.\n* **System Commands:** \n  * Instruct the LLM via system commands to get the best possible answers.\n* **Link context**: \n  * Provide links to any other note in your vault for added context during conversations with Markdown or Wiki links.\n* **Per-note Configuration:** \n  * Overwrite default settings via frontmatter for individual notes using params from [OpenAI API](https:\u002F\u002Fplatform.openai.com\u002Fdocs\u002Fapi-reference\u002Fchat), [OpenRouter.ai](https:\u002F\u002Fopenrouter.ai\u002Fdocs), or [Ollama API](https:\u002F\u002Fgithub.com\u002Follama\u002Follama\u002Fblob\u002Fmain\u002Fdocs\u002Fapi.md#generate-a-chat-completion).\n* **Markdown Support:** \n  * Enjoy full rendering of lists, code blocks, and more from all responses.\n* **Minimal Setup:** \n  * Utilize your OpenAI API key, OpenRouter.ai API key, or install any LLM locally via Ollama.\n* **Comment Blocks:** \n  * Ignore parts of your notes using comment blocks.\n* **Chat Templates**: \n  * Use and share frontmatter templates for recurring scenarios. Explore [chatgpt-md-templates](https:\u002F\u002Fgithub.com\u002Fbramses\u002Fchatgpt-md-templates).\n\n## Privacy and Security\n\nChatGPT MD is \n- only storing data locally in your vault, with zero tracking and no 3rd party integrations except direct calls to the AI APIs (OpenAI, OpenRouter.ai).\n- allowing you to use Ollama, a local LLM installation for offline conversation-based knowledge exploration.\n\n### Default Configuration\nThe plugin comes with a well-balanced pre-configuration to get you started immediately. \nYou can change the global settings or use the local parameters in any note via frontmatter\n(start typing `---` in the first line of your note to add properties)\n```\n---\nsystem_commands: ['You are a helpful assistant.']\ntemperature: 0.3\ntop_p: 1\nmax_tokens: 300\npresence_penalty: 0.5\nfrequency_penalty: 0.5\nstream: true\nstop: null\nn: 1\nmodel: gpt-5-mini\n\n# Service-specific URLs (optional, will use global settings if not specified)\nopenaiUrl: https:\u002F\u002Fapi.openai.com\n# openrouterUrl: https:\u002F\u002Fopenrouter.ai\n# ollamaUrl: http:\u002F\u002Flocalhost:11434\n---\n```\n💡 Pro tip: Increasing `max_tokens` to a higher value e.g. `4096` for more complex tasks like reasoning, coding or text creation.\nThe default model `gpt-5-mini` is optimized for speed and efficiency. Upgrade to `gpt-5` for enhanced reasoning capabilities or use `gpt-5-nano` for ultra-lightweight responses.\n\n### Tools\n\n1. **Install**: Update or install v3.0.0+ from Obsidian\n2. **Configure**: Settings → ChatGPT MD → Tool Calling → Enable,\n3. **Optional**: Add [Brave Search API key](https:\u002F\u002Fbrave.com\u002Fsearch\u002Fapi\u002F) (free tier: 1,000 queries\u002Fmonth)\n4. **Chat**: Use the `ChatGPT MD: Chat` command. AI will request tool use when needed.\n\nThe implementation follows a three-layer approval pattern:\n\n1. **Execution Layer**: AI requests tool use with parameters\n2. **Processing Layer**: Tool executes locally in your vault using Obsidian's API (full-text search across filenames and content)\n3. **Approval Layer**: Interactive modals let you filter results before they're returned to the AI\n\n### Available Tools\n\n**Vault Search** (`vault_search`)\n- Multi-word OR search: matches ANY query term across your vault\n- Searches both filenames and file content simultaneously\n- Excludes current file to prevent recursion\n- Configurable result limits (default: 5 files)\n- Query editing: refine search terms before execution\n\n**File Read** (`file_read`)\n- Direct file access when AI knows specific file paths\n- Batch reading support for multiple files\n- Full content extraction with your approval\n- Useful for targeted lookups once files are discovered\n\n**Web Search** (`web_search`)\n- Powered by Brave Search API (privacy-focused, 1,000 free queries\u002Fmonth)\n- Custom search provider support for self-hosted endpoints\n- Optional full-page content fetching\n- Automatic API key validation—tool only appears when configured\n- Query editing: modify web search queries before execution\n\n### Privacy & Security\n\n- **Local-First Execution**: All vault operations run entirely within Obsidian's API\n- **Selective Sharing**: Multi-select modals let you choose exactly which results to share\n- **No Telemetry**: Zero tracking or analytics—tool usage stays private\n\n### Configuration\n\nEnable tool calling in **Settings → ChatGPT MD → Tool Calling**:\n\n- **Enable Tool Calling**: Master switch (default: disabled)\n- **Brave Search API Key**: Your Brave Search API key\n- **Custom Provider URL**: Self-hosted search endpoint\n- **Max Web Results**: Number of web results to return (1-10)\n\n### Use Cases\n\n**Research Assistant**: \"Search my vault for notes about quantum computing algorithms and recent papers on the topic\"\n\n→ AI discovers relevant notes → You approve which files to share → AI synthesizes information with proper attribution\n\n**Knowledge Synthesis**: \"Find all my Q3 meeting notes and summarize key decisions about product roadmap\"\n\n→ Vault search returns meeting files → You select the relevant ones → AI extracts and summarizes decisions\n\n**Web-Enhanced Writing**: \"Search the web for latest climate change statistics and incorporate them into my article\"\n\n→ Web search fetches current data → You filter reliable sources → AI integrates citations into your draft\n\n**Cross-Reference Discovery**: \"Find notes that mention both machine learning and productivity techniques\"\n\n→ Multi-word OR search finds intersections → You approve interesting connections → AI highlights patterns you might have missed\n\n⚠️ **Note**: Tool support depends on model capabilities. Older models may not support function calling. You can check tool capabilities in the tool selection list after enabling tool support in the settings.\n\n\n### Multi Model Chats\nYou can set and change the model for each request in your note. \nSpecify the `model` property via frontmatter:\n\nfor OpenAI models (including the latest GPT-5 family)\n```\n---\nmodel: gpt-5  # or gpt-5-mini, gpt-5-nano, gpt-5-chat-latest\nsystem_commands: [act as a senior javascript developer]\n---\n```\nprefix it with `ollama@` for Ollama models or `lmstudio@` for LM Studio models.\n```\n---\nmodel: ollama@gemma2:27b\ntemperature: 1\n---\n```\n\n\nThe AI responses will keep the used model name in the response title for future reference.\nYou can find the list of your installed Ollama model names from your terminal via `ollama list` or the available openAI model names online on this [openAI models](https:\u002F\u002Fplatform.openai.com\u002Fdocs\u002Fmodels) page.\n\n### Service URLs\nEach AI service has its own dedicated URL parameter that can be configured globally in settings or per-note via frontmatter:\n\n```\n---\n# For OpenAI\nopenaiUrl: https:\u002F\u002Fapi.openai.com\n\n# For OpenRouter\nopenrouterUrl: https:\u002F\u002Fopenrouter.ai\n\n# For Ollama\nollamaUrl: http:\u002F\u002Flocalhost:11434\n---\n```\n\nThe default URLs are:\n- OpenAI: `https:\u002F\u002Fapi.openai.com`\n- OpenRouter: `https:\u002F\u002Fopenrouter.ai`\n- Ollama: `http:\u002F\u002Flocalhost:11434`\n\nNote: Previous versions used a single `url` parameter which is now deprecated. Please update your templates and notes to use the service-specific URL parameters.\n\n### Commands 👨‍💻\nRun commands from Obsidian's command pallet via `cmd + p` or `ctrl + p` and start typing `chatgpt` or set hotkeys\n(a chat command hotkey is highly recommended for effortless chats (I use `cmd + j`, which works fantastic, because your index finger is already resting on that key)).\n\n#### Main Command\n- **Chat**: Parse the file and interact with ChatGPT. Assign a hotkey, e.g. `cmd + j`.\n  \n#### Creation Commands\n- **New Chat with Highlighted Text**: Start a chat using highlighted text and default frontmatter in `Chat Folder`.\n- **New Chat From Template**: Create chats from templates in `Chat Template Folder`.\n\n#### Utility Commands\n- **Infer Title**: Automatically generate a note title based on the notes content. Configurable to auto-run after 4+ messages.\n- **Add Comment Block**: Insert comment blocks for parts of your note that should be ignored.\n- **Select Model**: Choose from all available LLMs (OpenAI, OpenRouter.ai, Ollama) and set the current model for your note.\n\n#### Maintenance Commands\n- **Clear Chat**: Remove all messages while retaining frontmatter.\n- **Stop Streaming (Desktop Only)**: Halt ongoing streams if necessary.\n\n#### Formatting Tools\n- **Add Divider**: Insert horizontal rulers to organize content visually.\n\n## Beta Testing 🧪\nWant to try the latest features before they're officially released? You can beta test ChatGPT MD using the [BRAT (Beta Reviewer's Auto-update Tool)](https:\u002F\u002Fgithub.com\u002FTfTHacker\u002Fobsidian42-brat) community plugin:\n\n1. Install the BRAT plugin from Obsidian's Community Plugins\n2. Open BRAT settings and add `bramses\u002Fchatgpt-md` as a beta plugin\n3. Select \"latest version\" from the dropdown in the BRAT plugin settings\n4. Enable the ChatGPT MD plugin in your community plugins list\n\nThis gives you early access to new features while they're still being developed and tested.\n\n⚠️ **WARNING**: Beta testing is dangerous and happens at your own risk. Always test beta versions on a new empty vault, not on your main vault. Beta features can break and possibly lead to data loss.\n\n## FAQs ❓\n#### How do I start chatting with ChatGPT MD?\nUse the `ChatGPT MD: Chat` command from the Obsidian command Palette (`cmd + p` or `ctrl + p`) to start a conversation from any note.\n\n#### Can I set up a hotkey for the `ChatGPT MD: Chat` command?\nYes, you should! Go to `Settings > Hotkeys`, search for `ChatGPT MD: Chat` and add your preferred keybinding (e.g., `cmd + j`).\n\n#### How do I use chat and reasoning models?\nYou can use OpenAI's GPT 3 and 4 models, various models through OpenRouter.ai (like Claude, Gemini, DeepSeek, Llama, Perplexity), or any model you have installed via Ollama.\nDeepSeek-r1:7b works great for reasoning locally via Ollama.\n\n#### How do I use a custom endpoint?\nEnsure your custom API adheres to OpenAI's specifications, such as Azure's hosted endpoints. Consult your provider for API key management details.\n\n#### Where should I add my OpenAI API key?\nIn the plugin settings, add your OpenAI API key and\u002For install Ollama and local LLMs of your choice.\n\n#### What happened to the 'url' parameter in the frontmatter?\nThe single 'url' parameter is now deprecated. In v2.2.0 and higher, we've introduced service-specific URL parameters: `openaiUrl`, `openrouterUrl`, and `ollamaUrl`. This allows for more flexibility and clarity when configuring different services. Please update your templates and notes accordingly.\n\n🤖 Enjoy exploring the power of ChatGPT MD in your Obsidian vault!🚀\n\n## Contributions Welcome 🤝\n\nPull requests, bug reports, and all other forms of contribution are welcomed and highly encouraged! :octocat:\n\n### Development Setup\n\n```bash\n# Clone the repository\ngit clone https:\u002F\u002Fgithub.com\u002Fbramses\u002Fchatgpt-md.git\ncd chatgpt-md\n\n# Install dependencies\nyarn install\n\n# Development mode (watch for changes)\nyarn dev\n\n# Run tests\nyarn test\n\n# Run tests with coverage\nyarn test:coverage\n\n# Lint code\nyarn lint\nyarn lint:fix\n\n# Production build\nyarn build\n```\n\n### Testing\n\nThe project uses Jest for testing with 104 tests covering utility functions. Before submitting a PR:\n\n1. Run `yarn test` to ensure all tests pass\n2. Run `yarn lint` to check code quality\n3. Run `yarn build` to verify the build succeeds\n\n### Code Quality Standards\n\n- **Complexity**: Functions should be under 50 lines with cyclomatic complexity ≤15\n- **Type Safety**: Minimize `any` usage; prefer explicit types\n- **Async Safety**: All promises must be handled properly (awaited, caught, or explicitly ignored)\n- **Testing**: Add tests for new utility functions in `src\u002FUtilities\u002F*.test.ts`\n\n### Pre-commit Hooks\n\nPre-commit hooks automatically run on `git commit`:\n- ESLint auto-fixes linting issues\n- Prettier formats code\n- Only staged files are checked\n\n### CI\u002FCD\n\nGitHub Actions automatically runs on pull requests:\n- Lint check\n- TypeScript type checking\n- Test suite with coverage\n- Production build\n\n### Project Structure\n\n```\nsrc\u002F\n├── Commands\u002F           # Obsidian command handlers\n├── Services\u002F           # Business logic & AI adapters\n├── Views\u002F              # UI components & modals\n├── Utilities\u002F          # Pure helper functions (well-tested)\n├── Models\u002F             # TypeScript interfaces\n├── Types\u002F              # Type definitions\n└── core\u002F               # Dependency injection container\n```\n\nFor detailed development documentation, see [CLAUDE.md](CLAUDE.md) and [docs\u002Fdevelopment.md](docs\u002Fdevelopment.md).\n\n### Submitting Changes\n\n1. Fork the repository\n2. Create a feature branch (`git checkout -b feature\u002Famazing-feature`)\n3. Make your changes (tests, linting, and docs)\n4. Commit your changes (`git commit -m 'Add amazing feature'`)\n5. Push to the branch (`git push origin feature\u002Famazing-feature`)\n6. Open a Pull Request\n\nYour PR will be automatically checked by CI. Please ensure all checks pass before requesting review!\n\n## About the Developers ✍️\nBram created ChatGPT MD in March 2023 lives in NYC and is building [Your Commonbase](https:\u002F\u002Fbramses.notion.site\u002FYour-Commonbase-ALPHA-10b034182ddd8038b9ffe11cc2833713) (A Self Organizing Scrapbook with Zero Stress Storing, Searching, and Sharing). His personal website and newsletter is located at [bramadams.dev](https:\u002F\u002Fwww.bramadams.dev\u002F)\n\nDeniz joined Bram in 2024 to continue development. He is working in a gaming company in Germany and uses AI heavily in his work and private life. Say \"hi\" on Bluesky: [Deniz](https:\u002F\u002Fbsky.app\u002Fprofile\u002Fdenizokcu.bsky.social)\n\nHappy writing with ChatGPT MD! 💻 🎉\n","# ChatGPT MD\n\n🚀 通过 Ollama\u002FLM Studio 将 ChatGPT、OpenRouter.ai 和本地 LLM（大语言模型）无缝集成到 Obsidian 中。\n\n![围绕假期计划与链接进行聊天](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fbramses_chatgpt-md_readme_7bc7f9bddc58.gif)\n\n## 🚀 新功能\n\n### v3.1.0：智能体（Agents）系统\n\n**创建可复用的 AI 角色，自定义系统提示（system prompt）、模型和温度（temperature）设置。**\n\n将智能体定义为带有 frontmatter（前置元数据）和系统提示正文的 Markdown 文件。通过 `Choose Agent`（选择智能体）命令将智能体应用到任意笔记，或使用 **AI Wizard（AI 向导）** 创建新智能体——只需描述你的需求，AI 就会为你生成名称、温度值和完整的系统提示。\n\n### v3.0.0：注重隐私的 AI 工具调用（默认关闭 - 设置 → ChatGPT MD → Tool Calling）\n\n**你的 AI 助手现在可以主动搜索你的知识库（vault）、读取文件并查询网络——采用“人在回路”（human-in-the-loop）架构，确保你始终掌控一切。**\n\n工具调用基于隐私优先原则构建。当 AI 需要信息时，会请求使用工具的权限——你批准执行、审查结果，并精确控制哪些内容返回给模型。未经明确同意，任何数据都不会离开你的知识库。\n\n## 快速入门 🏁\n只需几个简单步骤即可开始：\n\n1. **安装 ChatGPT MD**：进入 `设置 > 社区插件 > 浏览`，搜索 `ChatGPT MD` 并点击 `安装`。\n2. **添加你的 OpenAI API 密钥**：在插件设置中添加 OpenAI API 密钥，或安装 Ollama 并选择你喜欢的本地 LLM。\n3. **开始聊天**：使用 `ChatGPT MD: Chat` 命令（`cmd + p` 或 `ctrl + p`）从任意笔记启动对话。\n\n💡 *专业提示*：设置快捷键以获得最佳体验！进入 `设置 > 快捷键`，搜索 `ChatGPT MD: Chat` 并添加你喜欢的快捷键（例如 `cmd + j`）。\n\n先开始聊天吧，不必过于担心高级功能，它们会自然而然地掌握 :-) \n\n## 本地 LLM 设置（Ollama & LM Studio）🏠\n\n想保持对话私密并避免 API 费用？使用 ChatGPT MD 搭配本地 LLM！\n\n### Ollama 设置\n\n1. **安装 Ollama**：从 [ollama.ai](https:\u002F\u002Follama.ai) 下载并在你的系统上安装\n2. **下载模型**：在终端运行：\n   ```bash\n   ollama pull llama3.2    # 或任意你选择的模型\n   ollama pull qwen2.5     # 另一个流行选项\n   ```\n3. **配置 ChatGPT MD**：\n   - 进入 `设置 > ChatGPT MD > Ollama 默认设置`\n   - Ollama URL 应已自动设为 `http:\u002F\u002Flocalhost:11434`\n   - 在设置中指定默认模型（例如 `ollama@llama3.2`）\n4. **开始聊天**：使用 `ChatGPT MD: Chat` 命令与配置的默认模型对话，或在单个笔记中覆盖设置：\n   ```yaml\n   ---\n   model: ollama@llama3.2  # 如需覆盖默认值\n   temperature: 0.7\n   ---\n   ```\n\n### LM Studio 设置\n\n1. **安装 LM Studio**：从 [lmstudio.ai](https:\u002F\u002Flmstudio.ai) 下载\n2. **在 LM Studio 中下载并加载模型**\n3. **启动服务器**：在 LM Studio 中进入 Local Server 并启动\n4. **配置 ChatGPT MD**：\n   - 进入 `设置 > ChatGPT MD > LM Studio 默认设置`\n   - LM Studio URL 应设为 `http:\u002F\u002Flocalhost:1234`\n   - 在设置中指定默认模型（例如 `lmstudio@your-model-name`）\n5. **开始聊天**：使用 `ChatGPT MD: Chat` 命令与配置的默认模型对话，或在单个笔记中覆盖设置：\n   ```yaml\n   ---\n   model: lmstudio@your-model-name  # 如需覆盖默认值\n   temperature: 0.7\n   ---\n   ```\n\n### 查找你的模型名称\n\n- **Ollama**：在终端运行 `ollama list` 查看已安装的模型\n- **LM Studio**：在 LM Studio 界面中查看已加载模型的名称\n\n### 本地 LLM 重要说明\n\n- **默认模型配置**：在设置中将你偏好的本地模型设为默认值——其使用方式与云服务完全相同\n- **按笔记覆盖**：可通过 frontmatter 在单个笔记中覆盖默认模型，与其他提供商一致\n- **模型发现**：使用 `ollama list`（Ollama）或检查 LM Studio 界面，找到可用于配置的可用模型名称\n\n## 功能\n* **交互式对话**：  \n  * 从任意 Markdown 笔记直接与 ChatGPT、OpenRouter.ai 模型和 Ollama 互动，实时编辑问题或回复，并无缝继续对话。\n* **隐私保护 & 零 API 费用**：  \n  * 通过 Ollama 使用本地 LLM，将聊天保留在本地计算机，避免 API 费用。\n* **支持联网的模型**：  \n  * 通过 OpenAI 的 `gpt-4o-search-preview` 和 Perplexity 的 `openrouter@perplexity\u002Fllama-3.1-sonar-small-128k-online`（通过 openrouter.ai）获取实时网络信息。\n* **多 AI 提供商支持**：  \n  * 可选择 OpenAI、OpenRouter.ai（提供 Gemini、Claude、DeepSeek、Llama、Perplexity 等模型）或通过 Ollama 使用本地模型。\n* **系统指令（System Commands）**：  \n  * 通过系统指令指导 LLM，获得最佳回答。\n* **链接上下文（Link context）**：  \n  * 在对话中提供指向知识库中任意其他笔记的链接（Markdown 或 Wiki 链接），以增强上下文。\n* **按笔记配置（Per-note Configuration）**：  \n  * 通过 frontmatter 覆盖默认设置，使用来自 [OpenAI API](https:\u002F\u002Fplatform.openai.com\u002Fdocs\u002Fapi-reference\u002Fchat)、[OpenRouter.ai](https:\u002F\u002Fopenrouter.ai\u002Fdocs) 或 [Ollama API](https:\u002F\u002Fgithub.com\u002Follama\u002Follama\u002Fblob\u002Fmain\u002Fdocs\u002Fapi.md#generate-a-chat-completion) 的参数。\n* **Markdown 支持**：  \n  * 完整渲染所有回复中的列表、代码块等内容。\n* **极简设置**：  \n  * 使用你的 OpenAI API 密钥、OpenRouter.ai API 密钥，或通过 Ollama 在本地安装任意 LLM。\n* **注释块（Comment Blocks）**：  \n  * 使用注释块忽略笔记中的部分内容。\n* **聊天模板（Chat Templates）**：  \n  * 为重复场景使用和共享 frontmatter 模板。探索 [chatgpt-md-templates](https:\u002F\u002Fgithub.com\u002Fbramses\u002Fchatgpt-md-templates)。\n\n## 隐私与安全\n\nChatGPT MD  \n- 仅将数据本地存储在你的知识库中，无任何追踪，除直接调用 AI API（OpenAI、OpenRouter.ai）外无第三方集成。\n- 允许你使用 Ollama（本地 LLM 安装）进行离线的对话式知识探索。\n\n### 默认配置\n该插件预置了均衡的默认配置，让你立即开始使用。  \n你可以更改全局设置，或通过 frontmatter 在任意笔记中使用本地参数  \n（在笔记第一行输入 `---` 即可添加属性）\n```\n---\nsystem_commands: ['You are a helpful assistant.']\ntemperature: 0.3\ntop_p: 1\nmax_tokens: 300\npresence_penalty: 0.5\nfrequency_penalty: 0.5\nstream: true\nstop: null\nn: 1\nmodel: gpt-5-mini\n\n# 服务特定 URL（可选，未指定时将使用全局设置）\nopenaiUrl: https:\u002F\u002Fapi.openai.com\n# openrouterUrl: https:\u002F\u002Fopenrouter.ai\n```\n\n# ollamaUrl: http:\u002F\u002Flocalhost:11434\n---\n```\n💡 小贴士：对于推理、编程或文本生成等更复杂的任务，可将 `max_tokens` 增加至更高值（例如 `4096`）。\n默认模型 `gpt-5-mini` 针对速度和效率进行了优化。如需更强的推理能力，请升级到 `gpt-5`；若需超轻量级响应，可使用 `gpt-5-nano`。\n\n### 工具\n\n1. **安装**：通过 Obsidian 更新或安装 v3.0.0 或更高版本  \n2. **配置**：设置 → ChatGPT MD → 工具调用（Tool Calling）→ 启用  \n3. **可选**：添加 [Brave Search API 密钥](https:\u002F\u002Fbrave.com\u002Fsearch\u002Fapi\u002F)（免费额度：每月 1,000 次查询）  \n4. **聊天**：使用 `ChatGPT MD: Chat` 命令。AI 在需要时会请求使用工具。\n\n本实现采用三层审批模式：\n\n1. **执行层（Execution Layer）**：AI 请求使用工具并附带参数  \n2. **处理层（Processing Layer）**：工具通过 Obsidian 的 API 在你的知识库（vault）中本地执行（支持文件名和内容的全文搜索）  \n3. **审批层（Approval Layer）**：交互式弹窗允许你在结果返回给 AI 前进行筛选\n\n### 可用工具\n\n**知识库搜索（Vault Search）** (`vault_search`)  \n- 多词 OR 搜索：在你的知识库中匹配任意查询词  \n- 同时搜索文件名和文件内容  \n- 排除当前文件以防止递归  \n- 可配置结果数量上限（默认：5 个文件）  \n- 支持查询编辑：执行前可调整搜索词\n\n**文件读取（File Read）** (`file_read`)  \n- 当 AI 知道具体文件路径时，可直接访问文件  \n- 支持批量读取多个文件  \n- 经你批准后提取完整内容  \n- 适用于发现文件后的定向查询\n\n**网络搜索（Web Search）** (`web_search`)  \n- 基于 Brave Search API（注重隐私，每月免费 1,000 次查询）  \n- 支持自定义搜索提供者（用于自托管端点）  \n- 可选完整网页内容抓取  \n- 自动验证 API 密钥——仅在配置后显示该工具  \n- 支持查询编辑：执行前可修改网络搜索查询\n\n### 隐私与安全\n\n- **本地优先执行（Local-First Execution）**：所有知识库操作完全在 Obsidian 的 API 内运行  \n- **选择性共享（Selective Sharing）**：多选弹窗让你精确控制要共享的结果  \n- **无遥测（No Telemetry）**：零追踪或分析——工具使用保持私密\n\n### 配置\n\n在 **设置 → ChatGPT MD → 工具调用** 中启用工具调用：\n\n- **启用工具调用（Enable Tool Calling）**：总开关（默认：禁用）  \n- **Brave Search API 密钥（Brave Search API Key）**：你的 Brave Search API 密钥  \n- **自定义提供者 URL（Custom Provider URL）**：自托管搜索端点  \n- **最大网络结果数（Max Web Results）**：返回的网络结果数量（1–10）\n\n### 使用场景\n\n**研究助手**： “在我的知识库中搜索关于量子计算算法的笔记，以及该主题的最新论文”\n\n→ AI 发现相关笔记 → 你批准要共享的文件 → AI 整合并引用信息\n\n**知识整合**： “找出我所有第三季度的会议笔记，并总结关于产品路线图的关键决策”\n\n→ 知识库搜索返回会议文件 → 你选择相关文件 → AI 提取并总结决策\n\n**增强型写作**： “在网上搜索最新的气候变化统计数据，并将其整合到我的文章中”\n\n→ 网络搜索获取最新数据 → 你筛选可靠来源 → AI 将引用整合进草稿\n\n**交叉引用发现**： “找出同时提到机器学习和效率技巧的笔记”\n\n→ 多词 OR 搜索发现交集 → 你批准有趣的关联 → AI 突出你可能忽略的模式\n\n⚠️ **注意**：工具支持取决于模型能力。旧版模型可能不支持函数调用。启用工具支持后，可在工具选择列表中查看各模型的工具能力。\n\n\n### 多模型聊天（Multi Model Chats）\n你可以在笔记中为每次请求设置和更改模型。  \n通过 frontmatter 指定 `model` 属性：\n\n对于 OpenAI 模型（包括最新的 GPT-5 系列）：\n```\n---\nmodel: gpt-5  # 或 gpt-5-mini, gpt-5-nano, gpt-5-chat-latest\nsystem_commands: [act as a senior javascript developer]\n---\n```\nOllama 模型前加 `ollama@` 前缀，LM Studio 模型前加 `lmstudio@` 前缀：\n```\n---\nmodel: ollama@gemma2:27b\ntemperature: 1\n---\n```\n\n\nAI 回复将在回复标题中保留所用模型名称，便于日后参考。  \n你可以通过终端命令 `ollama list` 查看已安装的 Ollama 模型名称，或在 [OpenAI 模型页面](https:\u002F\u002Fplatform.openai.com\u002Fdocs\u002Fmodels) 查看可用的 OpenAI 模型列表。\n\n### 服务 URL\n每个 AI 服务都有其专用的 URL 参数，可在设置中全局配置，或通过 frontmatter 在单个笔记中配置：\n\n```\n---\n# 对于 OpenAI\nopenaiUrl: https:\u002F\u002Fapi.openai.com\n\n# 对于 OpenRouter\nopenrouterUrl: https:\u002F\u002Fopenrouter.ai\n\n# 对于 Ollama\nollamaUrl: http:\u002F\u002Flocalhost:11434\n---\n```\n\n默认 URL 如下：\n- OpenAI: `https:\u002F\u002Fapi.openai.com`  \n- OpenRouter: `https:\u002F\u002Fopenrouter.ai`  \n- Ollama: `http:\u002F\u002Flocalhost:11434`\n\n注意：旧版本使用单一的 `url` 参数，现已弃用。请更新你的模板和笔记，改用服务专用的 URL 参数。\n\n### 命令 👨‍💻\n通过 Obsidian 的命令面板（`cmd + p` 或 `ctrl + p`）运行命令，输入 `chatgpt`，或设置快捷键  \n（强烈建议为聊天命令设置快捷键（我个人使用 `cmd + j`，效果极佳，因为食指本来就放在该键上））。\n\n#### 主要命令\n- **Chat**：解析文件并与 ChatGPT 交互。建议分配快捷键，例如 `cmd + j`。\n\n#### 创建命令\n- **New Chat with Highlighted Text**：使用高亮文本和 `Chat Folder` 中的默认 frontmatter 启动聊天。  \n- **New Chat From Template**：从 `Chat Template Folder` 中的模板创建聊天。\n\n#### 实用命令\n- **Infer Title**：根据笔记内容自动生成标题。可配置为在 4 条以上消息后自动运行。  \n- **Add Comment Block**：插入注释块，标记笔记中应被忽略的部分。  \n- **Select Model**：从所有可用的大语言模型（LLM）（OpenAI、OpenRouter.ai、Ollama）中选择，并为当前笔记设置模型。\n\n#### 维护命令\n- **Clear Chat**：清除所有消息，但保留 frontmatter。  \n- **Stop Streaming (仅限桌面版)**：必要时停止正在进行的流式输出。\n\n#### 格式化工具\n- **Add Divider**：插入水平分隔线，以视觉方式组织内容。\n\n## Beta 测试 🧪\n想在功能正式发布前抢先体验最新特性吗？你可以使用社区插件 [BRAT (Beta Reviewer's Auto-update Tool)](https:\u002F\u002Fgithub.com\u002FTfTHacker\u002Fobsidian42-brat) 来参与 ChatGPT MD 的 Beta 测试：\n\n1. 从 Obsidian 的社区插件（Community Plugins）中安装 BRAT 插件  \n2. 打开 BRAT 设置，添加 `bramses\u002Fchatgpt-md` 作为 Beta 插件  \n3. 在 BRAT 插件设置的下拉菜单中选择 \"latest version\"（最新版本）  \n4. 在你的社区插件列表中启用 ChatGPT MD 插件  \n\n这样你就能在新功能仍在开发和测试阶段时提前使用它们。\n\n⚠️ **警告**：Beta 测试存在风险，需自行承担后果。请务必在全新的空库（vault）中测试 Beta 版本，切勿在主库中使用。Beta 功能可能出现故障，甚至导致数据丢失。\n\n## 常见问题 ❓\n#### 如何开始与 ChatGPT MD 聊天？\n在任意笔记中，通过 Obsidian 命令面板（Command Palette，快捷键 `cmd + p` 或 `ctrl + p`）执行 `ChatGPT MD: Chat` 命令即可开始对话。\n\n#### 我可以为 `ChatGPT MD: Chat` 命令设置快捷键吗？\n当然可以！建议你这样做：进入 `设置 > 快捷键（Settings > Hotkeys）`，搜索 `ChatGPT MD: Chat`，然后绑定你喜欢的快捷键（例如 `cmd + j`）。\n\n#### 如何使用聊天和推理模型？\n你可以使用 OpenAI 的 GPT-3 和 GPT-4 模型，也可以通过 OpenRouter.ai 使用多种模型（如 Claude、Gemini、DeepSeek、Llama、Perplexity 等），或者使用通过 Ollama 安装的任意本地模型。  \n通过 Ollama 本地运行的 DeepSeek-r1:7b 模型在推理任务上表现非常出色。\n\n#### 如何使用自定义端点（custom endpoint）？\n请确保你的自定义 API 符合 OpenAI 的规范，例如 Azure 托管的端点。关于 API 密钥管理的具体细节，请咨询你的服务提供商。\n\n#### 我应该在哪里添加我的 OpenAI API 密钥？\n在插件设置中添加你的 OpenAI API 密钥，或者安装 Ollama 并选择你喜欢的本地大语言模型（LLM）。\n\n#### Frontmatter 中的 'url' 参数怎么了？\n单一的 'url' 参数现已弃用。从 v2.2.0 版本开始，我们引入了针对不同服务的 URL 参数：`openaiUrl`、`openrouterUrl` 和 `ollamaUrl`。这使得配置不同服务时更加灵活清晰。请相应地更新你的模板和笔记。\n\n🤖 尽情探索 ChatGPT MD 在你的 Obsidian 库中的强大功能吧！🚀\n\n## 欢迎贡献 🤝\n\n我们非常欢迎并鼓励任何形式的贡献，包括拉取请求（Pull Requests）、错误报告（bug reports）等！:octocat:\n\n### 开发环境搭建\n\n```bash\n# 克隆仓库\ngit clone https:\u002F\u002Fgithub.com\u002Fbramses\u002Fchatgpt-md.git\ncd chatgpt-md\n\n# 安装依赖\nyarn install\n\n# 开发模式（监听文件变化）\nyarn dev\n\n# 运行测试\nyarn test\n\n# 运行带覆盖率的测试\nyarn test:coverage\n\n# 代码检查\nyarn lint\nyarn lint:fix\n\n# 生产构建\nyarn build\n```\n\n### 测试\n\n项目使用 Jest 进行测试，包含 104 个覆盖工具函数的测试用例。在提交 PR 前，请确保：\n\n1. 运行 `yarn test` 确保所有测试通过  \n2. 运行 `yarn lint` 检查代码质量  \n3. 运行 `yarn build` 验证构建成功  \n\n### 代码质量标准\n\n- **复杂度**：函数应少于 50 行，圈复杂度（cyclomatic complexity）≤15  \n- **类型安全**：尽量减少 `any` 的使用，优先使用显式类型  \n- **异步安全**：所有 Promise 必须被正确处理（await、catch 或显式忽略）  \n- **测试**：为 `src\u002FUtilities\u002F*.test.ts` 中新增的工具函数编写测试  \n\n### 提交前钩子（Pre-commit Hooks）\n\n在执行 `git commit` 时会自动运行以下钩子：\n- ESLint 自动修复代码风格问题  \n- Prettier 格式化代码  \n- 仅检查已暂存（staged）的文件  \n\n### CI\u002FCD\n\nGitHub Actions 会在每次拉取请求（Pull Request）时自动运行以下检查：\n- 代码风格检查（Lint）  \n- TypeScript 类型检查  \n- 测试套件及覆盖率  \n- 生产环境构建  \n\n### 项目结构\n\n```\nsrc\u002F\n├── Commands\u002F           # Obsidian 命令处理器\n├── Services\u002F           # 业务逻辑与 AI 适配器\n├── Views\u002F              # UI 组件与模态框\n├── Utilities\u002F          # 纯工具函数（经过充分测试）\n├── Models\u002F             # TypeScript 接口\n├── Types\u002F              # 类型定义\n└── core\u002F               # 依赖注入容器\n```\n\n更多开发文档详见 [CLAUDE.md](CLAUDE.md) 和 [docs\u002Fdevelopment.md](docs\u002Fdevelopment.md)。\n\n### 提交更改\n\n1. Fork 本仓库  \n2. 创建功能分支（`git checkout -b feature\u002Famazing-feature`）  \n3. 进行修改（包括测试、代码检查和文档）  \n4. 提交更改（`git commit -m 'Add amazing feature'`）  \n5. 推送到分支（`git push origin feature\u002Famazing-feature`）  \n6. 发起 Pull Request  \n\n你的 PR 将由 CI 自动检查。请确保所有检查通过后再请求审核！\n\n## 关于开发者 ✍️\nBram 于 2023 年 3 月创建了 ChatGPT MD，现居纽约，正在开发 [Your Commonbase](https:\u002F\u002Fbramses.notion.site\u002FYour-Commonbase-ALPHA-10b034182ddd8038b9ffe11cc2833713)（一个零压力存储、搜索和分享的自组织剪贴簿）。他的个人网站和通讯位于 [bramadams.dev](https:\u002F\u002Fwww.bramadams.dev\u002F)。\n\nDeniz 于 2024 年加入 Bram 继续开发工作。他在德国一家游戏公司工作，并在工作和生活中大量使用 AI。欢迎在 Bluesky 上向他打招呼：[Deniz](https:\u002F\u002Fbsky.app\u002Fprofile\u002Fdenizokcu.bsky.social)\n\n祝你使用 ChatGPT MD 写作愉快！💻 🎉","# ChatGPT MD 快速上手指南\n\n## 环境准备\n\n- **操作系统**：Windows \u002F macOS \u002F Linux（需支持 Obsidian）\n- **依赖软件**：\n  - [Obsidian](https:\u002F\u002Fobsidian.md)（最新版）\n  - （可选）[Ollama](https:\u002F\u002Follama.ai)（用于本地大模型，国内用户可使用清华镜像加速下载）\n  - （可选）[LM Studio](https:\u002F\u002Flmstudio.ai)\n  - （可选）OpenAI 或 OpenRouter API Key（如需使用云端模型）\n\n> 💡 国内建议：  \n> 安装 Ollama 时，可配置国内镜像加速模型下载（如 `OLLAMA_MODELS=你的模型名 OLLAMA_HOST=0.0.0.0:11434` 配合代理或镜像源），但核心服务仍需联网。\n\n## 安装步骤\n\n1. 打开 Obsidian，进入 `设置 > 社区插件 > 浏览`\n2. 搜索 `ChatGPT MD`，点击 **安装**\n3. 启用插件后，进入 `设置 > ChatGPT MD` 配置 API 或本地模型：\n   - **使用 OpenAI**：填入你的 `OpenAI API Key`\n   - **使用 Ollama**：\n     ```bash\n     # 安装 Ollama 后，在终端拉取模型（示例）\n     ollama pull llama3.2\n     ollama pull qwen2.5\n     ```\n     然后在插件设置中指定默认模型为 `ollama@llama3.2`\n   - **使用 LM Studio**：启动其本地服务器（默认 `http:\u002F\u002Flocalhost:1234`），并在插件中配置对应模型名（格式：`lmstudio@your-model-name`）\n\n## 基本使用\n\n1. 在任意笔记中按下 `Ctrl + P`（Windows\u002FLinux）或 `Cmd + P`（macOS）\n2. 输入并选择命令：`ChatGPT MD: Chat`\n3. 开始对话！例如输入：\n   ```\n   请帮我总结这篇笔记的主要观点。\n   ```\n\n### 示例：使用本地模型（Ollama）\n\n在笔记开头添加 frontmatter 覆盖默认设置：\n\n```yaml\n---\nmodel: ollama@qwen2.5\ntemperature: 0.7\n---\n```\n\n然后通过 `ChatGPT MD: Chat` 发起对话，即可使用 Qwen2.5 本地模型，无需联网、无 API 费用。\n\n> 🔥 提示：建议为 `ChatGPT MD: Chat` 设置快捷键（如 `Cmd + J`），大幅提升使用效率。","一位独立开发者正在用 Obsidian 整理个人知识库，同时规划一个开源项目的架构设计和文档撰写。\n\n### 没有 chatgpt-md 时\n- 需要在 Obsidian 和 ChatGPT 网页之间频繁切换，打断写作流，效率低下。\n- 无法直接让 AI 参考当前笔记中的技术方案或链接到的相关文档，导致回答泛泛而谈。\n- 想用本地大模型（如 Llama 3.2）保护项目隐私，但缺乏与 Obsidian 的集成，只能手动复制粘贴。\n- 每次提问都要重复说明上下文（比如“这是我的项目架构草稿”），沟通成本高。\n- 若想尝试不同 AI 角色（如“技术文档助手”或“代码审查员”），需手动调整提示词，操作繁琐。\n\n### 使用 chatgpt-md 后\n- 直接在 Obsidian 内通过快捷键（如 Cmd+J）唤出对话窗口，边写边问，无缝衔接思考与写作。\n- 启用工具调用功能后，AI 可请求访问当前笔记或关联文件，在用户授权后精准引用内容生成建议。\n- 配置 Ollama 本地模型（如 llama3.2）作为默认后端，所有对话数据保留在本地，兼顾隐私与零 API 成本。\n- 创建名为“架构顾问”的 Agent，预设系统提示和温度参数，一键应用到相关笔记，确保输出风格一致。\n- 利用 AI Wizard 快速生成新角色（如“API 文档生成器”），自动填充专业提示词，大幅降低使用门槛。\n\nchatgpt-md 将 AI 助手深度融入 Obsidian 工作流，让知识创作从“来回切换”变为“所思即所得”。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fbramses_chatgpt-md_7bc7f9bd.gif","bramses","Bram Adams","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fbramses_628b9509.jpg","Hunters must always be on the hunt for something! \r\n\r\n","@your-commonbase","NYC",null,"https:\u002F\u002Flinktr.ee\u002Fbramses","https:\u002F\u002Fgithub.com\u002Fbramses",[85,89,93],{"name":86,"color":87,"percentage":88},"TypeScript","#3178c6",78.4,{"name":90,"color":91,"percentage":92},"JavaScript","#f1e05a",21.3,{"name":94,"color":95,"percentage":96},"CSS","#663399",0.3,1361,98,"2026-04-03T07:14:10","MIT","Linux, macOS, Windows","未说明",{"notes":104,"python":102,"dependencies":105},"该工具是 Obsidian 插件，需先安装 Obsidian。支持通过 OpenAI API、OpenRouter.ai 或本地 LLM（如 Ollama、LM Studio）运行。使用本地模型时需单独安装 Ollama（https:\u002F\u002Follama.ai）或 LM Studio（https:\u002F\u002Flmstudio.ai），并确保其服务在本地启动。Ollama 默认监听 http:\u002F\u002Flocalhost:11434，LM Studio 默认监听 http:\u002F\u002Flocalhost:1234。工具调用功能默认关闭，需手动启用并可选配置 Brave Search API 密钥以支持网络搜索。所有数据默认仅存储在本地库中，无第三方追踪。",[],[26,15,53],5,"2026-03-27T02:49:30.150509","2026-04-06T07:04:52.366738",[111,116,121,126,131,136,141,146],{"id":112,"question_zh":113,"answer_zh":114,"source_url":115},158,"在手机端无法通过远程 Ollama 地址（如 192.168.1.25）选择模型怎么办？","此问题已在 2.2.0 版本中解决。若仍遇到问题，请确保启动 Ollama 时设置了允许所有来源（allow all origins），例如：`OLLAMA_ORIGINS=* ollama serve`。这样可解决移动端跨域访问模型列表的问题。","https:\u002F\u002Fgithub.com\u002Fbramses\u002Fchatgpt-md\u002Fissues\u002F145",{"id":117,"question_zh":118,"answer_zh":119,"source_url":120},153,"Ollama 在 2.13.1-beta 版本中无法正常工作怎么办？","可以尝试在 ChatGPT MD 设置中将 stream 选项设为 false，或者在笔记开头添加如下 frontmatter：\n```markdown\n---\nstream: false\n---\n```\n这有助于缩小问题排查范围。此外，也可以尝试使用 LM Studio 作为本地 LLM 的替代方案。","https:\u002F\u002Fgithub.com\u002Fbramses\u002Fchatgpt-md\u002Fissues\u002F193",{"id":122,"question_zh":123,"answer_zh":124,"source_url":125},154,"设置了 model: gpt-4，但模型仍返回 gpt-3 的结果，如何解决？","目前只有在笔记文件中明确指定的 frontmatter 才能覆盖使用的模型。设置中的默认 frontmatter 存在一个高优先级 bug（已在 #108 修复）。请确保在笔记顶部使用正确的模型名称，可参考 OpenAI 官方模型列表：https:\u002F\u002Fplatform.openai.com\u002Fdocs\u002Fmodels","https:\u002F\u002Fgithub.com\u002Fbramses\u002Fchatgpt-md\u002Fissues\u002F74",{"id":127,"question_zh":128,"answer_zh":129,"source_url":130},155,"按回车键无法提交提示，光标只是换行怎么办？","不要直接按回车发送提示，而是应使用“Chat Command”命令触发对话。例如，在笔记中写入“Write this in proper English”，然后粘贴要检查的文本，再执行“Chat Command”。之后可删除原始请求，仅保留 AI 返回的内容。","https:\u002F\u002Fgithub.com\u002Fbramses\u002Fchatgpt-md\u002Fissues\u002F169",{"id":132,"question_zh":133,"answer_zh":134,"source_url":135},156,"是否支持 Google Gemini \u002F Vertex AI 的直连 API（不通过 OpenRouter）？","是的，从 2.6.0 版本开始已添加对 Google Gemini \u002F Vertex AI 直连 API 的支持。你可以使用 Beta 版本进行测试，但请务必备份数据。该功能在正式发布前仍在全面测试中。","https:\u002F\u002Fgithub.com\u002Fbramses\u002Fchatgpt-md\u002Fissues\u002F166",{"id":137,"question_zh":138,"answer_zh":139,"source_url":140},157,"能否仅使用 OpenRouter API 而不提供 OpenAI 密钥？","可以。此前存在必须填写 OpenAI 密钥的限制，但该问题已在 2.3.4 版本中通过 PR #151 修复。更新插件后，只需配置 OpenRouter 密钥即可正常使用，无需连接 OpenAI 服务器。","https:\u002F\u002Fgithub.com\u002Fbramses\u002Fchatgpt-md\u002Fissues\u002F152",{"id":142,"question_zh":143,"answer_zh":144,"source_url":145},159,"使用本地 LLM（如 LM Studio）时是否仍需填写 OpenAI API 密钥？","不需要。早期版本存在强制要求输入 OpenAI 密钥的问题，但该问题已在后续版本中修复。使用本地 LLM 时，只需正确配置对应的 API 端点（如 http:\u002F\u002Flocalhost:1234\u002Fv1）即可，无需提供 OpenAI 密钥。","https:\u002F\u002Fgithub.com\u002Fbramses\u002Fchatgpt-md\u002Fissues\u002F168",{"id":147,"question_zh":148,"answer_zh":149,"source_url":150},160,"AI 回复内容太短，经常在句子中间截断，如何让其自动继续并完整输出？","这可能是由于模型自身的 token 限制或停止策略导致的。建议尝试调整 API 参数，如 `stop`、`frequency_penalty` 和 `presence_penalty`，以影响生成行为。具体参数说明可参考 OpenAI 文档：https:\u002F\u002Fplatform.openai.com\u002Fdocs\u002Fapi-reference\u002Fchat\u002Fcreate","https:\u002F\u002Fgithub.com\u002Fbramses\u002Fchatgpt-md\u002Fissues\u002F27",[152,157,162,167,172,177,182,187,191,196,201,206,211,216,221,226,231,236,241,246],{"id":153,"version":154,"summary_zh":155,"released_at":156},99834,"3.1.0","v3.1.0 — Agents\r\n\r\n  Build your own AI team, right inside Obsidian.\r\n\r\n  Agents are reusable AI personas that live as Markdown files in your vault. Each agent carries its own model, temperature, and system prompt — so you can switch between a creative writing partner, a code reviewer, and a research assistant in\r\n  seconds.\r\n\r\n  Create agents in two ways\r\n\r\n  AI Wizard — Just describe what you need. \"A Socratic tutor that teaches through questions\" — the AI generates a name, tunes the temperature, and writes a comprehensive system prompt. Review it, tweak it if you want, save.\r\n\r\n  Manual — Full control. Pick your model (with autocomplete across all your configured providers), dial in the temperature, write your system prompt.\r\n\r\n  Use them anywhere\r\n\r\n  Run Choose Agent on any note. The agent's settings merge seamlessly with your note's frontmatter — your per-note overrides still win. Switch agents mid-conversation. Mix and match.\r\n\r\n  What else is new\r\n\r\n  Streaming is now rock-solid. Tables, code blocks, and other block-level markdown no longer corrupt during streaming. The new line-boundary flushing engine writes content at natural breakpoints, eliminating the cursor race conditions that\r\n  caused visual glitches.\r\n\r\n  Dependencies updated across the board — all packages at their latest compatible versions.\r\n\r\n  ---\r\n  Getting Started\r\n\r\n  1. Open Settings → ChatGPT MD and set your Agent Folder (default: ChatGPT_MD\u002Fagents)\r\n  2. Run the Create new agent command\r\n  3. Choose AI Wizard or Manual\r\n  4. Apply it to any chat note with Choose Agent\r\n\r\n  Your agents are just Markdown files — version them, share them, sync them across devices. They're yours.\r\n\r\n\r\n**Full Changelog**: https:\u002F\u002Fgithub.com\u002Fbramses\u002Fchatgpt-md\u002Fcompare\u002F3.0.1...3.1.0","2026-02-11T19:05:50",{"id":158,"version":159,"summary_zh":160,"released_at":161},99835,"3.0.3-beta","fixes broken tables when streaming","2026-02-11T07:44:02",{"id":163,"version":164,"summary_zh":165,"released_at":166},99836,"3.0.2-beta","introduces agents","2026-02-09T22:27:37",{"id":168,"version":169,"summary_zh":170,"released_at":171},99837,"3.0.1","adds z.ai Provider and simplifies the settings UI","2026-02-08T18:08:30",{"id":173,"version":174,"summary_zh":175,"released_at":176},99838,"3.0.0","🚀 ChatGPT MD v3.0.0 — Privacy-First AI Tool Calling\r\n\r\n  Your AI assistant can now actively search your vault, read files, and query the web—with a human-in-the-loop architecture that keeps you in complete control.\r\n\r\n  This release introduces a tool calling system built on privacy-first principles. When your AI needs information, it requests permission to use tools—you approve execution, review results, and\r\n   control exactly what gets shared back to the model. Nothing leaves your vault without explicit consent.\r\n\r\n  ---\r\n  ✨ Key Features\r\n\r\n  🔍 Vault Search\r\n\r\n  - AI discovers relevant notes across your entire vault\r\n  - Multi-word OR search matches ANY query term\r\n  - Searches both filenames and content simultaneously\r\n  - Edit search queries before execution\r\n  - Configurable result limits (default: 5 files)\r\n\r\n  📄 File Reading\r\n\r\n  - AI can request access to specific files you've discovered\r\n  - Batch reading support for multiple files\r\n  - Full content extraction with granular file selection\r\n  - You choose exactly which files to share\r\n\r\n  🌐 Web Search\r\n\r\n  - Powered by Brave Search API (privacy-focused, 1,000 free queries\u002Fmonth)\r\n  - Custom search provider support for self-hosted endpoints\r\n  - Edit web queries before execution\r\n  - Review and filter results before sharing\r\n  - Only appears when API key is configured\r\n\r\n  ✅ Three-Layer Approval System\r\n\r\n  Every tool call goes through explicit approval:\r\n\r\n  1. Execution Approval — See what the AI wants to do, edit parameters if needed\r\n  2. Results Review — See what the tool found\r\n  3. Selective Sharing — Choose exactly which results reach the AI\r\n\r\n  🔒 Privacy-First Design\r\n\r\n  - Local-first execution: All vault operations run entirely within Obsidian's API\r\n  - No telemetry: Zero tracking or analytics—tool usage stays private\r\n  - Opt-in only: All tools disabled by default\r\n  - Selective sharing: Multi-select modals let you choose exactly what to share\r\n\r\n  ---\r\n  🎯 Supported AI Providers\r\n\r\n  Tool calling works with all 6 providers:\r\n  - ✅ OpenAI (GPT-4, GPT-4o, o1, o3-mini)\r\n  - ✅ Anthropic (Claude 3.5, Claude 3)\r\n  - ✅ Google Gemini (Gemini 2.0, 1.5)\r\n  - ✅ OpenRouter (100+ models with tool support)\r\n  - ✅ Ollama (Local models with function calling)\r\n  - ✅ LM Studio (Local models)\r\n\r\n  Note: Not all models support tool calling. The plugin includes a whitelist of 161 patterns covering 194 verified models. Visual indicators show tool compatibility in the model selector.\r\n\r\n  ---\r\n  🚀 Getting Started\r\n\r\n  1. Update: Install v3.0.0 from Obsidian Community Plugins\r\n  2. Enable: Go to Settings → ChatGPT MD → Tool Calling → Enable\r\n  3. Optional: Add https:\u002F\u002Fbrave.com\u002Fsearch\u002Fapi\u002F for web search (free tier: 1,000 queries\u002Fmonth)\r\n  4. Chat: Use the ChatGPT MD: Chat command—AI will request tool use when needed\r\n\r\n  ---\r\n  💡 Use Cases\r\n\r\n  Research Assistant\r\n  \"Search my vault for notes about quantum computing and find recent papers on the topic\"\r\n\r\n  → AI discovers relevant notes → You approve which files to share → AI synthesizes with proper attribution\r\n\r\n  Knowledge Synthesis\r\n  \"Find all my Q3 meeting notes and summarize key decisions about the product roadmap\"\r\n\r\n  → Vault search returns meeting files → You select the relevant ones → AI extracts and summarizes\r\n\r\n  Web-Enhanced Writing\r\n  \"Search the web for latest climate change statistics and incorporate them into my article\"\r\n\r\n  → Web search fetches current data → You filter reliable sources → AI integrates citations\r\n\r\n  Cross-Reference Discovery\r\n  \"Find notes that mention both machine learning and productivity techniques\"\r\n\r\n  → Multi-word search finds intersections → You approve interesting connections → AI highlights patterns\r\n\r\n  ---\r\n  🏗️ Architecture Improvements\r\n\r\n  This release includes significant under-the-hood improvements:\r\n\r\n  - Unified AI Provider Service — Consolidated 6 separate services into one with adapter pattern\r\n  - Service Container — Cleaner dependency injection replacing the old ServiceLocator\r\n  - Modular Command Handlers — Extracted monolithic CommandRegistry into focused handlers\r\n  - Enhanced Streaming — Improved real-time response handling\r\n  - Updated Dependencies — Latest Vercel AI SDK v6, TypeScript 5.9.3, and more\r\n\r\n  ---\r\n  🔄 Backward Compatibility\r\n\r\n  - ✅ No breaking changes — existing configurations work unchanged\r\n  - ✅ Tools disabled by default — existing users unaffected\r\n  - ✅ Settings migration — automatic upgrade handling\r\n\r\n  ---\r\n  📋 Full Changelog\r\n\r\n  Added\r\n\r\n  - Privacy-first AI tool calling system with three-layer approval\r\n  - Vault search tool with query editing\r\n  - File read tool with batch support\r\n  - Web search tool via Brave Search API\r\n  - Custom search provider support\r\n  - Tool approval modals with editable parameters\r\n  - Search results approval modal with file selection\r\n  - Web search results modal with source filtering\r\n  - Model whitelist for tool support (161 patterns, 194 verified models)\r\n  - Tool compatibility indicat","2026-02-01T19:36:17",{"id":178,"version":179,"summary_zh":180,"released_at":181},99839,"2.13.3-beta","**Full Changelog**: https:\u002F\u002Fgithub.com\u002Fbramses\u002Fchatgpt-md\u002Fcompare\u002F2.13.2-beta...2.13.3-beta","2026-02-01T18:27:15",{"id":183,"version":184,"summary_zh":185,"released_at":186},99840,"2.13.2-beta","**Full Changelog**: https:\u002F\u002Fgithub.com\u002Fbramses\u002Fchatgpt-md\u002Fcompare\u002F2.13.1-beta...2.13.2-beta","2026-02-01T17:22:08",{"id":188,"version":189,"summary_zh":81,"released_at":190},99841,"2.13.1-beta","2025-12-27T08:59:10",{"id":192,"version":193,"summary_zh":194,"released_at":195},99842,"2.13.0-beta","## 🚀 What's New in v3.0.0: Privacy-First AI Tool Calling\r\n\r\n**Your AI assistant can now search your vault, read files, and search the web—with explicit approval at every step.**\r\n\r\n### Key Features\r\n\r\n- **🔍 Vault Search**: AI discovers relevant notes in your vault (you approve which files to share)\r\n- **📄 File Reading**: AI can request access to specific files (you select which ones)\r\n- **🌐 Web Search**: AI searches the web via Brave Search API (1,000 free queries\u002Fmonth)\r\n- **✅ Three-Layer Approval System**: \r\n  1. Approve what the AI wants to do\r\n  2. Review what it found\r\n  3. Select exactly which results to share\r\n- **🔒 Privacy-First Design**: No data reaches the AI without your explicit consent\r\n- **🎯 All Providers Supported**: OpenAI, Anthropic, Gemini, OpenRouter, Ollama, LM Studio\r\n- **⚙️ Disabled by Default**: Opt-in feature only—enable in Settings → Tool Calling\r\n\r\n### Why This Matters\r\n\r\nFor privacy-conscious note-takers, this is a game-changer. You get the power of AI with full control over your data. Your vault stays yours.\r\n\r\n### Getting Started with Tool Calling\r\n\r\n1. **Install the beta**: Use [BRAT plugin](https:\u002F\u002Fgithub.com\u002FTfTHacker\u002Fobsidian42-brat) and select version **2.12.0-beta**\r\n2. **Enable in settings**: Go to Settings → ChatGPT MD → Tool Calling\r\n3. **Optional**: Add Brave Search API key for web search (1,000 free queries\u002Fmonth)\r\n4. **Start chatting**: Your AI will ask for approval when it wants to use tools\r\n\r\n⚠️ **Beta Warning**: Test on a backup\u002Ftest vault first. This is a beta release with active development.\r\n\r\n### Use Cases\r\n\r\n- **Research Assistant**: \"Search my vault for notes about quantum computing and find recent papers\"\r\n- **Knowledge Synthesis**: \"Find all my Q3 meeting notes and summarize key decisions\"\r\n- **Web-Enhanced Writing**: \"Search the web for latest statistics and incorporate them\"\r\n- **Note Discovery**: \"Find connections between notes I might have missed\"","2025-12-26T11:55:29",{"id":197,"version":198,"summary_zh":199,"released_at":200},99843,"2.12.0-beta","# AI Tool Calling with Privacy-First Human-in-the-Loop\r\n\r\n## Summary\r\n\r\nThis Release introduces **privacy-focused AI tool calling** to ChatGPT MD, enabling AI assistants to search your vault, read files, and search the web—with explicit user approval at every step.\r\n\r\n**Key Principle**: No data reaches the LLM without your consent.\r\n\r\n## What's New\r\n\r\n### Three Core Tools\r\n\r\n- **`vault_search`**: AI discovers relevant notes in your vault\r\n- **`file_read`**: AI requests access to specific files\r\n- **`web_search`**: AI searches the web using Brave Search API (1,000 free queries\u002Fmonth)\r\n\r\n### Three-Layer Approval System\r\n\r\n1. **Approve execution**: See what the AI wants to do\r\n2. **Review results**: See what the tool found\r\n3. **Approve sharing**: Select exactly which results to share with AI\r\n\r\nAll tools disabled by default—opt-in feature only.\r\n\r\n### Privacy Features\r\n\r\n- Human-in-the-loop at every step\r\n- Granular control over data sharing\r\n- Full transparency into AI requests\r\n- Audit trail with debug mode\r\n- All API keys stored locally\r\n\r\n## Technical Changes\r\n\r\n### Architecture\r\n- **40 files changed**: 3,632 insertions, 2,176 deletions\r\n- **New Services**: ToolService, ToolRegistry, ToolExecutor, VaultTools, WebSearchService, StreamingHandler, Logger\r\n- **New UI**: ToolApprovalModal, SearchResultsApprovalModal, WebSearchApprovalModal\r\n- **New Models**: Tool.ts with comprehensive type definitions\r\n\r\n### AI Service Updates\r\n- All 6 providers updated to support tool calling (OpenAI, Anthropic, Gemini, OpenRouter, Ollama, LM Studio)\r\n- Improved streaming response handling\r\n- Better error handling and user feedback\r\n\r\n### Settings\r\n- New \"Tool Calling\" settings section\r\n- Enable\u002Fdisable tools globally\r\n- Web search configuration (Brave Search or custom provider)\r\n- Debug mode for troubleshooting\r\n\r\n## Tool Execution Flow\r\n\r\n```\r\nAI requests tool → User approves\u002Fdenies → Tool executes → User reviews results →\r\nUser selects what to share → AI responds with approved context\r\n```\r\n\r\n### Installation via BRAT\r\n\r\n1. Install [BRAT plugin](https:\u002F\u002Fgithub.com\u002FTfTHacker\u002Fobsidian42-brat) if you haven't already\r\n2. BRAT Settings → \"Add Beta plugin\"\r\n3. Enter \"bramses\u002Fchatgpt-md\" as the repository\r\n4. BRAT will show available versions → select **2.12.0-beta**\r\n5. Enable ChatGPT MD in Community Plugins\r\n6. Settings → Tool Calling → Enable AI Tool Calling\r\n\r\n\r\n## How to Test\r\n\r\n1. Settings → Tool Calling → Enable AI Tool Calling\r\n2. Ask: \"Search my vault for notes about machine learning\"\r\n3. Approve execution → Review results → Select files to share\r\n4. Optional: Enable web search with Brave Search API key (https:\u002F\u002Fapi.search.brave.com\u002F)\r\n\r\n**⚠️ Test on backup\u002Ftest vault first!** While read-only, beta software can have unexpected behavior.\r\n\r\n## Breaking Changes\r\n\r\nNone. Feature is disabled by default.\r\n\r\n## Migration\r\n\r\nNo migration required.\r\n\r\n---\r\n\r\n**Version**: 2.12.0-beta\r\n**Branch**: ai-sdk-v6 → master\r\n","2025-12-16T11:49:33",{"id":202,"version":203,"summary_zh":204,"released_at":205},99844,"2.11.0-beta","adds a websearch tool via brave search (api key required)","2025-12-15T13:37:32",{"id":207,"version":208,"summary_zh":209,"released_at":210},99845,"2.10.0-beta","Adds tool calls to search the vault and read files. Needs to be turned on in the settings","2025-12-14T15:14:36",{"id":212,"version":213,"summary_zh":214,"released_at":215},99846,"2.9.3-beta","# 🚀 AI SDK Migration: Modernize & Simplify Streaming Architecture\r\n\r\n## Overview\r\n\r\nThis PR migrates the plugin from manual stream parsing to the [Vercel AI SDK](https:\u002F\u002Fsdk.vercel.ai\u002Fdocs), resulting in **~1000 lines of code removed** and a dramatically simplified architecture. All 6 AI providers (OpenAI, Anthropic, Google Gemini, OpenRouter, Ollama, LM Studio) now use a unified, battle-tested streaming implementation.\r\n\r\n## 🎯 What Changed\r\n\r\n### Before: Manual Everything\r\n```typescript\r\n\u002F\u002F Custom stream parsing for each provider\r\nprocessAnthropicFormat() { \u002F* 53 lines *\u002F }\r\nprocessOpenAIFormat() { \u002F* 57 lines *\u002F }\r\nprocessGeminiFormat() { \u002F* 51 lines *\u002F }\r\n\u002F\u002F Custom buffer management\r\nflushBuffer() { \u002F* 36 lines *\u002F }\r\n\u002F\u002F Service-specific payload construction\r\ncreatePayload() { \u002F* 30-40 lines per service *\u002F }\r\n```\r\n\r\n### After: AI SDK Handles It\r\n```typescript\r\n\u002F\u002F One unified streaming method\r\nconst { textStream } = streamText({\r\n  model: this.provider(modelName),\r\n  messages: aiSdkMessages,\r\n  abortSignal: abortController.signal,\r\n});\r\n\r\nfor await (const textPart of textStream) {\r\n  \u002F\u002F Direct editor updates with proper cursor tracking\r\n}\r\n```\r\n\r\n## ✨ Key Benefits\r\n\r\n### For Users\r\n- **More Reliable Streaming**: AI SDK is battle-tested across thousands of applications\r\n- **Better Error Handling**: Unified error messages and recovery\r\n- **Faster Bug Fixes**: Issues in stream parsing are fixed upstream by Vercel\r\n- **Future-Proof**: New AI providers can be added with minimal code\r\n\r\n### For Developers\r\n- **75% Less Code in ApiResponseParser** (565 → 143 lines)\r\n- **30-40% Smaller Service Files**: Each AI service is dramatically simplified\r\n- **Single Source of Truth**: No more maintaining 5 different stream parsers\r\n- **Easier to Understand**: Clear, linear code flow without complex state management\r\n\r\n## 📊 The Numbers\r\n\r\n**Total Lines Removed: ~983 lines** (nearly 1000!)\r\n\r\n### By Service:\r\n- ApiResponseParser: **75% reduction** (565 → 143 lines)\r\n- AnthropicService: **42% reduction** (~304 → ~177 lines)\r\n- OpenAiService: **36% reduction** (~225 → ~161 lines)\r\n- GeminiService: **35% reduction** (~289 → ~182 lines)\r\n- OpenRouterService: **31% reduction** (~231 → ~176 lines)\r\n- OllamaService: **24% reduction** (~175 → ~136 lines)\r\n- LmStudioService: **32% reduction** (~211 → ~160 lines)\r\n\r\n## 🔧 Technical Details\r\n\r\n### What Was Removed\r\n\r\n#### 1. Manual Stream Parsing (Phase 1)\r\n- ❌ Custom SSE\u002FJSON stream parsers for each provider\r\n- ❌ Buffer management system (6 properties, 5 methods)\r\n- ❌ Service-specific format handlers\r\n- ❌ Complex flush timers and state tracking\r\n\r\n#### 2. Legacy Streaming Infrastructure (Phase 2)\r\n- ❌ `defaultCallStreamingAPI()` - old streaming entry point\r\n- ❌ `makeStreamingRequest()` - manual HTTP streaming\r\n- ❌ `processStreamResponse()` - custom response processor\r\n\r\n#### 3. Payload Construction (Phase 3)\r\n- ❌ `createPayload()` methods in all services\r\n- ❌ Service-specific payload interfaces\r\n- ❌ Custom message format converters\r\n- ❌ Redundant error handlers\r\n\r\n### What Was Added\r\n\r\n#### Unified AI SDK Integration\r\n```typescript\r\n\u002F\u002F BaseAiService now provides two clean methods:\r\nprotected async callAiSdkStreamText(...)   \u002F\u002F For streaming\r\nprotected async callAiSdkGenerateText(...) \u002F\u002F For non-streaming\r\n```\r\n\r\nEach service simply:\r\n1. Creates its provider (e.g., `createOpenAI()`, `createAnthropic()`)\r\n2. Calls the base class method\r\n3. AI SDK handles the rest\r\n\r\nThe changes are entirely internal architecture improvements.\r\n\r\n## 🚢 Version\r\n\r\nThis ships as **v2.9.3-beta** for testing before stable release.\r\n","2025-12-08T11:56:16",{"id":217,"version":218,"summary_zh":219,"released_at":220},99847,"2.9.2-beta","**Full Changelog**: https:\u002F\u002Fgithub.com\u002Fbramses\u002Fchatgpt-md\u002Fcompare\u002F2.9.1...2.9.2-beta","2025-11-02T15:51:55",{"id":222,"version":223,"summary_zh":224,"released_at":225},99848,"2.9.1","## What's Changed\r\n* moves the cursor to the end of the answer from the LLM by @DenizOkcu in https:\u002F\u002Fgithub.com\u002Fbramses\u002Fchatgpt-md\u002Fpull\u002F185\r\n\r\n\r\n**Full Changelog**: https:\u002F\u002Fgithub.com\u002Fbramses\u002Fchatgpt-md\u002Fcompare\u002F2.9.0...2.9.1","2025-10-12T20:16:46",{"id":227,"version":228,"summary_zh":229,"released_at":230},99849,"2.9.0","🔧 ChatGPT MD v2.8.3-beta\r\n\r\n  Release Type: Bug Fix ReleaseFocus: Streaming reliability & developer experience improvements\r\n\r\n  Critical Fixes\r\n\r\n  Streaming Now Actually Works When Disabled\r\n\r\n  Fixed a sneaky bug where stream: false in frontmatter was being completely ignored. If you've been wondering why your notes kept streaming despite your settings—this is your fix. The requestStream.ts service now correctly respects per-note\r\n   streaming preferences.\r\n\r\n  No More Markdown Scrambling During Streaming\r\n\r\n  Resolved markdown corruption that occurred during real-time AI streaming. The parser was too eager, rendering incomplete markdown syntax and turning tables into abstract art. Implemented time-based buffering in ApiResponseParser.ts that\r\n  waits for complete markdown chunks before rendering. Your tables and code blocks now arrive intact.\r\n\r\n  Developer Experience\r\n\r\n  Documentation Overhaul for AI-Assisted Development\r\n\r\n  Completely restructured the project's CLAUDE.md documentation architecture for more efficient Claude Code integration:\r\n\r\n  - Cross-cutting guides: New docs\u002Fdevelopment.md (build\u002Ftooling) and docs\u002Fmessage-flow.md (complete chat architecture)\r\n  - Context-aware structure: Added directory-specific CLAUDE.md files that auto-load relevant context\r\n  - Reduced root noise: Condensed main CLAUDE.md from 102 to 50 lines—overview only\r\n\r\n  This restructure cuts token usage dramatically when working with Claude Code while improving discoverability. Each subsystem (Services, Models, Views, Core) now has targeted documentation that loads only when needed.\r\n\r\n  Under the Hood\r\n\r\n  - Dependency updates: TypeScript 5.9.3, ESLint 9.37.0, esbuild 0.25.10\r\n  - Code quality: Fixed linting errors, removed dead code\r\n  - 17 files changed: +1,791\u002F-841 lines\r\n\r\n  Migration Notes\r\n\r\n  No breaking changes. Upgrade and enjoy more reliable streaming behavior.\r\n\r\n\r\n**Full Changelog**: https:\u002F\u002Fgithub.com\u002Fbramses\u002Fchatgpt-md\u002Fcompare\u002F2.8.0...2.9.0","2025-10-07T22:46:09",{"id":232,"version":233,"summary_zh":234,"released_at":235},99850,"2.8.3-beta","🔧 **ChatGPT MD v2.8.3-beta**\r\n\r\n  Release Type: Bug Fix ReleaseFocus: Streaming reliability & developer experience improvements\r\n\r\n  Critical Fixes\r\n\r\n  Streaming Now Actually Works When Disabled\r\n\r\n  Fixed a sneaky bug where stream: false in frontmatter was being completely ignored. If you've been wondering why your notes kept streaming despite your settings—this is your fix. The requestStream.ts service now correctly respects per-note\r\n   streaming preferences.\r\n\r\n  No More Markdown Scrambling During Streaming\r\n\r\n  Resolved markdown corruption that occurred during real-time AI streaming. The parser was too eager, rendering incomplete markdown syntax and turning tables into abstract art. Implemented time-based buffering in ApiResponseParser.ts that\r\n  waits for complete markdown chunks before rendering. Your tables and code blocks now arrive intact.\r\n\r\n  Developer Experience\r\n\r\n  Documentation Overhaul for AI-Assisted Development\r\n\r\n  Completely restructured the project's CLAUDE.md documentation architecture for more efficient Claude Code integration:\r\n\r\n  - Cross-cutting guides: New docs\u002Fdevelopment.md (build\u002Ftooling) and docs\u002Fmessage-flow.md (complete chat architecture)\r\n  - Context-aware structure: Added directory-specific CLAUDE.md files that auto-load relevant context\r\n  - Reduced root noise: Condensed main CLAUDE.md from 102 to 50 lines—overview only\r\n\r\n  This restructure cuts token usage dramatically when working with Claude Code while improving discoverability. Each subsystem (Services, Models, Views, Core) now has targeted documentation that loads only when needed.\r\n\r\n  Under the Hood\r\n\r\n  - Dependency updates: TypeScript 5.9.3, ESLint 9.37.0, esbuild 0.25.10\r\n  - Code quality: Fixed linting errors, removed dead code\r\n  - 17 files changed: +1,791\u002F-841 lines\r\n\r\n  Migration Notes\r\n\r\n  No breaking changes. Upgrade and enjoy more reliable streaming behavior.","2025-10-07T22:38:28",{"id":237,"version":238,"summary_zh":239,"released_at":240},99851,"2.8.2-beta","Fixes a bug for mobile streaming requests\r\n\r\n**Full Changelog**: https:\u002F\u002Fgithub.com\u002Fbramses\u002Fchatgpt-md\u002Fcompare\u002F2.8.1-beta...2.8.2-beta","2025-08-25T07:19:21",{"id":242,"version":243,"summary_zh":244,"released_at":245},99852,"2.8.1-beta","# 🌐 Network & Streaming Improvements - v2.8.1-beta\r\n\r\n  This beta release focuses on eliminating network connectivity issues and improving streaming reliability across all AI providers.\r\n\r\n  ## 🚀 What's New\r\n\r\n  ### CORS-Free Streaming Architecture\r\n  We've completely redesigned the network layer to eliminate CORS (Cross-Origin Resource Sharing) issues that were affecting streaming requests:\r\n\r\n  - **Native HTTP Streaming**: Streaming requests now use Node.js native HTTP modules instead of browser `fetch()`\r\n  - **Local Service Reliability**: Fixed connection issues with LM Studio, Ollama, and other localhost services\r\n  - **Cloud Service Improvements**: Better reliability for OpenAI, Anthropic, Gemini, and OpenRouter streaming\r\n\r\n  ### Localhost Connection Fixes\r\n  - **IPv4\u002FIPv6 Resolution**: Fixed the common `ECONNREFUSED ::1:1234` error by forcing IPv4 resolution for localhost\r\n  - **Better Error Messages**: More helpful error messages when services are unreachable\r\n  - **Improved Debugging**: Better logging to help troubleshoot connection issues\r\n\r\n  ## 🔧 Technical Improvements\r\n\r\n  ### Unified Network Stack\r\n  - All HTTP requests now use either:\r\n    - `requestStream()` - Our custom CORS-free streaming solution\r\n    - `requestUrl()` - Obsidian's native method for non-streaming requests\r\n  - Eliminated all direct `fetch()` calls that were subject to CORS restrictions\r\n  - Optimized for Obsidian's Electron environment\r\n\r\n  ## ⚠️ Beta Testing Notes\r\n\r\n  - **Always test on a backup vault** - Never use beta versions on your main vault\r\n  - **Report issues** on GitHub with console logs if you encounter problems\r\n  - **Feedback welcome** - Let us know how the new network layer performs for you\r\n\r\n  ## 🔄 Upgrade Path\r\n\r\n  This version maintains full compatibility with existing configurations. Your settings and chat history will be preserved.\r\n\r\n  ---\r\n\r\n\r\n\r\n\r\n**Full Changelog**: https:\u002F\u002Fgithub.com\u002Fbramses\u002Fchatgpt-md\u002Fcompare\u002F2.8.0...2.8.1-beta","2025-08-24T07:00:14",{"id":247,"version":248,"summary_zh":249,"released_at":250},99853,"2.8.0","Release 2.8.0 🚀\r\n\r\n  🆕 What's New\r\n\r\n  - Latest OpenAI Models: Full support for OpenAI's newest GPT-5 family:\r\n    - gpt-5 - The flagship model with enhanced reasoning capabilities\r\n    - gpt-5-mini - Optimized for speed and efficiency\r\n    - gpt-5-nano - Ultra-lightweight for quick responses\r\n    - gpt-5-chat-latest - Always-updated chat model\r\n\r\n  🔧 Technical Improvements\r\n\r\n  - Smart Token Management: Enhanced handling of token limit responses in non-streaming mode for more reliable interactions\r\n  - Robust API Integration: Improved response parsing and error handling for the new model endpoints\r\n  - Performance Optimizations: Refined message service architecture for faster processing\r\n\r\n  📦 Under the Hood\r\n\r\n  - Updated OpenAI service integration for GPT-5 compatibility\r\n  - Enhanced settings configuration for new model options\r\n  - Dependency updates for better security and performance\r\n\r\n  Ready to experience the next generation of AI assistance! 🎯\r\n\r\n**Full Changelog**: https:\u002F\u002Fgithub.com\u002Fbramses\u002Fchatgpt-md\u002Fcompare\u002F2.7.0...2.8.0","2025-08-13T11:07:28"]