mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-06 12:45:00 +00:00
fix: Allow arbitrary characters in model availability check regex
This commit is contained in:
parent
d64427d726
commit
21cca34392
1 changed files with 2 additions and 2 deletions
|
@ -246,10 +246,10 @@ class ModelInfoManager:
|
||||||
if response.status_code != 200:
|
if response.status_code != 200:
|
||||||
return {}
|
return {}
|
||||||
html = response.text
|
html = response.text
|
||||||
if f'The model "{url_part}" is not available' in html:
|
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"Error: Model '{url_part}' is not available")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
import re
|
|
||||||
text = re.sub(r'<[^>]+>', ' ', html)
|
text = re.sub(r'<[^>]+>', ' ', html)
|
||||||
context_match = re.search(r"([\d,]+)\s*context", text)
|
context_match = re.search(r"([\d,]+)\s*context", text)
|
||||||
if context_match:
|
if context_match:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue