feat: Print error message in red for unavailable models

This commit is contained in:
Stefan Hladnik (aider) 2025-03-18 03:54:27 +07:00 committed by Stefan Hladnik
parent 21cca34392
commit cdd730e627

View file

@ -248,7 +248,7 @@ class ModelInfoManager:
html = response.text
import re
if re.search(rf'The model\s*.*{re.escape(url_part)}.* is not available', html, re.IGNORECASE):
print(f"Error: Model '{url_part}' is not available")
print(f"\033[91mError: Model '{url_part}' is not available\033[0m")
sys.exit(1)
text = re.sub(r'<[^>]+>', ' ', html)
context_match = re.search(r"([\d,]+)\s*context", text)