#!/usr/bin/env python3 """ Type checking script for the Multi-Model Chat Backend """ import subprocess import sys import os def run_pyright() -> bool: """Run pyright type checking.""" print("🔍 Running pyright type checking...") try: result = subprocess.run( ["pyright", "."], capture_output=True, text=True, cwd=os.path.dirname(os.path.abspath(__file__)) ) print("STDOUT:") print(result.stdout) if result.stderr: print("STDERR:") print(result.stderr) if result.returncode == 0: print("✅ All type checks passed!") return True else: print("❌ Type checking failed!") return False except FileNotFoundError: print("❌ pyright not found. Make sure it's installed: pip install pyright") return False except Exception as e: print(f"❌ Error running pyright: {e}") return False def main() -> None: """Main function.""" success = run_pyright() sys.exit(0 if success else 1) if __name__ == "__main__": main()