Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Ollama-instruction.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ cp api/config/embedder.ollama.json.bak api/config/embedder.json

Start the backend:
```bash
python -m pip install poetry==2.0.1 && poetry install
python -m pip install poetry==2.0.1 && poetry --directory api install
poetry --directory api env activate
python -m api.main
```

Expand Down Expand Up @@ -88,7 +89,7 @@ npm run dev
-v ~/.adalflow:/root/.adalflow \
-e OLLAMA_HOST=your_ollama_host \
deepwiki:ollama-local

# For local repository analysis
docker run -p 3000:3000 -p 8001:8001 --name deepwiki \
-v ~/.adalflow:/root/.adalflow \
Expand Down
3 changes: 2 additions & 1 deletion README.es.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,10 @@ OPENROUTER_API_KEY=your_openrouter_api_key

```bash
# Instalar dependencias de Python
python -m pip install poetry==2.0.1 && poetry install
python -m pip install poetry==2.0.1 && poetry --directory api install

# Iniciar el servidor API
poetry --directory api env activate
python -m api.main
```

Expand Down
10 changes: 5 additions & 5 deletions README.fr.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@

# DeepWiki-Open

![Bannière DeepWiki](screenshots/Deepwiki.png)

**DeepWiki** est ma propre tentative d’implémentation de DeepWiki, un outil qui crée automatiquement des wikis magnifiques et interactifs pour n’importe quel dépôt GitHub, GitLab ou Bitbucket ! Il suffit d’entrer un nom de dépôt, et DeepWiki :

1. Analyse la structure du code
2. Génère une documentation complète
3. Crée des diagrammes visuels pour expliquer le fonctionnement
1. Analyse la structure du code
2. Génère une documentation complète
3. Crée des diagrammes visuels pour expliquer le fonctionnement
4. Organise le tout dans un wiki facile à naviguer

