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
188 changes: 56 additions & 132 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,137 +1,61 @@
# Logs
logs
# Byte-compiled / optimized / DLL files
__pycache__/
*.pyc
*.pyd
*.pyo
*.pyl

# Documentation
# *.html
# *.pdf
# *.epub
# *.docx

# Unit test / coverage reports
.pytest_cache/
.coverage
htmlcov/
.nox/
.tox/

# Virtual environment
# Note: It's generally a good practice to commit the requirements.txt/Pipfile.lock,
# but ignore the actual virtual environment directory.
.venv/
venv/
env/
/bin
/include
/lib
/lib64
/pyvenv.cfg
/share

# Distribution / Packaging
.Python
build/
develop-eggs/
dist/
eggs/
*.egg-info/
.installed.cfg
MANIFEST
sdist/
wheel/

# Logs and databases
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
*.sqlite
*.db

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
# OS-specific files
.DS_Store
Thumbs.db

# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Editor/IDE-specific files
.vscode/
.idea/
*.swp
*~

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
.env

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp
.cache

# Sveltekit cache directory
.svelte-kit/

# vitepress build output
**/.vitepress/dist

# vitepress cache directory
**/.vitepress/cache

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# Firebase cache directory
.firebase/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v3
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

# Vite logs files
vite.config.js.timestamp-*
vite.config.ts.timestamp-*
Empty file added features/.gitkeep
Empty file.
File renamed without changes.
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,8 @@ description = "A GitHub automation toolkit powered by machine learning."
readme = "README.md"
requires-python = ">=3.10"
dependencies = []

[tool.uv.workspace]
members = [
"tools",
]
6 changes: 0 additions & 6 deletions src/main.py

This file was deleted.

Empty file added tools/.gitkeep
Empty file.
1 change: 1 addition & 0 deletions tools/doc_generator/.env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
GOOGLE_API_KEY=
1 change: 1 addition & 0 deletions tools/doc_generator/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
src/temp/*
40 changes: 40 additions & 0 deletions tools/doc_generator/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Multi-stage build for better optimization
FROM python:3.10-slim-buster AS builder

# Install uv by copying from the official image
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/

# Set working directory
WORKDIR /app

# Copy dependency files first (for better caching)
COPY pyproject.toml uv.lock ./

# Install dependencies only (not the project itself yet)
RUN uv sync --locked --no-install-project

# Copy the rest of the application
COPY src ./src
COPY .env .env

# Install the project itself
RUN uv sync --locked

# Final stage
FROM python:3.10-slim-buster

# Copy the virtual environment from builder
COPY --from=builder /app/.venv /app/.venv

# Copy application files
COPY --from=builder /app/src /app/src
COPY --from=builder /app/.env /app/.env

# Set working directory
WORKDIR /app

# Make sure the virtual environment is used
ENV PATH="/app/.venv/bin:$PATH"

# Run the application
CMD ["python", "-m", "src.main"]
57 changes: 57 additions & 0 deletions tools/doc_generator/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
## Doc Generator Tool

### Overview

This utility employs Docker Compose to manage and run a service that utilizes the **Gemini API** for automated documentation generation.

---

### Prerequisites

- **Docker** and **Docker Compose** installed.
- A **Gemini API Key** from Google.

---

### Setup and Configuration

#### 1\. Gemini API Key

The service requires the `GEMINI_API_KEY` environment variable for operation.

1. **Obtain Key:** Retrieve your API key from the [Google AI Studio documentation](https://aistudio.google.com/api-keys).

2. **Configuration File:** Create a file named **`.env`** in the root directory where your `docker-compose.yml` file is located (or in the `tool/doc_generator/` directory if that is your execution context).

3. **Key Format:** Populate the `.env` file as follows:

```bash
GEMINI_API_KEY=YOUR_ACTUAL_API_KEY_HERE
```

#### 2\. System Prompt Customization

The operational behavior and output style of the document generator can be modified by editing the system prompt file:

- **File Path:** `doc_generator/src/system_promp.py`

#### 3\. Output Directory

Generated files are persisted to the host machine through a volume mount, allowing easy access and management:

| Host Path | Container Path |
| :----------- | :-------------- |
| `./src/temp` | `/app/src/temp` |

---

### Usage

The following commands facilitate the lifecycle management of the `doc_generator` service.

| Action | Command | Notes |
| :---------------------- | :------------------------------------- | :-------------------------------------------------------------------------- |
| **Initial Build & Run** | `docker compose up --build -d` | Builds the image if not present and starts the container in detached mode. |
| **Start Existing** | `docker compose up -d` | Starts the container using the existing built image. |
| **View Logs** | `docker compose logs -f doc_generator` | Streams real-time logs for the service. |
| **Stop & Clean Up** | `docker compose down` | Stops and removes the container, networks, and volumes defined in the file. |
9 changes: 9 additions & 0 deletions tools/doc_generator/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: "3.8"
services:
doc_generator:
build: .
restart: always
volumes:
- ./src/temp:/app/src/temp
environment:
- GEMINI_API_KEY=${GEMINI_API_KEY}
12 changes: 12 additions & 0 deletions tools/doc_generator/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[project]
name = "doc_generator"
version = "0.1.0"
description = "This tool helps to generator data."
readme = "README.md"
requires-python = ">=3.10"
dependencies = [
"langchain>=0.3.27",
"langchain-google-genai>=2.1.12",
"langgraph>=0.6.7",
"python-dotenv>=1.1.1",
]
Loading