mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-01 10:14:59 +00:00
feat: Add error handling for unavailable model in response text
This commit is contained in:
parent
87ccacb99f
commit
d64427d726
1 changed files with 3 additions and 0 deletions
|
@ -246,6 +246,9 @@ class ModelInfoManager:
|
|||
if response.status_code != 200:
|
||||
return {}
|
||||
html = response.text
|
||||
if f'The model "{url_part}" is not available' in html:
|
||||
print(f"Error: Model '{url_part}' is not available")
|
||||
sys.exit(1)
|
||||
import re
|
||||
text = re.sub(r'<[^>]+>', ' ', html)
|
||||
context_match = re.search(r"([\d,]+)\s*context", text)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue