(user_id: str, export_format: str = "markdown")
| 1281 | def _configured_report_style() -> str: |
| 1282 | style = (_env_text("PAPERFLOW_REPORT_STYLE", "standard") or "standard").strip().lower() |
| 1283 | return style if style in {"standard", "deep", "brief"} else "standard" |
| 1284 | |
| 1285 | |
| 1286 | def _configured_daily_sources( |
| 1287 | *, |
| 1288 | arxiv_categories: Optional[Iterable[Any]], |
| 1289 | conferences: Optional[Iterable[Any]], |
| 1290 | journals: Optional[Iterable[Any]], |
| 1291 | ) -> Dict[str, List[str]]: |
| 1292 | source_preferences = settings().get("source_preferences", {}) |
| 1293 | resolved_arxiv = ( |
| 1294 | _string_list(arxiv_categories) |
| 1295 | if arxiv_categories is not None |
| 1296 | else _string_list(source_preferences.get("arxiv_categories")) |
| 1297 | ) |
| 1298 | resolved_conferences = ( |
| 1299 | _string_list(conferences) |
| 1300 | if conferences is not None |
| 1301 | else _string_list(source_preferences.get("conferences")) |
| 1302 | ) |
| 1303 | resolved_journals = ( |
| 1304 | _string_list(journals) |
| 1305 | if journals is not None |
| 1306 | else _string_list(source_preferences.get("journals")) |
| 1307 | ) |
| 1308 | |
| 1309 | if arxiv_categories is None and source_preferences.get("enable_arxiv") is False: |
| 1310 | resolved_arxiv = [] |
| 1311 | if conferences is None and source_preferences.get("enable_openreview") is False: |
| 1312 | resolved_conferences = [] |
| 1313 | |
| 1314 | return { |
| 1315 | "arxiv_categories": resolved_arxiv, |
| 1316 | "conferences": resolved_conferences, |
| 1317 | "journals": resolved_journals, |
| 1318 | "custom_rss_urls": _string_list(source_preferences.get("custom_rss_urls")) |
| 1319 | if source_preferences.get("enable_custom_rss") |
| 1320 | else [], |
| 1321 | "enable_semantic_scholar": bool(source_preferences.get("enable_semantic_scholar")), |
| 1322 | "enable_custom_rss": bool(source_preferences.get("enable_custom_rss")), |
| 1323 | } |
| 1324 | |
| 1325 | |
| 1326 | def test_provider(kind: str) -> Dict[str, Any]: |
| 1327 | """Run an opt-in provider smoke test for the settings page.""" |
| 1328 | normalized = (kind or "").strip().lower() |
| 1329 | if normalized == "llm": |
| 1330 | from paperflow.providers import build_llm_provider |
| 1331 | |
| 1332 | provider = build_llm_provider() |
| 1333 | response = provider.generate( |
| 1334 | "Reply with exactly: pong", |
| 1335 | system="You are a provider health checker.", |
| 1336 | temperature=0.0, |
| 1337 | max_tokens=8, |
| 1338 | ) |
| 1339 | return { |
| 1340 | "kind": "llm", |
nothing calls this directly
no test coverage detected