[AI] Route AI calls through the Xray/V2Ray proxy (reach OpenAI from Iran)
Add AiUseProxy setting + a toggle in the AI settings section. ScrapeHttpClients.ForAi(settings) returns a proxied HttpClient (reusing IngestProxyUrl, 100s timeout) when AiUseProxy is on, otherwise direct; AI-cache keys are protected from the scrape-client cleanup. OpenAiCompatibleAuditor now uses it, so the AI auditor (e.g. api.openai.com) is reachable through the same Xray sidecar that serves Telegram. Migration adds the column. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -32,6 +32,10 @@ public class AppSetting
|
||||
/// <summary>If AI approves AND Mode is Automatic, publish without human review.</summary>
|
||||
public bool AiAutoApprove { get; set; } = false;
|
||||
|
||||
/// <summary>Route AI calls through the ingestion proxy (IngestProxyUrl) — needed when the AI
|
||||
/// endpoint (e.g. api.openai.com) is blocked in Iran.</summary>
|
||||
public bool AiUseProxy { get; set; } = false;
|
||||
|
||||
// --- Channel scraping sources (configured here, NOT in env) ---
|
||||
/// <summary>Run the ingestion worker on a timer.</summary>
|
||||
public bool AutoIngestEnabled { get; set; } = false;
|
||||
|
||||
Reference in New Issue
Block a user