fix: honor explicit perplexity source requests

This commit is contained in:
Dinakar Sarbada
2026-05-06 12:40:02 -07:00
committed by Trevin Chow
parent 6a5a122195
commit 5b29b8f427
2 changed files with 10 additions and 1 deletions
+3 -1
View File
@@ -120,7 +120,9 @@ def available_sources(config: dict[str, Any], requested_sources: list[str] | Non
available.append("grounding")
# Perplexity Sonar: opt-in additive source via INCLUDE_SOURCES=perplexity
include_sources = (config.get("INCLUDE_SOURCES") or "").lower().split(",")
if config.get("OPENROUTER_API_KEY") and "perplexity" in include_sources:
if config.get("OPENROUTER_API_KEY") and (
"perplexity" in include_sources or (requested_sources and "perplexity" in requested_sources)
):
available.append("perplexity")
if requested_sources and "xiaohongshu" in requested_sources and env.is_xiaohongshu_available(config):
available.append("xiaohongshu")