mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-02 02:34:59 +00:00
fix: Improve model info caching and fallback logic
This commit is contained in:
parent
7ef1b21a3f
commit
b67914d74e
3 changed files with 24 additions and 100 deletions
|
@ -92,23 +92,6 @@ def is_image_file(file_name):
|
|||
return any(file_name.endswith(ext) for ext in IMAGE_EXTENSIONS)
|
||||
|
||||
|
||||
def safe_read_json(file_path):
|
||||
try:
|
||||
with open(file_path, "r") as f:
|
||||
return json.load(f)
|
||||
except Exception:
|
||||
return None
|
||||
|
||||
|
||||
def safe_write_json(file_path, data):
|
||||
try:
|
||||
with open(file_path, "w") as f:
|
||||
json.dump(data, f)
|
||||
return True
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
|
||||
def safe_abs_path(res):
|
||||
"Gives an abs path, which safely returns a full (not 8.3) windows path"
|
||||
res = Path(res).resolve()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue