Skip to content

Commit 2628ac4

Browse files
committed
Bump version to 2.13.3-beta (beta)
1 parent 4c14cfd commit 2628ac4

File tree

6 files changed

+132
-41
lines changed

6 files changed

+132
-41
lines changed

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ChatGPT MD Changelog
22

3-
## v3.0.0 (December 2025) - Privacy-First AI Tool Calling
3+
## v3.0.0 - Privacy-First AI Tool Calling
44

55
### 🎯 Major Features
66

@@ -22,6 +22,11 @@
2222
- Review and filter web results before sharing
2323
- Custom search provider support for self-hosted solutions
2424
- Optional full page content fetching
25+
- Tool only available to LLM when Brave Search API key is configured
26+
- **Editable Search Queries**: Users can now edit vault search and web search queries before tool execution
27+
- Textarea in tool approval modal for query modification
28+
- Real-time validation prevents empty queries
29+
- Supports multi-line queries and special characters
2530

2631
### 🔒 Privacy & Control
2732

README.md

Lines changed: 75 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,15 @@
11
# ChatGPT MD
22

3-
🚀 A seamless integration of ChatGPT, OpenRouter.ai and local LLMs via Ollama into Obsidian.
3+
🚀 A seamless integration of ChatGPT, OpenRouter.ai and local LLMs via Ollama/LM Studio into Obsidian.
44

55
![Chatting with links about vacation plans](images/chat-with-link.gif)
66

7-
## 🚀 What's New in v3.0.0: Privacy-First AI Tool Calling
7+
## 🚀 What's New in v3.0.0: Privacy-First AI Tool Calling (off by default - Settings → ChatGPT MD → Tool Calling)
88

9-
**Your AI assistant can now search your vault, read files, and search the web—with explicit approval at every step.**
9+
**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.**
1010

11-
### Key Features
11+
v3.0.0 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 control exactly what gets shared back to the model. Nothing leaves your vault without explicit consent.
1212

