mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-30 09:14:59 +00:00
Added validate_environment=False to tests
This commit is contained in:
parent
6863b47e6a
commit
9b26eeb9eb
7 changed files with 19 additions and 17 deletions
|
@ -132,7 +132,7 @@ class Model:
|
|||
max_chat_history_tokens = 1024
|
||||
weak_model = None
|
||||
|
||||
def __init__(self, model, weak_model=None, require_model_info=True):
|
||||
def __init__(self, model, weak_model=None, require_model_info=True, validate_environment=True):
|
||||
self.name = model
|
||||
|
||||
# Are all needed keys/params available?
|
||||
|
@ -141,11 +141,13 @@ class Model:
|
|||
keys_in_environment = res.get("keys_in_environment")
|
||||
|
||||
if missing_keys:
|
||||
res = f"To use model {model}, please set these environment variables:"
|
||||
for key in missing_keys:
|
||||
res += f"- {key}"
|
||||
raise ModelEnvironmentError(res)
|
||||
if validate_environment:
|
||||
res = f"To use model {model}, please set these environment variables:"
|
||||
for key in missing_keys:
|
||||
res += f"- {key}"
|
||||
raise ModelEnvironmentError(res)
|
||||
elif not keys_in_environment:
|
||||
# https://github.com/BerriAI/litellm/issues/3190
|
||||
print(f"Unable to check environment variables for model {model}")
|
||||
|
||||
# Do we have the model_info?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue