Add language parameter for multi-language support

This commit is contained in:
sublimegame
2025-04-16 15:37:23 +07:00
committed by GitHub
parent ad9573a7eb
commit c387aef52d

View File

@@ -5,7 +5,7 @@
> *Ever stared at a new codebase written by others feeling completely lost? This tutorial shows you how to build an AI agent that analyzes GitHub repositories and creates beginner-friendly tutorials explaining exactly how the code works.*
<p align="center">
<img
<img
src="./assets/banner.png" width="800"
/>
</p>
@@ -19,7 +19,7 @@ This is a tutorial project of [Pocket Flow](https://github.com/The-Pocket/Pocket
## ⭐ Example Results for Popular GitHub Repositories!
<p align="center">
<img
<img
src="./assets/example.png" width="600"
/>
</p>
@@ -67,7 +67,7 @@ This is a tutorial project of [Pocket Flow](https://github.com/The-Pocket/Pocket
1. Clone this repository
2. Install dependencies:
2. Install dependencies:
```bash
pip install -r requirements.txt
```
@@ -79,13 +79,13 @@ This is a tutorial project of [Pocket Flow](https://github.com/The-Pocket/Pocket
api_key=os.getenv("GEMINI_API_KEY", "your-api_key"),
)
```
You can use your own models. We highly recommend the latest models with thinking capabilities (Claude 3.7 with thinking, O1). You can verify that it is correctly set up by running:
```bash
python utils/call_llm.py
```
7. Generate a complete codebase tutorial by running the main script:
4. Generate a complete codebase tutorial by running the main script:
```bash
# Analyze a GitHub repository
python main.py --repo https://github.com/username/repo --include "*.py" "*.js" --exclude "tests/*" --max-size 50000
@@ -100,8 +100,16 @@ This is a tutorial project of [Pocket Flow](https://github.com/The-Pocket/Pocket
- `-i, --include` - Files to include (e.g., "*.py" "*.js")
- `-e, --exclude` - Files to exclude (e.g., "tests/*" "docs/*")
- `-s, --max-size` - Maximum file size in bytes (default: 100KB)
The application will crawl the repository, analyze the codebase structure, generate tutorial content, and save the output in the specified directory (default: ./output).
- `--language` - Language for the generated tutorial (default: "english")
To generate tutorials in languages other than English, add the `--language` parameter:
```bash
# Generate a tutorial in Spanish
python main.py --repo https://github.com/username/repo --language "Spanish"
```
The application will crawl the repository, analyze the codebase structure, generate tutorial content in the specified language, and save the output in the specified directory (default: ./output).
## 💡 Development Tutorial
@@ -109,8 +117,8 @@ The application will crawl the repository, analyze the codebase structure, gener
- I built using [**Agentic Coding**](https://zacharyhuang.substack.com/p/agentic-coding-the-most-fun-way-to), the fastest development paradigm, where humans simply [design](docs/design.md) and agents [code](flow.py).
- The secret weapon is [Pocket Flow](https://github.com/The-Pocket/PocketFlow), a 100-line LLM framework that lets Agents (e.g., Cursor AI) build for you
- Check out the Step-by-step YouTube development tutorial:
- Check out the Step-by-step YouTube development tutorial:
<br>
<div align="center">