[!["Buy Me A Coffee"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://buymeacoffee.com/sheing)
Expand Down Expand Up @@ -82,9 +81,10 @@ OLLAMA_HOST=votre_hote_ollama

```bash
# Installer dépendances Python
python -m pip install poetry==2.0.1 && poetry install
python -m pip install poetry==2.0.1 && poetry --directory api install

# Démarrer le serveur API
poetry --directory api env activate
python -m api.main
```

Expand Down
3 changes: 2 additions & 1 deletion README.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,10 @@ OPENROUTER_API_KEY=your_openrouter_api_key

```bash
# Pythonの依存関係をインストール
python -m pip install poetry==2.0.1 && poetry install
python -m pip install poetry==2.0.1 && poetry --directory api install

# APIサーバーを起動
poetry --directory api env activate
python -m api.main
```

Expand Down
3 changes: 2 additions & 1 deletion README.kr.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,10 @@ OPENROUTER_API_KEY=your_openrouter_api_key

```bash
# Python 의존성 설치
python -m pip install poetry==2.0.1 && poetry install
python -m pip install poetry==2.0.1 && poetry --directory api install

# API 서버 실행
poetry --directory api env activate
python -m api.main
```

Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,10 @@ OLLAMA_HOST=your_ollama_host

```bash
# Install Python dependencies
python -m pip install poetry==1.8.2 && poetry install -C api
python -m pip install poetry==2.0.1 && poetry --directory api install

# Start the API server
poetry --directory api env activate
python -m api.main
```

Expand Down Expand Up @@ -399,7 +400,7 @@ docker-compose up

| Variable | Description | Required | Note |
|----------------------|--------------------------------------------------------------|----------|----------------------------------------------------------------------------------------------------------|
| `GOOGLE_API_KEY` | Google Gemini API key for AI generation and embeddings | No | Required for Google Gemini models and Google AI embeddings
| `GOOGLE_API_KEY` | Google Gemini API key for AI generation and embeddings | No | Required for Google Gemini models and Google AI embeddings
| `OPENAI_API_KEY` | OpenAI API key for embeddings and models | Conditional | Required if using OpenAI embeddings or models |
| `OPENROUTER_API_KEY` | OpenRouter API key for alternative models | No | Required only if you want to use OpenRouter models |
| `AZURE_OPENAI_API_KEY` | Azure OpenAI API key | No | Required only if you want to use Azure OpenAI models |
Expand All @@ -414,7 +415,7 @@ docker-compose up

**API Key Requirements:**
- If using `DEEPWIKI_EMBEDDER_TYPE=openai` (default): `OPENAI_API_KEY` is required
- If using `DEEPWIKI_EMBEDDER_TYPE=google`: `GOOGLE_API_KEY` is required
- If using `DEEPWIKI_EMBEDDER_TYPE=google`: `GOOGLE_API_KEY` is required
- If using `DEEPWIKI_EMBEDDER_TYPE=ollama`: No API key required (local processing)

Other API keys are only required when configuring and using models from the corresponding providers.
Expand Down
5 changes: 3 additions & 2 deletions README.pt-br.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,10 @@ OLLAMA_HOST=seu_host_ollama

```bash
# Instale as dependências Python
python -m pip install poetry==2.0.1 && poetry install
python -m pip install poetry==2.0.1 && poetry --directory api install

# Inicie o servidor API
poetry --directory api env activate
python -m api.main
```

Expand Down Expand Up @@ -297,7 +298,7 @@ docker-compose up

| Variável | Descrição | Obrigatória | Observação |
|----------------------|--------------------------------------------------------------|----------|----------------------------------------------------------------------------------------------------------|
| `GOOGLE_API_KEY` | Chave API Google Gemini para geração com IA | Não | Necessária apenas se você quiser usar modelos Google Gemini
| `GOOGLE_API_KEY` | Chave API Google Gemini para geração com IA | Não | Necessária apenas se você quiser usar modelos Google Gemini
| `OPENAI_API_KEY` | Chave API OpenAI para embeddings | Sim | Nota: Isso é necessário mesmo se você não estiver usando modelos OpenAI, pois é usado para embeddings. |
| `OPENROUTER_API_KEY` | Chave API OpenRouter para modelos alternativos | Não | Necessária apenas se você quiser usar modelos OpenRouter |
| `OLLAMA_HOST` | Host Ollama (padrão: http://localhost:11434) | Não | Necessária apenas se você quiser usar servidor Ollama externo |
Expand Down
15 changes: 8 additions & 7 deletions README.ru.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
3. Построение визуальных диаграмм, объясняющих работу системы
4. Организацию всего в удобную и структурированную вики

[!["Купить мне кофе"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://buymeacoffee.com/sheing)
[![Поддержать в криптовалюте](https://tip.md/badge.svg)](https://tip.md/sng-asyncfunc)
[![Twitter/X](https://img.shields.io/badge/Twitter-1DA1F2?style=for-the-badge&logo=twitter&logoColor=white)](https://x.com/sashimikun_void)
[!["Купить мне кофе"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://buymeacoffee.com/sheing)
[![Поддержать в криптовалюте](https://tip.md/badge.svg)](https://tip.md/sng-asyncfunc)
[![Twitter/X](https://img.shields.io/badge/Twitter-1DA1F2?style=for-the-badge&logo=twitter&logoColor=white)](https://x.com/sashimikun_void)
[![Discord](https://img.shields.io/badge/Discord-7289DA?style=for-the-badge&logo=discord&logoColor=white)](https://discord.com/invite/VQMBGR8u5v)

[English](./README.md) | [简体中文](./README.zh.md) | [繁體中文](./README.zh-tw.md) | [日本語](./README.ja.md) | [Español](./README.es.md) | [한국어](./README.kr.md) | [Tiếng Việt](./README.vi.md) | [Português Brasileiro](./README.pt-br.md) | [Français](./README.fr.md) | [Русский](./README.ru.md)
Expand Down Expand Up @@ -81,9 +81,10 @@ OLLAMA_HOST=ваш_ollama_host

```bash
# Установка зависимостей
python -m pip install poetry==2.0.1 && poetry install
python -m pip install poetry==2.0.1 && poetry --directory api install

# Запуск API
poetry --directory api env activate
python -m api.main
```

Expand Down Expand Up @@ -452,13 +453,13 @@ docker build --build-arg CUSTOM_CERT_DIR=certs .

## 📱 Скриншоты

![Интерфейс](screenshots/Interface.png)
![Интерфейс](screenshots/Interface.png)
*Основной интерфейс DeepWiki*

![Приватный доступ](screenshots/privaterepo.png)
![Приватный доступ](screenshots/privaterepo.png)
*Доступ к приватным репозиториям*

![DeepResearch](screenshots/DeepResearch.png)
![DeepResearch](screenshots/DeepResearch.png)
*DeepResearch анализирует сложные темы*

### Видео-демо
Expand Down
3 changes: 2 additions & 1 deletion README.vi.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,10 @@ OPENROUTER_API_KEY=your_openrouter_api_key

```bash
# Cài đặt Python dependencies
python -m pip install poetry==2.0.1 && poetry install
python -m pip install poetry==2.0.1 && poetry --directory api install

# Chạy API server
poetry --directory api env activate
python -m api.main
```

Expand Down
5 changes: 3 additions & 2 deletions README.zh-tw.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,10 @@ OLLAMA_HOST=your_ollama_host

```bash
# 安裝 Python 相依性
python -m pip install poetry==2.0.1 && poetry install
python -m pip install poetry==2.0.1 && poetry --directory api install

# 啟動 API 伺服器
poetry --directory api env activate
python -m api.main
```

Expand Down Expand Up @@ -304,7 +305,7 @@ docker-compose up

| 變數 | 說明 | 必需 | 備註 |
|----------------------|--------------------------------------------------------------|----------|----------------------------------------------------------------------------------------------------------|
| `GOOGLE_API_KEY` | Google Gemini API 金鑰,用於 AI 產生 | 否 | 只有在您想使用 Google Gemini 模型時才需要
| `GOOGLE_API_KEY` | Google Gemini API 金鑰,用於 AI 產生 | 否 | 只有在您想使用 Google Gemini 模型時才需要
| `OPENAI_API_KEY` | OpenAI API 金鑰,用於嵌入 | 是 | 備註:即使您不使用 OpenAI 模型,這個也是必需的,因為它用於嵌入 |
| `OPENROUTER_API_KEY` | OpenRouter API 金鑰,用於替代模型 | 否 | 只有在您想使用 OpenRouter 模型時才需要 |
| `OLLAMA_HOST` | Ollama 主機(預設:http://localhost:11434) | 否 | 只有在您想使用外部 Ollama 伺服器時才需要 |
Expand Down
3 changes: 2 additions & 1 deletion README.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,10 @@ OPENROUTER_API_KEY=your_openrouter_api_key

```bash
# 安装Python依赖
python -m pip install poetry==2.0.1 && poetry install
python -m pip install poetry==2.0.1 && poetry --directory api install

# 启动API服务器
poetry --directory api env activate
python -m api.main
```

Expand Down
3 changes: 2 additions & 1 deletion api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ This is the backend API for DeepWiki, providing smart code analysis and AI-power

```bash
# From the project root
python -m pip install poetry==2.0.1 && poetry install
python -m pip install poetry==2.0.1 && poetry --directory api install
```

### Step 2: Set Up Environment Variables
Expand Down Expand Up @@ -110,6 +110,7 @@ This allows you to maintain different configurations for various environments or

```bash
# From the project root
poetry --directory api env activate
python -m api.main
```

Expand Down
22 changes: 11 additions & 11 deletions api/data_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def count_tokens(text: str, embedder_type: str = None, is_ollama_embedder: bool
# Handle backward compatibility
if embedder_type is None and is_ollama_embedder is not None:
embedder_type = 'ollama' if is_ollama_embedder else None

# Determine embedder type if not specified
if embedder_type is None:
from api.config import get_embedder_type
Expand Down Expand Up @@ -141,7 +141,7 @@ def download_repo(repo_url: str, local_path: str, repo_type: str = None, access_
# Alias for backward compatibility
download_github_repo = download_repo

def read_all_documents(path: str, embedder_type: str = None, is_ollama_embedder: bool = None,
def read_all_documents(path: str, embedder_type: str = None, is_ollama_embedder: bool = None,
excluded_dirs: List[str] = None, excluded_files: List[str] = None,
included_dirs: List[str] = None, included_files: List[str] = None):
"""
Expand Down Expand Up @@ -388,7 +388,7 @@ def prepare_data_pipeline(embedder_type: str = None, is_ollama_embedder: bool =
# Handle backward compatibility
if embedder_type is None and is_ollama_embedder is not None:
embedder_type = 'ollama' if is_ollama_embedder else None

# Determine embedder type if not specified
if embedder_type is None:
embedder_type = get_embedder_type()
Expand Down Expand Up @@ -444,9 +444,9 @@ def get_github_file_content(repo_url: str, file_path: str, access_token: str = N
"""
Retrieves the content of a file from a GitHub repository using the GitHub API.
Supports both public GitHub (github.com) and GitHub Enterprise (custom domains).

Args:
repo_url (str): The URL of the GitHub repository
repo_url (str): The URL of the GitHub repository
(e.g., "https://github.com/username/repo" or "https://github.company.com/username/repo")
file_path (str): The path to the file within the repository (e.g., "src/main.py")
access_token (str, optional): GitHub personal access token for private repositories
Expand Down Expand Up @@ -478,7 +478,7 @@ def get_github_file_content(repo_url: str, file_path: str, access_token: str = N
else:
# GitHub Enterprise - API is typically at https://domain/api/v3/
api_base = f"{parsed_url.scheme}://{parsed_url.netloc}/api/v3"

# Use GitHub API to get file content
# The API endpoint for getting file content is: /repos/{owner}/{repo}/contents/{path}
api_url = f"{api_base}/repos/{owner}/{repo}/contents/{file_path}"
Expand Down Expand Up @@ -559,7 +559,7 @@ def get_gitlab_file_content(repo_url: str, file_path: str, access_token: str = N
project_headers = {}
if access_token:
project_headers["PRIVATE-TOKEN"] = access_token

project_response = requests.get(project_info_url, headers=project_headers)
if project_response.status_code == 200:
project_data = project_response.json()
Expand Down Expand Up @@ -630,7 +630,7 @@ def get_bitbucket_file_content(repo_url: str, file_path: str, access_token: str
repo_headers = {}
if access_token:
repo_headers["Authorization"] = f"Bearer {access_token}"

repo_response = requests.get(repo_info_url, headers=repo_headers)
if repo_response.status_code == 200:
repo_data = repo_response.json()
Expand Down Expand Up @@ -736,7 +736,7 @@ def prepare_database(self, repo_url_or_path: str, repo_type: str = None, access_
# Handle backward compatibility
if embedder_type is None and is_ollama_embedder is not None:
embedder_type = 'ollama' if is_ollama_embedder else None

self.reset_database()
self._create_repo(repo_url_or_path, repo_type, access_token)
return self.prepare_db_index(embedder_type=embedder_type, excluded_dirs=excluded_dirs, excluded_files=excluded_files,
Expand Down Expand Up @@ -784,7 +784,7 @@ def _create_repo(self, repo_url_or_path: str, repo_type: str = None, access_toke

os.makedirs(root_path, exist_ok=True)
# url
if repo_url_or_path.startswith("https://") or repo_url_or_path.startswith("http://"):
if repo_url_or_path.startswith(("https://", "http://")):
# Extract the repository name from the URL
repo_name = self._extract_repo_name_from_url(repo_url_or_path, repo_type)
logger.info(f"Extracted repo name: {repo_name}")
Expand Down Expand Up @@ -816,7 +816,7 @@ def _create_repo(self, repo_url_or_path: str, repo_type: str = None, access_toke
logger.error(f"Failed to create repository structure: {e}")
raise

def prepare_db_index(self, embedder_type: str = None, is_ollama_embedder: bool = None,
def prepare_db_index(self, embedder_type: str = None, is_ollama_embedder: bool = None,
excluded_dirs: List[str] = None, excluded_files: List[str] = None,
included_dirs: List[str] = None, included_files: List[str] = None) -> List[Document]:
"""
Expand Down