refactor: Improve model info output with detailed settings display

This commit is contained in:
Paul Gauthier 2024-11-24 15:20:24 -08:00 committed by Paul Gauthier (aider)
parent 4dcbce58ed
commit 3f8b2d6b99
2 changed files with 8 additions and 2 deletions

View file

@ -1059,7 +1059,7 @@ class Coder:
max_input_tokens = self.main_model.info.get("max_input_tokens") or 0 max_input_tokens = self.main_model.info.get("max_input_tokens") or 0
# Add the reminder prompt if we still have room to include it. # Add the reminder prompt if we still have room to include it.
if ( if (
max_input_tokens is None not max_input_tokens
or total_tokens < max_input_tokens or total_tokens < max_input_tokens
and self.gpt_prompts.system_reminder and self.gpt_prompts.system_reminder
): ):

View file

@ -646,9 +646,15 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F
) )
if args.verbose: if args.verbose:
io.tool_output("Model info:") io.tool_output("Model metadata:")
io.tool_output(json.dumps(main_model.info, indent=4)) io.tool_output(json.dumps(main_model.info, indent=4))
io.tool_output("Model settings:")
for attr in sorted(fields(ModelSettings), key=lambda x: x.name):
val = getattr(main_model, attr.name)
val = json.dumps(val, indent=4)
io.tool_output(f"{attr.name}: {val}")
lint_cmds = parse_lint_cmds(args.lint_cmd, io) lint_cmds = parse_lint_cmds(args.lint_cmd, io)
if lint_cmds is None: if lint_cmds is None:
return 1 return 1