Skip to content
Merged
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: 4 additions & 1 deletion .env.sample
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
GEMINI_PROJECT_ID=<GEMINI_PROJECT_ID>
GITHUB_TOKEN=<GITHUB_TOKEN>
GEMINI_API_KEY=<GEMINI_API_KEY>
GITHUB_TOKEN=<GITHUB_TOKEN>
OPENROUTER_API_KEY = <OPENROUTER_API_KEY>
OPENROUTER_MODEL = <OPENROUTER_MODEL>
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,11 @@ coverage/
llm_cache.json

# Output files
output/
output/

# uv manage
pyproject.toml
uv.lock

docs/*.pdf
docs/design-cn.md
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ This is a tutorial project of [Pocket Flow](https://github.com/The-Pocket/Pocket
- `-e, --exclude` - Files to exclude (e.g., "tests/*" "docs/*")
- `-s, --max-size` - Maximum file size in bytes (default: 100KB)
- `--language` - Language for the generated tutorial (default: "english")
- `--max-abstractions` - Maximum number of abstractions to identify (default: 10)
- `--no-cache` - Disable LLM response caching (default: caching enabled)

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).

Expand Down
15 changes: 14 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@
}

DEFAULT_EXCLUDE_PATTERNS = {
"assets/*", "data/*", "examples/*", "images/*", "public/*", "static/*", "temp/*",
"docs/*",
"venv/*", ".venv/*", "*test*", "tests/*", "docs/*", "examples/*", "v1/*",
"dist/*", "build/*", "experimental/*", "deprecated/*",
"dist/*", "build/*", "experimental/*", "deprecated/*", "misc/*",
"legacy/*", ".git/*", ".github/*", ".next/*", ".vscode/*", "obj/*", "bin/*", "node_modules/*", "*.log"
}

Expand All @@ -36,6 +38,10 @@ def main():
parser.add_argument("-s", "--max-size", type=int, default=100000, help="Maximum file size in bytes (default: 100000, about 100KB).")
# Add language parameter for multi-language support
parser.add_argument("--language", default="english", help="Language for the generated tutorial (default: english)")
# Add use_cache parameter to control LLM caching
parser.add_argument("--no-cache", action="store_true", help="Disable LLM response caching (default: caching enabled)")
# Add max_abstraction_num parameter to control the number of abstractions
parser.add_argument("--max-abstractions", type=int, default=10, help="Maximum number of abstractions to identify (default: 20)")

args = parser.parse_args()

Expand All @@ -61,6 +67,12 @@ def main():

# Add language for multi-language support
"language": args.language,

# Add use_cache flag (inverse of no-cache flag)
"use_cache": not args.no_cache,

# Add max_abstraction_num parameter
"max_abstraction_num": args.max_abstractions,

# Outputs will be populated by the nodes
"files": [],
Expand All @@ -73,6 +85,7 @@ def main():

# Display starting message with repository/directory and language
print(f"Starting tutorial generation for: {args.repo or args.dir} in {args.language.capitalize()} language")
print(f"LLM caching: {'Disabled' if args.no_cache else 'Enabled'}")

# Create the flow instance
tutorial_flow = create_tutorial_flow()
Expand Down
Loading