|
| 1 | +# ============================================================================ |
| 2 | +# AI Doc Gen - Environment Configuration |
| 3 | +# ============================================================================ |
| 4 | +# |
| 5 | +# This file contains all configurable environment variables for the AI Doc Gen |
| 6 | +# application. Copy this file to `.env` and update the values as needed. |
| 7 | +# |
| 8 | +# 📋 Quick Setup Checklist: |
| 9 | +# 1. Copy this file: cp .env.sample .env |
| 10 | +# 2. Set your LLM API keys and base URLs |
| 11 | +# 3. Configure GitLab integration (for cronjob mode) |
| 12 | +# 4. Adjust retry/timeout settings based on your environment |
| 13 | +# 5. Enable observability tools if needed (Langfuse) |
| 14 | +# |
| 15 | +# 🚀 For rate-limited environments, increase retry values: |
| 16 | +# - ANALYZER_AGENT_RETRIES=5 |
| 17 | +# - TOOL_FILE_READER_MAX_RETRIES=5 |
| 18 | +# - HTTP_RETRY_MAX_ATTEMPTS=10 |
| 19 | +# ============================================================================ |
| 20 | + |
| 21 | +# ------------- Core Application Settings ---------- |
1 | 22 | PYTHONPATH=src |
2 | | -ENVIRONMENT=development |
| 23 | +ENVIRONMENT=development # Options: development, staging, production |
3 | 24 |
|
4 | | -# ------------ Langfuse ------------ |
5 | | -ENABLE_LANGFUSE=false |
6 | | -OTEL_SDK_DISABLED=false |
| 25 | +# ------------- Observability & Telemetry ---------- |
| 26 | +# Langfuse provides LLM observability and analytics |
| 27 | +ENABLE_LANGFUSE=false # Set to 'true' to enable Langfuse tracking |
| 28 | +OTEL_SDK_DISABLED=false # OpenTelemetry SDK control |
7 | 29 |
|
| 30 | +# Langfuse Configuration (only needed if ENABLE_LANGFUSE=true) |
8 | 31 | LANGFUSE_PUBLIC_KEY=YOUR_PUBLIC_KEY_HERE |
9 | 32 | LANGFUSE_SECRET_KEY=YOUR_SECRET_KEY_HERE |
10 | 33 | LANGFUSE_HOST=https://YOUR_LANGFUSE_HOST_HERE |
11 | 34 | OTEL_EXPORTER_OTLP_ENDPOINT=YOUR_OTEL_ENDPOINT_HERE |
12 | 35 |
|
13 | | -# ------------ LLM Agents ------------ |
| 36 | +# ============================================================================ |
| 37 | +# 🤖 LLM AGENTS CONFIGURATION |
| 38 | +# ============================================================================ |
| 39 | + |
| 40 | +# ------------- Analyzer Agent (Code Analysis) ---------- |
| 41 | +# The analyzer agent performs code structure, dependency, data flow, and API analysis |
14 | 42 | ANALYZER_LLM_MODEL=claude-sonnet-4-20250514 |
15 | | -ANALYZER_LLM_BASE_URL=YOUR_ANALYZER_BASE_URL_HERE |
16 | | -ANALYZER_LLM_API_KEY=YOUR_ANALYZER_API_KEY_HERE |
17 | | -ANALYZER_PARALLEL_TOOL_CALLS=true |
| 43 | +ANALYZER_LLM_BASE_URL=YOUR_ANALYZER_BASE_URL_HERE # e.g., https://api.anthropic.com |
| 44 | +ANALYZER_LLM_API_KEY=YOUR_ANALYZER_API_KEY_HERE # Your LLM provider API key |
| 45 | +ANALYZER_PARALLEL_TOOL_CALLS=true # Enable parallel tool execution |
| 46 | + |
| 47 | +# Analyzer Agent Behavior Settings |
| 48 | +ANALYZER_AGENT_RETRIES=2 # Retries per analysis agent on failure |
| 49 | +ANALYZER_LLM_TIMEOUT=180 # Request timeout in seconds (3 minutes) |
| 50 | +ANALYZER_LLM_MAX_TOKENS=8192 # Maximum tokens in LLM responses |
| 51 | +ANALYZER_LLM_TEMPERATURE=0.0 # Response randomness (0.0=deterministic, 1.0=creative) |
18 | 52 |
|
| 53 | +# ------------- Documenter Agent (README Generation) ---------- |
| 54 | +# The documenter agent generates comprehensive README.md files |
19 | 55 | DOCUMENTER_LLM_MODEL=claude-sonnet-4-20250514 |
20 | 56 | DOCUMENTER_LLM_BASE_URL=YOUR_DOCUMENTER_BASE_URL_HERE |
21 | 57 | DOCUMENTER_LLM_API_KEY=YOUR_DOCUMENTER_API_KEY_HERE |
22 | 58 | DOCUMENTER_PARALLEL_TOOL_CALLS=true |
23 | 59 |
|
24 | | -# ------------- Gitlab ---------- |
25 | | -GITLAB_API_URL=https://git.divar.cloud |
26 | | -GITLAB_USER_NAME=AI Analyzer |
27 | | -GITLAB_USER_USERNAME=agent_doc |
28 | | -GITLAB_USER_EMAIL=YOUR_EMAIL_HERE |
29 | | -GITLAB_OAUTH_TOKEN=YOUR_GITLAB_TOKEN_HERE |
| 60 | +# Documenter Agent Behavior Settings |
| 61 | +DOCUMENTER_AGENT_RETRIES=2 # Retries for documenter agent on failure |
| 62 | +DOCUMENTER_LLM_TIMEOUT=180 # Request timeout in seconds |
| 63 | +DOCUMENTER_LLM_MAX_TOKENS=8192 # Maximum tokens in LLM responses |
| 64 | +DOCUMENTER_LLM_TEMPERATURE=0.0 # Response randomness (0.0=deterministic) |
| 65 | + |
| 66 | +# ============================================================================ |
| 67 | +# 🔧 RETRY & RESILIENCE CONFIGURATION |
| 68 | +# ============================================================================ |
| 69 | + |
| 70 | +# ------------- Agent Tools Settings ---------- |
| 71 | +# These settings control the retry behavior for internal tools used by agents |
| 72 | +TOOL_FILE_READER_MAX_RETRIES=2 # File reading tool retry attempts |
| 73 | +TOOL_LIST_FILES_MAX_RETRIES=2 # File listing tool retry attempts |
| 74 | + |
| 75 | +# ------------- HTTP Retry Client ---------- |
| 76 | +# Controls retry behavior for all HTTP requests to LLM providers |
| 77 | +# 💡 Increase these values if you encounter rate limiting issues |
| 78 | +HTTP_RETRY_MAX_ATTEMPTS=5 # Total HTTP retry attempts before failure |
| 79 | +HTTP_RETRY_MULTIPLIER=1 # Exponential backoff multiplier (1s→2s→4s→8s) |
| 80 | +HTTP_RETRY_MAX_WAIT_PER_ATTEMPT=60 # Maximum wait between attempts (seconds) |
| 81 | +HTTP_RETRY_MAX_TOTAL_WAIT=300 # Maximum total wait time (5 minutes) |
| 82 | + |
| 83 | +# ⚡ Rate Limiting Solutions: |
| 84 | +# If you encounter "max retries exceeded" or "request limit" errors: |
| 85 | +# - Increase HTTP_RETRY_MAX_ATTEMPTS to 10+ |
| 86 | +# - Increase ANALYZER_AGENT_RETRIES to 5+ |
| 87 | +# - Increase timeout values (ANALYZER_LLM_TIMEOUT=300+) |
| 88 | + |
| 89 | +# ============================================================================ |
| 90 | +# 🔗 GITLAB INTEGRATION (Required for Cronjob Mode) |
| 91 | +# ============================================================================ |
| 92 | + |
| 93 | +# GitLab API Configuration |
| 94 | +GITLAB_API_URL=https://git.divar.cloud # Your GitLab instance URL |
| 95 | +GITLAB_USER_NAME=AI Analyzer # Display name for commits/MRs |
| 96 | +GITLAB_USER_USERNAME=agent_doc # GitLab username for the bot |
| 97 | +GITLAB_USER_EMAIL=YOUR_EMAIL_HERE # Email for Git commits |
| 98 | +GITLAB_OAUTH_TOKEN=YOUR_GITLAB_TOKEN_HERE # GitLab access token with repo permissions |
| 99 | + |
| 100 | +# 🔑 GitLab Token Permissions Required: |
| 101 | +# - api (full API access) |
| 102 | +# - read_repository (read repo contents) |
| 103 | +# - write_repository (create branches, commits) |
| 104 | + |
| 105 | +# ============================================================================ |
| 106 | +# 📊 LOGGING & DEBUGGING |
| 107 | +# ============================================================================ |
| 108 | + |
| 109 | +# Logging Configuration |
| 110 | +CONSOLE_LOG_LEVEL=WARNING # Console output level |
| 111 | +FILE_LOG_LEVEL=INFO # File logging level |
| 112 | + |
| 113 | +# Available log levels (from most to least verbose): |
| 114 | +# DEBUG - Detailed debugging information |
| 115 | +# INFO - General information messages |
| 116 | +# WARNING - Warning messages (default for console) |
| 117 | +# ERROR - Error messages only |
| 118 | +# CRITICAL - Critical errors only |
| 119 | + |
| 120 | +# 🐛 For debugging issues: |
| 121 | +# Set CONSOLE_LOG_LEVEL=DEBUG to see detailed operation logs |
| 122 | + |
| 123 | +# ============================================================================ |
| 124 | +# 🚀 DEPLOYMENT-SPECIFIC RECOMMENDATIONS |
| 125 | +# ============================================================================ |
| 126 | + |
| 127 | +# Development Environment: |
| 128 | +# - Use DEBUG log levels for troubleshooting |
| 129 | +# - Lower retry counts for faster feedback |
| 130 | +# - Enable Langfuse for observability |
| 131 | + |
| 132 | +# Production Environment: |
| 133 | +# - Use WARNING/ERROR log levels |
| 134 | +# - Higher retry counts for resilience |
| 135 | +# - Monitor with Langfuse/OTEL |
| 136 | +# - Set appropriate timeout values based on your LLM provider |
30 | 137 |
|
31 | | -# ------------- App ---------- |
32 | | -APP_VERSION=1.1.0 |
| 138 | +# Rate-Limited Environments: |
| 139 | +# - ANALYZER_AGENT_RETRIES=5+ |
| 140 | +# - HTTP_RETRY_MAX_ATTEMPTS=10+ |
| 141 | +# - HTTP_RETRY_MAX_TOTAL_WAIT=600+ |
| 142 | +# - ANALYZER_LLM_TIMEOUT=300+ |
33 | 143 |
|
34 | | -CONSOLE_LOG_LEVEL=WARNING # Options: DEBUG, INFO, WARNING, ERROR, CRITICAL |
35 | | -FILE_LOG_LEVEL=INFO # Options: DEBUG, INFO, WARNING, ERROR, CRITICAL |
| 144 | +# High-Performance Environments: |
| 145 | +# - ANALYZER_PARALLEL_TOOL_CALLS=true |
| 146 | +# - DOCUMENTER_PARALLEL_TOOL_CALLS=true |
| 147 | +# - Higher ANALYZER_LLM_MAX_TOKENS values |
| 148 | +# - Lower timeout values for faster failures |
0 commit comments