-
Notifications
You must be signed in to change notification settings - Fork 231
Expand file tree
/
Copy pathconfig.conf.example
More file actions
executable file
·138 lines (121 loc) · 4.8 KB
/
Copy pathconfig.conf.example
File metadata and controls
executable file
·138 lines (121 loc) · 4.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# Configuration File for WebAI-to-API Server
# -------------------------------------------
# ⚠️ Note: This file is *only* used by the WebAI-to-API server.
# --- Browser Settings ---
# name: Host browser used for local cookie discovery (chrome, firefox, brave, edge, safari).
# This does NOT select the browser automation runtime.
# runtime: Browser automation runtime backend.
# Supported options: playwright
[Browser]
name = chrome
runtime = playwright
# --- Authentication Methods ---
# WebAI-to-API supports multiple authentication approaches:
#
# 1. MANUAL COOKIES (Gemini WebAPI):
# - Add __Secure-1PSID and __Secure-1PSIDTS below
# - Works immediately, no browser required
#
# 2. BROWSER LOGIN (Playwright):
# - Run: poetry run python verify_login.py (on HOST machine, not in Docker)
# - Creates runtime/auth/gemini.json with authentication state
# - Docker container automatically consumes this file
# - Required for: playwright/* model requests
#
# For Docker + Playwright deployments: Use Method 2 (verify_login.py)
# --- Gemini Configuration ---
# Configure the Google Gemini provider.
#
# Execution Strategy:
# - webapi: Lightweight, fast, uses unofficial API wrappers.
# - playwright: Browser-native runtime (Chromium). Most resilient.
# NOTE: Using a 'playwright/...' model prefix in your request will
# automatically override this global backend configuration.
#
# Default Model:
# Choose the model to be used when none is specified in the request.
# Default Gemini model. Runtime availability is discovered from the current account.
#
# Optional manual Gemini WebAPI authentication.
# Prefer browser login which stores auth state in runtime/auth/gemini.json.
# Both cookies are required if using manual configuration.
[Gemini]
backend = webapi
default_model = gemini-3-flash
extended_thinking = false
__Secure-1PSID =
__Secure-1PSIDTS =
# --- Legacy Cookie Support (DEPRECATED) ---
# For backward compatibility only. Please migrate to [Gemini] section.
# Both cookies are required if using legacy format.
[Cookies]
gemini_cookie_1psid =
gemini_cookie_1psidts =
# --- AI Services Toggle ---
# Enable or disable specific AI providers.
# Use "true" to enable and "false" to disable.
[EnabledAI]
gemini = true
# --- Atlas Cloud Configuration ---
# API key and endpoint for the Atlas Cloud provider.
#
# Precedence Order:
# OS Env > .env.local > .env > config.conf > defaults
#
# NOTE: For production, Docker, or CI/CD deployments, it is highly
# recommended to use environment variables (ATLASCLOUD_API_KEY,
# ATLASCLOUD_BASE_URL) rather than committing secrets to this file.
[Atlas]
api_key =
base_url = https://api.atlascloud.ai/v1
# --- Proxy Configuration ---
# The app, use this proxy to connect gemini servers.
# Its usefull to fix errors like 403 or restricted connections
# Example: http_proxy = http://127.0.0.1:2334
[Proxy]
http_proxy =
# --- Playwright Settings ---
# Settings for the browser automation engine.
[Playwright]
# Run in headless mode (true/false)
# Note: Set to false for verify_login.py interactive login
# Docker containers use PLAYWRIGHT_HEADLESS=true environment variable
headless = false
# Directory for provider browser storage state files
# This directory is mounted as a volume in Docker deployments
# AUTHENTICATION STATE: runtime/auth/gemini.json is created by verify_login.py
auth_state_dir = runtime/auth
# Concurrency locking backend for on-demand authentication coordination.
# Default: in_memory (process-bound). Swapping this is required for production
# multi-worker/Gunicorn or horizontally scaled SaaS deployments to avoid races.
# Supported future values: redis, postgres.
auth_lock_backend = in_memory
# =====================================================================
# --- Advanced Playwright Engine Tuning ---
# ⚠️ Only modify these if you understand the runtime architecture.
# =====================================================================
# -- Capacity Limits --
# Maximum concurrent pages across all sessions (HARD LIMIT via semaphore)
max_concurrent_pages = 5
# Global soft-cap for total open pages across all sessions (eviction threshold)
max_total_tabs = 50
# Maximum conversations to keep in the LRU registry per provider
max_persistent_conversations = 20
# -- Timeouts (Milliseconds) --
# Passed directly to Playwright underlying APIs.
navigation_timeout = 30000
ui_wait_timeout = 15000
# -- Timeouts (Seconds) --
# Used by Python asyncio layer for application-level lifecycle management.
chunk_timeout = 90
total_request_timeout = 120
idle_conversation_timeout = 900
lease_timeout = 180
# --- Logging Settings ---
# Configure server log output and verbosity.
# Precedence: CLI Arg > OS Env > config.conf > Default
[Logging]
# Log level: DEBUG, INFO, WARNING, ERROR, CRITICAL
level = INFO
# Set to true to disable Uvicorn HTTP access logging
disable_access_logs = false