mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-31 01:35:00 +00:00
feat: Add verbose flag to conditionally dump kwargs in Model.send
This commit is contained in:
parent
024b9130a0
commit
1b3cae1ed5
2 changed files with 5 additions and 1 deletions
|
@ -778,6 +778,7 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F
|
|||
weak_model=args.weak_model,
|
||||
editor_model=args.editor_model,
|
||||
editor_edit_format=args.editor_edit_format,
|
||||
verbose=args.verbose,
|
||||
)
|
||||
|
||||
# Check if deprecated remove_reasoning is set
|
||||
|
|
|
@ -230,11 +230,12 @@ model_info_manager = ModelInfoManager()
|
|||
|
||||
|
||||
class Model(ModelSettings):
|
||||
def __init__(self, model, weak_model=None, editor_model=None, editor_edit_format=None):
|
||||
def __init__(self, model, weak_model=None, editor_model=None, editor_edit_format=None, verbose=False):
|
||||
# Map any alias to its canonical name
|
||||
model = MODEL_ALIASES.get(model, model)
|
||||
|
||||
self.name = model
|
||||
self.verbose = verbose
|
||||
|
||||
self.max_chat_history_tokens = 1024
|
||||
self.weak_model = None
|
||||
|
@ -725,6 +726,8 @@ class Model(ModelSettings):
|
|||
hash_object = hashlib.sha1(key)
|
||||
if "timeout" not in kwargs:
|
||||
kwargs["timeout"] = request_timeout
|
||||
if self.verbose:
|
||||
dump(kwargs)
|
||||
res = litellm.completion(**kwargs)
|
||||
return hash_object, res
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue