File size: 785 Bytes
481fc97
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
"""Ping configured model providers without printing secret values."""
from __future__ import annotations

from core.router import _PROVIDER_CLASSES


def main() -> int:
    failures = 0
    for name, provider_class in _PROVIDER_CLASSES.items():
        try:
            provider = provider_class()
            provider.chat(
                "Reply with JSON only.",
                [{"role": "user", "content": 'Reply exactly {"ok": true}'}],
                0.1,
                True,
            )
            print(f"{name}: OK")
        except Exception as exc:  # noqa: BLE001 - diagnostic command
            failures += 1
            print(f"{name}: FAILED ({type(exc).__name__}: {str(exc)[:240]})")
    return failures


if __name__ == "__main__":
    raise SystemExit(main())