You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* feat: Add comprehensive test suite for DeepWiki project including unit, integration, and API tests
* feat: Add support for Google AI embeddings and update embedder configuration
* fix: Update authorization code parameter to be optional in delete_wiki_cache function
* feat: Refactor embedder handling to support multiple types and improve backward compatibility
# Optional: Add Ollama host if not local. defaults to http://localhost:11434
@@ -67,6 +70,8 @@ Create a `.env` file in the project root with these keys:
67
70
```
68
71
GOOGLE_API_KEY=your_google_api_key
69
72
OPENAI_API_KEY=your_openai_api_key
73
+
# Optional: Use Google AI embeddings (recommended if using Google models)
74
+
DEEPWIKI_EMBEDDER_TYPE=google
70
75
# Optional: Add this if you want to use OpenRouter models
71
76
OPENROUTER_API_KEY=your_openrouter_api_key
72
77
# Optional: Add this if you want to use Azure OpenAI models
@@ -269,6 +274,89 @@ If you want to use embedding models compatible with the OpenAI API (such as Alib
269
274
270
275
This allows you to seamlessly switch to any OpenAI-compatible embedding service without code changes.
271
276
277
+
## 🧠 Using Google AI Embeddings
278
+
279
+
DeepWiki now supports Google AI's latest embedding models as an alternative to OpenAI embeddings. This provides better integration when you're already using Google Gemini models for text generation.
280
+
281
+
### Features
282
+
283
+
-**Latest Model**: Uses Google's `text-embedding-004` model
284
+
-**Same API Key**: Uses your existing `GOOGLE_API_KEY` (no additional setup required)
285
+
-**Better Integration**: Optimized for use with Google Gemini text generation models
286
+
-**Task-Specific**: Supports semantic similarity, retrieval, and classification tasks
287
+
-**Batch Processing**: Efficient processing of multiple texts
288
+
289
+
### How to Enable Google AI Embeddings
290
+
291
+
**Option 1: Environment Variable (Recommended)**
292
+
293
+
Set the embedder type in your `.env` file:
294
+
295
+
```bash
296
+
# Your existing Google API key
297
+
GOOGLE_API_KEY=your_google_api_key
298
+
299
+
# Enable Google AI embeddings
300
+
DEEPWIKI_EMBEDDER_TYPE=google
301
+
```
302
+
303
+
**Option 2: Docker Environment**
304
+
305
+
```bash
306
+
docker run -p 8001:8001 -p 3000:3000 \
307
+
-e GOOGLE_API_KEY=your_google_api_key \
308
+
-e DEEPWIKI_EMBEDDER_TYPE=google \
309
+
-v ~/.adalflow:/root/.adalflow \
310
+
ghcr.io/asyncfuncai/deepwiki-open:latest
311
+
```
312
+
313
+
**Option 3: Docker Compose**
314
+
315
+
Add to your `.env` file:
316
+
317
+
```bash
318
+
GOOGLE_API_KEY=your_google_api_key
319
+
DEEPWIKI_EMBEDDER_TYPE=google
320
+
```
321
+
322
+
Then run:
323
+
324
+
```bash
325
+
docker-compose up
326
+
```
327
+
328
+
### Available Embedder Types
329
+
330
+
| Type | Description | API Key Required | Notes |
331
+
|------|-------------|------------------|-------|
332
+
|`openai`| OpenAI embeddings (default) |`OPENAI_API_KEY`| Uses `text-embedding-3-small` model |
333
+
|`google`| Google AI embeddings |`GOOGLE_API_KEY`| Uses `text-embedding-004` model |
334
+
|`ollama`| Local Ollama embeddings | None | Requires local Ollama installation |
335
+
336
+
### Why Use Google AI Embeddings?
337
+
338
+
-**Consistency**: If you're using Google Gemini for text generation, using Google embeddings provides better semantic consistency
339
+
-**Performance**: Google's latest embedding model offers excellent performance for retrieval tasks
340
+
-**Cost**: Competitive pricing compared to OpenAI
341
+
-**No Additional Setup**: Uses the same API key as your text generation models
342
+
343
+
### Switching Between Embedders
344
+
345
+
You can easily switch between different embedding providers:
346
+
347
+
```bash
348
+
# Use OpenAI embeddings (default)
349
+
export DEEPWIKI_EMBEDDER_TYPE=openai
350
+
351
+
# Use Google AI embeddings
352
+
export DEEPWIKI_EMBEDDER_TYPE=google
353
+
354
+
# Use local Ollama embeddings
355
+
export DEEPWIKI_EMBEDDER_TYPE=ollama
356
+
```
357
+
358
+
**Note**: When switching embedders, you may need to regenerate your repository embeddings as different models produce different vector spaces.
359
+
272
360
### Logging
273
361
274
362
DeepWiki uses Python's built-in `logging` module for diagnostic output. You can configure the verbosity and log file destination via environment variables:
| `GOOGLE_API_KEY` | Google Gemini API key for AI generation | No | Required only if you want to use Google Gemini models
315
-
|`OPENAI_API_KEY`| OpenAI API key for embeddings | Yes | Note: This is required even if you're not using OpenAI models, as it's used for embeddings.|
402
+
| `GOOGLE_API_KEY` | Google Gemini API key for AI generation and embeddings | No | Required for Google Gemini models and Google AI embeddings
403
+
|`OPENAI_API_KEY`| OpenAI API key for embeddings and models| Conditional | Required if using OpenAI embeddings or models |
316
404
|`OPENROUTER_API_KEY`| OpenRouter API key for alternative models | No | Required only if you want to use OpenRouter models |
317
405
|`AZURE_OPENAI_API_KEY`| Azure OpenAI API key | No | Required only if you want to use Azure OpenAI models |
318
406
|`AZURE_OPENAI_ENDPOINT`| Azure OpenAI endpoint | No | Required only if you want to use Azure OpenAI models |
319
407
|`AZURE_OPENAI_VERSION`| Azure OpenAI version | No | Required only if you want to use Azure OpenAI models |
320
408
|`OLLAMA_HOST`| Ollama Host (default: http://localhost:11434)| No | Required only if you want to use external Ollama server |
409
+
|`DEEPWIKI_EMBEDDER_TYPE`| Embedder type: `openai`, `google`, or `ollama` (default: `openai`) | No | Controls which embedding provider to use |
321
410
|`PORT`| Port for the API server (default: 8001) | No | If you host API and frontend on the same machine, make sure change port of `SERVER_BASE_URL` accordingly |
322
411
|`SERVER_BASE_URL`| Base URL for the API server (default: http://localhost:8001)| No |
323
412
|`DEEPWIKI_AUTH_MODE`| Set to `true` or `1` to enable authorization mode. | No | Defaults to `false`. If enabled, `DEEPWIKI_AUTH_CODE` is required. |
324
413
|`DEEPWIKI_AUTH_CODE`| The secret code required for wiki generation when `DEEPWIKI_AUTH_MODE` is enabled. | No | Only used if `DEEPWIKI_AUTH_MODE` is `true` or `1`. |
325
414
326
-
If you're not using ollama mode, you need to configure an OpenAI API key for embeddings. Other API keys are only required when configuring and using models from the corresponding providers.
415
+
**API Key Requirements:**
416
+
- If using `DEEPWIKI_EMBEDDER_TYPE=openai` (default): `OPENAI_API_KEY` is required
417
+
- If using `DEEPWIKI_EMBEDDER_TYPE=google`: `GOOGLE_API_KEY` is required
418
+
- If using `DEEPWIKI_EMBEDDER_TYPE=ollama`: No API key required (local processing)
419
+
420
+
Other API keys are only required when configuring and using models from the corresponding providers.
0 commit comments