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HN0cm9rZS13aWR0aD0iMiIgb3BhY2l0eT0iMC41Ii8+PGxpbmUgeDE9IjY4IiB5MT0iNDAiIHgyPSI3NiIgeTI9IjY4IiBzdHJva2U9IndoaXRlIiBzdHJva2Utd2lkdGg9IjIiIG9wYWNpdHk9IjAuNSIvPjwvc3ZnPg== |
9 | 9 | required_open_webui_version: 0.4.0 |
10 | | -requirements: requests>=2.20, pydantic>=2.0 |
| 10 | +requirements: requests>=2.32.4, pydantic>=2.0 |
11 | 11 | description: The definitive OpenRouter integration for Open WebUI. Full catalog (chat/TTS/audio/image/embeddings), variant routing (:nitro/:exacto/:thinking/:online/:free/:extended), web search plugin with domain filters, server-side category filter, deprecation warnings, extended reasoning (minimal→xhigh + max_tokens + summary), Anthropic interleaved thinking + cache TTL, ZDR enforcement, tool/free-tier filters, provider preferences (only/quantizations/max_price/allow_fallbacks), service tier routing (auto/flex/priority/scale), generation-ID auditability, cached-input cost breakdown, model fallbacks, middle-out compression, citations, auto-discovered provider icons. |
12 | 12 | """ |
13 | 13 |
|
@@ -765,14 +765,17 @@ def pipes(self) -> List[dict]: |
765 | 765 | except requests.exceptions.Timeout: |
766 | 766 | return [{"id": "error", "name": "Timeout fetching models. Try again or increase REQUEST_TIMEOUT."}] |
767 | 767 | except requests.exceptions.HTTPError as exc: |
768 | | - msg = f"HTTP {exc.response.status_code} fetching models" |
769 | | - try: |
770 | | - err = exc.response.json().get("error", {}) |
771 | | - detail = err.get("message", str(err)) if isinstance(err, dict) else str(err) |
772 | | - if detail: |
773 | | - msg += f": {detail}" |
774 | | - except Exception: |
775 | | - pass |
| 768 | + if exc.response is not None: |
| 769 | + msg = f"HTTP {exc.response.status_code} fetching models" |
| 770 | + try: |
| 771 | + err = exc.response.json().get("error", {}) |
| 772 | + detail = err.get("message", str(err)) if isinstance(err, dict) else str(err) |
| 773 | + if detail: |
| 774 | + msg += f": {detail}" |
| 775 | + except Exception: |
| 776 | + pass |
| 777 | + else: |
| 778 | + msg = "HTTP error fetching models (no response)" |
776 | 779 | print(f"[OpenRouter Pipe] {msg}") |
777 | 780 | return [{"id": "error", "name": msg}] |
778 | 781 | except Exception as exc: |
@@ -1341,7 +1344,6 @@ def _expand_variant_models(self, models: List[dict], prefix: str) -> List[dict]: |
1341 | 1344 | if not specs: |
1342 | 1345 | return models |
1343 | 1346 |
|
1344 | | - prefix_str = prefix or "" |
1345 | 1347 | # Strip the user-set prefix so we can reuse base names verbatim. |
1346 | 1348 | by_id: dict = {} |
1347 | 1349 | for entry in models: |
|
0 commit comments