Files
oracle-openai/.env.example
Wang Defa 0840f35408
All checks were successful
Build and Push OCI GenAI Gateway Docker Image / docker-build-push (push) Successful in 35s
新增 OCI 客户端超时设置,支持连接和读取超时配置
2025-12-09 20:10:14 +08:00

77 lines
2.5 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.
# API Settings
API_TITLE=OCI GenAI to OpenAI API Gateway
API_VERSION=0.0.1
API_PREFIX=/v1
API_PORT=8000
API_HOST=0.0.0.0
DEBUG=false
# Authentication
# Comma-separated list of API keys for authentication
# These are the keys clients will use in Authorization: Bearer <key>
API_KEYS=["sk-oci-genai-default-key"]
# ============================================
# OCI Configuration
# ============================================
# Path to OCI config file (usually ~/.oci/config)
OCI_CONFIG_FILE=~/.oci/config
# Profile names in the OCI config file
# 支持单个或多个 profile多个 profile 用逗号分隔
# 多个 profile 时会自动使用轮询round-robin负载均衡
# 示例:
# 单配置OCI_CONFIG_PROFILE=DEFAULT
# 多配置OCI_CONFIG_PROFILE=DEFAULT,CHICAGO,ASHBURN
# 注意:每个 profile 在 ~/.oci/config 中必须包含 region 和 tenancy (作为 compartment_id)
OCI_CONFIG_PROFILE=DEFAULT
# Authentication type: api_key or instance_principal
OCI_AUTH_TYPE=api_key
# OCI Client Timeout Settings
# Connect timeout: Maximum time (in seconds) to establish connection to OCI API
OCI_CONNECT_TIMEOUT=10
# Read timeout: Maximum time (in seconds) to wait for OCI API response
# Increase this value for long-running requests (e.g., complex conversations)
OCI_READ_TIMEOUT=360
# Optional: Direct endpoint for dedicated models
# GENAI_ENDPOINT=https://your-dedicated-endpoint
# Model Settings
# Note: Available models are dynamically loaded from OCI at startup
# Use GET /v1/models to see all available models
MAX_TOKENS=4096
TEMPERATURE=0.7
# Embedding Settings
# Truncate strategy for embeddings: END or START
EMBED_TRUNCATE=END
# Streaming Settings
# Global streaming on/off switch
# Set to false to disable streaming for all requests (overrides client stream=true)
ENABLE_STREAMING=true
# Chunk size for simulated streaming (fallback mode only)
# Only used when OCI returns non-streaming response
STREAM_CHUNK_SIZE=1024
# Logging
# Log level: DEBUG, INFO, WARNING, ERROR, CRITICAL
LOG_LEVEL=INFO
# Enable detailed request/response logging for debugging
# LOG_REQUESTS: Print incoming request details (method, URL, headers, body)
# LOG_RESPONSES: Print outgoing response details (status, headers, body)
# Note: Sensitive data (like API keys) are automatically filtered from logs
LOG_REQUESTS=false
LOG_RESPONSES=false
# Log file path (optional, if not set logs only to console)
LOG_FILE=./logs/app.log
# Max log file size in MB (default: 10)
LOG_FILE_MAX_SIZE=10
# Number of backup log files to keep (default: 5)
LOG_FILE_BACKUP_COUNT=5