Skip to content

Commit 0213d25

Browse files
committed
Major changes
1 parent 7cea757 commit 0213d25

File tree

18 files changed

+7049
-87
lines changed

18 files changed

+7049
-87
lines changed

.github/workflows/release.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ jobs:
4242

4343
- name: Setup Rust
4444
uses: dtolnay/rust-toolchain@stable
45+
with:
46+
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
4547

4648
- name: Install Linux dependencies
4749
if: matrix.platform == 'ubuntu-latest'
@@ -58,7 +60,12 @@ jobs:
5860
run: npm install
5961

6062
- name: Build the app
61-
run: npm run tauri:build
63+
run: |
64+
if [ "${{ matrix.platform }}" = "macos-latest" ]; then
65+
npm run tauri build -- --target universal-apple-darwin
66+
else
67+
npm run tauri build
68+
fi
6269
6370
- name: Upload artifacts (windows only)
6471
if: matrix.platform == 'windows-latest'

THINKING_MODE_INTEGRATION.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Thinking Mode Integration Summary
2+
3+
## **Changes Made**
4+
5+
### **1. Web Search Functions Updated**
6+
- **`generate_search_queries_with_ollama`**: Now accepts `thinking: bool` parameter
7+
- **`summarize_with_ollama`**: Now accepts `thinking: bool` parameter
8+
- **Both functions**: Add `/nothinking` prefix by default, only remove it when `thinking=true`
9+
10+
### **2. Backend API Updated**
11+
- **`search_web` Tauri command**: Now accepts `thinking: Option<bool>` parameter
12+
- **Default behavior**: `thinking` defaults to `false` (disabled)
13+
- **Parameter passing**: Thinking mode is passed through to all helper functions
14+
15+
### **3. Frontend Service Updated**
16+
- **`searchWeb` function**: Now accepts `thinking: boolean = false` parameter
17+
- **Default behavior**: Thinking disabled by default
18+
- **Integration**: Passes thinking parameter to Rust backend
19+
20+
### **4. Chat Component Updated**
21+
- **Web search call**: Now passes `thinkingMode` state to `searchWeb()`
22+
- **Integration**: Web search respects the thinking toggle state
23+
24+
## 🎯 **Behavior**
25+
26+
### **Thinking Mode OFF (Default)**
27+
- All Ollama calls in web search use `/nothinking` prefix
28+
- Search query generation: `/nothinking Based on the following...`
29+
- Result summarization: `/nothinking Summarize the following...`
30+
- **Result**: Clean, direct responses without thinking traces
31+
32+
### **Thinking Mode ON (When Toggled)**
33+
- All Ollama calls in web search use normal prompts (no `/nothinking`)
34+
- Search query generation: `Based on the following...`
35+
- Result summarization: `Summarize the following...`
36+
- **Result**: May show thinking processes and reasoning
37+
38+
## 🔧 **Implementation Details**
39+
40+
1. **Parameter Flow**: `Chat Component``ollamaService.searchWeb()``Rust search_web()``Helper functions`
41+
42+
2. **Default Values**:
43+
- TypeScript: `thinking: boolean = false`
44+
- Rust: `thinking: Option<bool>``thinking.unwrap_or(false)`
45+
46+
3. **Consistent Pattern**: Matches other Ollama service functions that use `/nothinking` by default
47+
48+
## 🧪 **Testing**
49+
50+
To test the implementation:
51+
52+
1. **With Thinking OFF**: Web search should provide clean, direct responses
53+
2. **With Thinking ON**: Web search may show reasoning processes in the generated queries and summaries
54+
3. **Toggle Behavior**: The thinking toggle should affect web search results in real-time
55+
56+
The implementation ensures that web search behavior aligns with the overall app's thinking mode settings while maintaining the Python `simplesearch.py` workflow.

WEB_SEARCH_SETUP.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Web Search Configuration
2+
3+
The web search functionality now follows the Python implementation from `ollama-search/src/simplesearch.py`.
4+
5+
## Setup
6+
7+
1. **Start the TypeScript Search Service** (from `ollama-search/src/search.ts`):
8+
```bash
9+
cd ollama-search/src
10+
deno run --allow-net search.ts
11+
```
12+
This will start the search service on `http://localhost:3000`
13+
14+
2. **Alternative: Use Custom Cloud Service**:
15+
Set the environment variable:
16+
```bash
17+
export CLOUD_SERVICE_URL=https://your-cloud-service.com
18+
```
19+
20+
## How it works
21+
22+
1. **Query Generation**: Uses Ollama to generate 3 Google search queries based on the user's input
23+
2. **Search Context**: Fetches search results from the cloud service (or TypeScript service)
24+
3. **Summarization**: Uses Ollama to summarize each set of search results
25+
4. **Source Extraction**: Extracts and displays all URLs used for the answer
26+
27+
## Search Flow
28+
29+
1. User asks a question with web search enabled
30+
2. Generate 3 related search queries using Ollama
31+
3. For each query:
32+
- Fetch search context from cloud service
33+
- Extract sources (URLs)
34+
- Summarize results using Ollama
35+
4. Combine all summaries and display sources
36+
37+
This matches the Python `simplesearch.py` implementation exactly.

ollama-search

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit cb046d9cd1a149da1cac44fad4c444263100220f

ollama-web-search

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit 392e6130b157606f8fd7e331ca154899eee7bfa0

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
"desktop": "npm run tauri:dev",
1515
"build:desktop": "npm run tauri:build",
1616
"build:all": "tauri build",
17-
"build:mac": "tauri build --bundles dmg",
17+
"build:mac": "tauri build --target universal-apple-darwin --bundles dmg",
18+
"build:mac-universal": "tauri build --target universal-apple-darwin",
1819
"build:windows": "tauri build --bundles msi,nsis"
1920
},
2021
"dependencies": {

searxng.bak

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit df76647c52b56101f152c5dec7c1d08f1732ceb7

0 commit comments

Comments
 (0)