PMFlow/backend/.env.example

97 lines
3.7 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Database Configuration
DATABASE_URL=postgresql+asyncpg://pmflow:pmflow_pass@db:5432/pmflow
# 可选:启动方言守卫(postgresql / sqlite)。配置后若不一致将拒绝启动。
PMFLOW_EXPECTED_DB_DIALECT=postgresql
# For PostgreSQL with pgvector:
# DATABASE_URL=postgresql+asyncpg://postgres:postgres@localhost:5435/neural_sync
# For local SQLite quick-start:
# DATABASE_URL=sqlite+aiosqlite:///./neural_sync.db
# Redis Configuration
REDIS_URL=redis://:pmflow_redis_pass@redis:6379/0
# Knowledge Graph Incremental Scheduler
KG_INCREMENTAL_INTERVAL_MINUTES=5
KG_INCREMENTAL_DELTA_LIMIT=1000
KG_INCREMENTAL_EVENT_BATCH=200
KG_CODE_SCAN_INTERVAL_HOURS=6
# ========================================
# LLM / OpenClaw Control Plane
# ========================================
# 单一控制面:PMFlow 仅调用 OpenClaw 网关(OpenAI-Compatible)
LLM_PROVIDER=openai
OPENAI_BASE_URL=http://openclaw:18789/v1
OPENAI_API_KEY=<OPENCLAW_GATEWAY_TOKEN>
# OpenClaw 函数路由
OPENCLAW_ROUTING_ENABLED=true
OPENCLAW_ROUTING_RULES_PATH=/app/backend/.openclaw/pmflow-routing-rules.json
# OpenClaw agent 默认超时(秒):用于注入 chat/completions -> agents.defaults.timeoutSeconds
OPENCLAW_AGENTS_DEFAULT_TIMEOUT_SECONDS=120
# 关闭 PMFlow 内部 mixed routing,优先以 OpenClaw 规则为准
LLM_MIXED_ROUTING_ENABLED=false
LLM_ROUTING_DEFAULT_TIER=active
LLM_LOW_TO_HIGH_ESCALATION_ENABLED=true
# low/high/safety tier 默认模型(由网关解释)
LLM_ROUTING_LOW_PROVIDER=openai
LLM_ROUTING_LOW_MODEL=zai/glm-4-flash
LLM_ROUTING_HIGH_PROVIDER=openai
LLM_ROUTING_HIGH_MODEL=minimax/MiniMax-M2.5
LLM_ROUTING_SAFETY_PROVIDER=openai
LLM_ROUTING_SAFETY_MODEL=deepseek/deepseek-chat
# 应急开关:仅在网关不可用时允许直连 provider(默认关闭)
LLM_DIRECT_EMERGENCY_ENABLED=false
LLM_FALLBACK_PROVIDER=ollama
# Adaptive RAG 深入思考模式(前端开关=deep 时生效)
RAG_DEEP_RETRIEVAL_STEPS=5
RAG_DEEP_VECTOR_TOP_K=12
RAG_DEEP_CONTEXT_BLOCKS=16
RAG_DEEP_ANSWER_MAX_TOKENS=1400
# --- Emergency Direct Provider Keys (optional) ---
GLM_API_KEY=
GLM_BASE_URL=https://open.bigmodel.cn/api/paas/v4
GLM_MODEL=glm-4-flash
DEEPSEEK_API_KEY=
DEEPSEEK_BASE_URL=https://api.deepseek.com/v1
# --- Ollama 本地配置(应急本地兜底) ---
OLLAMA_HOST=http://127.0.0.1:11434
OLLAMA_CHAT_MODEL=llama3:8b
OLLAMA_EMBEDDING_MODEL=nomic-embed-text
OLLAMA_BASE_URL=http://127.0.0.1:11434
OLLAMA_MODEL=llama3:latest
# ========================================
# Multi-Model Voting Configuration (仅 Ollama 支持)
# For high-impact signals (impact_score >= VOTING_THRESHOLD), multiple models will vote
# Available models: llama3, llama3.2, qwen2.5, mistral, deepseek-coder, etc.
VOTING_MODELS=llama3,qwen2.5,mistral
VOTING_THRESHOLD=0.8
# Business Context for AI Strategic Analysis
# Customize this to match your actual product/team
# This context is used by the AI to evaluate external signals
BUSINESS_CONTEXT=Pixelle-Video: An AI-powered automated short video generation platform. Core features: topic-to-video automation (script generation → AI images/videos → TTS → BGM → final video). Tech stack: Python, Streamlit, FastAPI, ComfyUI workflows. AI models: FLUX/Qwen/SDXL for images, WAN 2.1/2.2 for videos, Edge TTS/Index TTS for voice. Supports multiple pipelines: standard generation, custom assets, digital human, image-to-video, action transfer.
# Plane PM Tool Integration (optional, simulation mode if not set)
PLANE_API_URL=https://api.plane.so/api/v1
PLANE_API_KEY=
PLANE_WORKSPACE_SLUG=
PLANE_PROJECT_ID=
# Lark/Feishu Bot Integration (optional)
LARK_APP_ID=
LARK_APP_SECRET=
LARK_VERIFICATION_TOKEN=
# 飞书长连接重试策略(指数退避 1s -> 2s -> 4s,最多 3 次)
FEISHU_LONG_CONNECTION_RETRY_BASE_SECONDS=1
FEISHU_LONG_CONNECTION_RETRY_MAX_ATTEMPTS=3