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
181 changes: 181 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
# ============================================================
# Environment Variables Template
# ============================================================
#
# 使用方式:
# 1. 複製此文件: cp .env.example .env
# 2. 填入您的 API 金鑰和配置
# 3. .env 文件已被 .gitignore 忽略,不會被提交到 Git
#
# ============================================================

# ==================== LLM API 金鑰 ====================

# OpenAI API
OPENAI_API_KEY=sk-your-openai-api-key-here
OPENAI_ORG_ID= # 可選
OPENAI_BASE_URL=https://api.openai.com/v1 # 可自定義

# Anthropic API (Claude)
ANTHROPIC_API_KEY=sk-ant-your-anthropic-api-key-here

# Google Gemini API
GOOGLE_API_KEY=your-google-api-key-here

# Cohere API
COHERE_API_KEY=your-cohere-api-key-here

# Hugging Face
HUGGINGFACE_API_KEY=hf_your-huggingface-token-here

# ==================== 向量數據庫 ====================

# Pinecone
PINECONE_API_KEY=your-pinecone-api-key-here
PINECONE_ENVIRONMENT=your-environment

# Weaviate
WEAVIATE_URL=http://localhost:8080
WEAVIATE_API_KEY=your-weaviate-api-key-here

# Qdrant
QDRANT_URL=http://localhost:6333
QDRANT_API_KEY=your-qdrant-api-key-here

# ==================== 搜尋 API ====================

# SerpAPI (Google Search)
SERPAPI_API_KEY=your-serpapi-key-here

# Tavily Search
TAVILY_API_KEY=your-tavily-key-here

# ==================== 監控與追蹤 ====================

# LangSmith
LANGCHAIN_TRACING_V2=true
LANGCHAIN_API_KEY=your-langsmith-api-key-here
LANGCHAIN_PROJECT=my-ai-learning-project
LANGCHAIN_ENDPOINT=https://api.smith.langchain.com

# Weights & Biases
WANDB_API_KEY=your-wandb-api-key-here
WANDB_PROJECT=my-ai-learning
WANDB_ENTITY=your-wandb-username

# MLflow
MLFLOW_TRACKING_URI=http://localhost:5000

# LangFuse
LANGFUSE_PUBLIC_KEY=your-langfuse-public-key
LANGFUSE_SECRET_KEY=your-langfuse-secret-key
LANGFUSE_HOST=https://cloud.langfuse.com

# ==================== 數據庫 ====================

# PostgreSQL (用於向量存儲)
POSTGRES_HOST=localhost
POSTGRES_PORT=5432
POSTGRES_DB=vectordb
POSTGRES_USER=postgres
POSTGRES_PASSWORD=your-password

# MongoDB
MONGODB_URI=mongodb://localhost:27017/ai_learning

# Redis
REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_PASSWORD=your-redis-password

# ==================== 應用配置 ====================

# 環境類型
ENVIRONMENT=development # development, staging, production

# 日誌級別
LOG_LEVEL=INFO # DEBUG, INFO, WARNING, ERROR, CRITICAL

# API 服務配置
API_HOST=0.0.0.0
API_PORT=8000
API_WORKERS=4

# ==================== 模型配置 ====================

# 默認模型
DEFAULT_LLM_MODEL=gpt-4o-mini
DEFAULT_EMBEDDING_MODEL=text-embedding-3-small

# 模型參數
LLM_TEMPERATURE=0.7
LLM_MAX_TOKENS=2000
LLM_TOP_P=0.9

# ==================== RAG 配置 ====================

# 向量數據庫類型
VECTOR_DB=chromadb # chromadb, faiss, pinecone, qdrant

# 檢索配置
RETRIEVAL_TOP_K=5
CHUNK_SIZE=1000
CHUNK_OVERLAP=200

# ==================== 安全配置 ====================

# JWT 密鑰
JWT_SECRET_KEY=your-super-secret-jwt-key-change-in-production
JWT_ALGORITHM=HS256
JWT_EXPIRATION_HOURS=24

# CORS 設定
ALLOWED_ORIGINS=http://localhost:3000,http://localhost:8501

# ==================== 其他服務 ====================

# Ollama (本地 LLM)
OLLAMA_HOST=http://localhost:11434

# Elasticsearch
ELASTICSEARCH_URL=http://localhost:9200
ELASTICSEARCH_API_KEY=your-elasticsearch-api-key

# ==================== 代理設定 ====================

# HTTP 代理 (如需要)
HTTP_PROXY=
HTTPS_PROXY=
NO_PROXY=localhost,127.0.0.1

# ==================== 開發工具 ====================

# 是否啟用調試模式
DEBUG=true

# 是否啟用熱重載
RELOAD=true

# ==================== 雲端服務 ====================

# AWS
AWS_ACCESS_KEY_ID=your-aws-access-key
AWS_SECRET_ACCESS_KEY=your-aws-secret-key
AWS_REGION=us-east-1
AWS_S3_BUCKET=your-s3-bucket

# Google Cloud
GOOGLE_APPLICATION_CREDENTIALS=/path/to/credentials.json
GCP_PROJECT_ID=your-gcp-project-id

# Azure
AZURE_SUBSCRIPTION_ID=your-azure-subscription-id
AZURE_RESOURCE_GROUP=your-resource-group

# ==================== 提醒 ====================
# 🔒 請確保:
# 1. 不要將 .env 文件提交到版本控制
# 2. 生產環境使用強密碼
# 3. 定期輪換 API 金鑰
# 4. 使用環境變量管理敏感信息
# ============================================================
92 changes: 92 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: 🐛 Bug 報告
description: 報告一個問題或錯誤
title: "[Bug]: "
labels: ["bug", "needs-triage"]
body:
- type: markdown
attributes:
value: |
感謝您花時間填寫此錯誤報告!

- type: textarea
id: what-happened
attributes:
label: 發生了什麼?
description: 請詳細描述這個 bug
placeholder: 告訴我們您看到了什麼!
validations:
required: true

- type: textarea
id: expected
attributes:
label: 預期行為
description: 您期望發生什麼?
placeholder: 描述預期的正確行為
validations:
required: true

- type: textarea
id: reproduce
attributes:
label: 重現步驟
description: 如何重現這個問題?
placeholder: |
1. 進入 '...'
2. 點擊 '....'
3. 滾動到 '....'
4. 看到錯誤
validations:
required: true

- type: dropdown
id: area
attributes:
label: 問題領域
description: 這個 bug 屬於哪個領域?
options:
- 數學基礎
- 機器學習
- 深度學習
- LLM 基礎
- RAG 系統
- Agent 系統
- 代碼示例
- 文檔
- 其他
validations:
required: true

- type: textarea
id: environment
attributes:
label: 環境信息
description: 請提供您的環境信息
value: |
- OS: [如 Ubuntu 22.04]
- Python 版本: [如 3.11.5]
- 相關庫版本: [如 PyTorch 2.5.0]
validations:
required: false

- type: textarea
id: logs
attributes:
label: 錯誤日誌
description: 請粘貼相關的錯誤日誌或截圖
render: shell
validations:
required: false

- type: checkboxes
id: terms
attributes:
label: 檢查清單
description: 提交前請確認
options:
- label: 我已搜索過現有的 issues
required: true
- label: 我已閱讀過相關文檔
required: true
- label: 我提供了足夠的信息來重現此問題
required: true
Loading
Loading