diff --git a/Ollama-instruction.md b/Ollama-instruction.md index 2c5572c4..521b4571 100644 --- a/Ollama-instruction.md +++ b/Ollama-instruction.md @@ -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 ``` @@ -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 \ diff --git a/README.es.md b/README.es.md index 990c5e8e..629f733e 100644 --- a/README.es.md +++ b/README.es.md @@ -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 ``` diff --git a/README.fr.md b/README.fr.md index c2fbdc46..22c4875c 100644 --- a/README.fr.md +++ b/README.fr.md @@ -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) @@ -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 ``` diff --git a/README.ja.md b/README.ja.md index c5782550..f9b8e10e 100644 --- a/README.ja.md +++ b/README.ja.md @@ -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 ``` diff --git a/README.kr.md b/README.kr.md index b83cbf6c..d4438a7e 100644 --- a/README.kr.md +++ b/README.kr.md @@ -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 ``` diff --git a/README.md b/README.md index d2128022..6661fcc1 100644 --- a/README.md +++ b/README.md @@ -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 ``` @@ -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 | @@ -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. diff --git a/README.pt-br.md b/README.pt-br.md index 45edfccd..73ce5da8 100644 --- a/README.pt-br.md +++ b/README.pt-br.md @@ -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 ``` @@ -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 | diff --git a/README.ru.md b/README.ru.md index fb85509a..489a99a4 100644 --- a/README.ru.md +++ b/README.ru.md @@ -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) @@ -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 ``` @@ -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 анализирует сложные темы* ### Видео-демо diff --git a/README.vi.md b/README.vi.md index 7047c307..5dce62d4 100644 --- a/README.vi.md +++ b/README.vi.md @@ -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 ``` diff --git a/README.zh-tw.md b/README.zh-tw.md index 9201c0ba..c0bac77a 100644 --- a/README.zh-tw.md +++ b/README.zh-tw.md @@ -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 ``` @@ -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 伺服器時才需要 | diff --git a/README.zh.md b/README.zh.md index 165d05e3..563b38d0 100644 --- a/README.zh.md +++ b/README.zh.md @@ -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 ``` diff --git a/api/README.md b/api/README.md index 3172037a..78f8760a 100644 --- a/api/README.md +++ b/api/README.md @@ -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 @@ -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 ``` diff --git a/api/data_pipeline.py b/api/data_pipeline.py index 67b2dcbf..b73597f3 100644 --- a/api/data_pipeline.py +++ b/api/data_pipeline.py @@ -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 @@ -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): """ @@ -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() @@ -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 @@ -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}" @@ -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() @@ -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() @@ -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, @@ -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}") @@ -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]: """