13-
- **🔍 Vault Search**: AI discovers relevant notes in your vault (you approve which files to share)
14-
- **📄 File Reading**: AI can request access to specific files (you select which ones)
15-
- **🌐 Web Search**: AI searches the web via Brave Search API (1,000 free queries/month)
16-
- **✅ Three-Layer Approval System**:
17-
1. Approve what the AI wants to do
18-
2. Review what it found
19-
3. Select exactly which results to share
20-
- **🔒 Privacy-First Design**: No data reaches the AI without your explicit consent
21-
- **🎯 All Providers Supported**: OpenAI, Anthropic, Gemini, OpenRouter, Ollama, LM Studio
22-
- **⚙️ Disabled by Default**: Opt-in feature only—enable in Settings → Tool Calling
23-
24-
### Why This Matters
25-
26-
For 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.
27-
28-
### Getting Started with Tool Calling
29-
30-
1. **Install the beta**: Use [BRAT plugin](https://github.com/TfTHacker/obsidian42-brat) and select version **2.12.0-beta**
31-
2. **Enable in settings**: Go to Settings → ChatGPT MD → Tool Calling
32-
3. **Optional**: Add Brave Search API key for web search (1,000 free queries/month)
33-
4. **Start chatting**: Your AI will ask for approval when it wants to use tools
34-
35-
⚠️ **Beta Warning**: Test on a backup/test vault first. This is a beta release with active development.
36-
37-
### Use Cases
38-
39-
- **Research Assistant**: "Search my vault for notes about quantum computing and find recent papers"
40-
- **Knowledge Synthesis**: "Find all my Q3 meeting notes and summarize key decisions"
41-
- **Web-Enhanced Writing**: "Search the web for latest statistics and incorporate them"
42-
- **Note Discovery**: "Find connections between notes I might have missed"
4313

4414
## A simple and quick Start 🏁
4515
Get started in just a few simple steps:
@@ -160,6 +130,77 @@ openaiUrl: https://api.openai.com
160130
💡 Pro tip: Increasing `max_tokens` to a higher value e.g. `4096` for more complex tasks like reasoning, coding or text creation.
161131
The 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.
162132

133+
### Tools
134+
135+
1. **Install**: Update or install v3.0.0+ from Obsidian
136+
2. **Configure**: Settings → ChatGPT MD → Tool Calling → Enable,
137+
3. **Optional**: Add [Brave Search API key](https://brave.com/search/api/) (free tier: 1,000 queries/month)
138+
4. **Chat**: Use the `ChatGPT MD: Chat` command. AI will request tool use when needed.
139+
140+
The implementation follows a three-layer approval pattern:
141+
142+
1. **Execution Layer**: AI requests tool use with parameters
143+
2. **Processing Layer**: Tool executes locally in your vault using Obsidian's API (full-text search across filenames and content)
144+
3. **Approval Layer**: Interactive modals let you filter results before they're returned to the AI
145+
146+
### Available Tools
147+
148+
**Vault Search** (`vault_search`)
149+
- Multi-word OR search: matches ANY query term across your vault
150+
- Searches both filenames and file content simultaneously
151+
- Excludes current file to prevent recursion
152+
- Configurable result limits (default: 5 files)
153+
- Query editing: refine search terms before execution
154+
155+
**File Read** (`file_read`)
156+
- Direct file access when AI knows specific file paths
157+
- Batch reading support for multiple files
158+
- Full content extraction with your approval
159+
- Useful for targeted lookups once files are discovered
160+
161+
**Web Search** (`web_search`)
162+
- Powered by Brave Search API (privacy-focused, 1,000 free queries/month)
163+
- Custom search provider support for self-hosted endpoints
164+
- Optional full-page content fetching
165+
- Automatic API key validation—tool only appears when configured
166+
- Query editing: modify web search queries before execution
167+
168+
### Privacy & Security
169+
170+
- **Local-First Execution**: All vault operations run entirely within Obsidian's API
171+
- **Selective Sharing**: Multi-select modals let you choose exactly which results to share
172+
- **No Telemetry**: Zero tracking or analytics—tool usage stays private
173+
174+
### Configuration
175+
176+
Enable tool calling in **Settings → ChatGPT MD → Tool Calling**:
177+
178+
- **Enable Tool Calling**: Master switch (default: disabled)
179+
- **Brave Search API Key**: Your Brave Search API key
180+
- **Custom Provider URL**: Self-hosted search endpoint
181+
- **Max Web Results**: Number of web results to return (1-10)
182+
183+
### Use Cases
184+
185+
**Research Assistant**: "Search my vault for notes about quantum computing algorithms and recent papers on the topic"
186+
187+
→ AI discovers relevant notes → You approve which files to share → AI synthesizes information with proper attribution
188+
189+
**Knowledge Synthesis**: "Find all my Q3 meeting notes and summarize key decisions about product roadmap"
190+
191+
→ Vault search returns meeting files → You select the relevant ones → AI extracts and summarizes decisions
192+
193+
**Web-Enhanced Writing**: "Search the web for latest climate change statistics and incorporate them into my article"
194+
195+
→ Web search fetches current data → You filter reliable sources → AI integrates citations into your draft
196+
197+
**Cross-Reference Discovery**: "Find notes that mention both machine learning and productivity techniques"
198+
199+
→ Multi-word OR search finds intersections → You approve interesting connections → AI highlights patterns you might have missed
200+
201+
⚠️ **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.
202+
203+
163204
### Multi Model Chats
164205
You can set and change the model for each request in your note.
165206
Specify the `model` property via frontmatter:

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "chatgpt-md",
3-
"version": "2.13.2-beta",
3+
"version": "2.13.3-beta",
44
"description": "A seamless integration of openAIs GPT LLMs and Ollama into Obsidian.",
55
"main": "main.js",
66
"type": "module",

src/Services/ToolService.ts

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,24 @@ export class ToolService {
160160
this.tools.set(name, toolDef);
161161
}
162162

163+
/**
164+
* Check if web search tool is available based on settings
165+
* - Brave provider: requires API key
166+
* - Custom provider: requires API URL
167+
*
168+
* @param settings - Plugin settings containing web search configuration
169+
* @returns true if web search is properly configured, false otherwise
170+
*/
171+
private isWebSearchAvailable(settings: ChatGPT_MDSettings): boolean {
172+
if (settings.webSearchProvider === "brave") {
173+
return !!settings.webSearchApiKey && settings.webSearchApiKey.trim().length > 0;
174+
}
175+
if (settings.webSearchProvider === "custom") {
176+
return !!settings.webSearchApiUrl && settings.webSearchApiUrl.trim().length > 0;
177+
}
178+
return false;
179+
}
180+
163181
/**
164182
* Get a specific tool by name
165183
*/
@@ -180,13 +198,36 @@ export class ToolService {
180198

181199
/**
182200
* Get tools enabled for a request based on settings
183-
* Returns all tools if enableToolCalling is true, undefined otherwise
201+
* Filters tools based on configuration requirements:
202+
* - vault_search/file_read: always available if tool calling enabled
203+
* - web_search: only if API key/URL configured
204+
*
205+
* @param settings - Plugin settings containing tool and web search configuration
206+
* @returns Object containing enabled tools, or undefined if no tools available
184207
*/
185208
getEnabledTools(settings: ChatGPT_MDSettings): Record<string, any> | undefined {
186209
if (!settings.enableToolCalling) {
187210
return undefined;
188211
}
189-
return this.getAllTools();
212+
213+
const allTools = this.getAllTools();
214+
const enabledTools: Record<string, any> = {};
215+
216+
// Vault tools - always available when tool calling is enabled
217+
if (allTools.vault_search) {
218+
enabledTools.vault_search = allTools.vault_search;
219+
}
220+
if (allTools.file_read) {
221+
enabledTools.file_read = allTools.file_read;
222+
}
223+
224+
// Web search - only if properly configured
225+
if (allTools.web_search && this.isWebSearchAvailable(settings)) {
226+
enabledTools.web_search = allTools.web_search;
227+
}
228+
229+
// Return undefined if no tools are enabled (prevents passing empty object to AI SDK)
230+
return Object.keys(enabledTools).length > 0 ? enabledTools : undefined;
190231
}
191232

192233
// ========== Tool Orchestration and Approval ==========

styles.css

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,14 @@
5151

5252
/* Model suggestion tool badge */
5353
.ai-model-tool-badge {
54-
background-color: var(--interactive-accent);
55-
color: var(--text-on-accent);
54+
background-color: var(--interactive-accent, #7b6cd9);
55+
color: var(--text-on-accent, #ffffff);
5656
padding: 2px 8px;
5757
border-radius: 4px;
5858
font-size: 11px;
5959
font-weight: 500;
6060
flex-shrink: 0;
61+
white-space: nowrap;
62+
display: inline-block;
63+
line-height: 1.4;
6164
}

versions.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,6 @@
6161
"2.12.0-beta": "0.15.0",
6262
"2.13.0-beta": "0.15.0",
6363
"2.13.1-beta": "0.15.0",
64-
"2.13.2-beta": "0.15.0"
64+
"2.13.2-beta": "0.15.0",
65+
"2.13.3-beta": "0.15.0"
6566
}

0 commit comments

Comments
 (0)