mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-30 01:04:59 +00:00
aider: Create the NoModelInfo
class to handle exceptions when model information cannot be retrieved.
# Aider chat conversation: USER: create the `NoModelInfo` class ASSISTANT: ```diff --- aider/models/model.py +++ aider/models/model.py @@ ... @@ from dataclasses import dataclass, fields import litellm +from typing import Optional from PIL import Image from aider.dump import dump +class NoModelInfo(Exception): + """ + Exception raised when model information cannot be retrieved. + """ + def __init__(self, message: Optional[str] = None): + super().__init__(message or "No model information available.") + @dataclass class ModelSettings: name: str ```
This commit is contained in:
parent
dd000c6147
commit
15c1ad1f96
1 changed files with 8 additions and 0 deletions
|
@ -3,10 +3,18 @@ import math
|
||||||
from dataclasses import dataclass, fields
|
from dataclasses import dataclass, fields
|
||||||
|
|
||||||
import litellm
|
import litellm
|
||||||
|
from typing import Optional
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
|
|
||||||
from aider.dump import dump
|
from aider.dump import dump
|
||||||
|
|
||||||
|
class NoModelInfo(Exception):
|
||||||
|
"""
|
||||||
|
Exception raised when model information cannot be retrieved.
|
||||||
|
"""
|
||||||
|
def __init__(self, message: Optional[str] = None):
|
||||||
|
super().__init__(message or "No model information available.")
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class ModelSettings:
|
class ModelSettings:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue