mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-29 16:54:59 +00:00
refactor: Simplify model selection warning and analytics event logging
This commit is contained in:
parent
8619bd4e84
commit
cde08da282
1 changed files with 3 additions and 5 deletions
|
@ -768,16 +768,14 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F
|
||||||
for env_key, model_name in model_key_pairs:
|
for env_key, model_name in model_key_pairs:
|
||||||
if os.environ.get(env_key):
|
if os.environ.get(env_key):
|
||||||
args.model = model_name
|
args.model = model_name
|
||||||
io.tool_warning(
|
io.tool_warning(f"Using {model_name} model with {env_key} environment variable.")
|
||||||
f"Found {env_key} so using {model_name} since no --model was specified."
|
|
||||||
)
|
|
||||||
# Track which API key was used for auto-selection
|
# Track which API key was used for auto-selection
|
||||||
analytics.event("auto_model_selection", api_key=env_key, main_model=model_name)
|
analytics.event("auto_model_selection", api_key=env_key)
|
||||||
break
|
break
|
||||||
if not args.model:
|
if not args.model:
|
||||||
io.tool_error("You need to specify a --model and an --api-key to use.")
|
io.tool_error("You need to specify a --model and an --api-key to use.")
|
||||||
io.offer_url(urls.models_and_keys, "Open documentation url for more info?")
|
io.offer_url(urls.models_and_keys, "Open documentation url for more info?")
|
||||||
analytics.event("auto_model_selection", api_key=None, main_model=None)
|
analytics.event("auto_model_selection", api_key=None)
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
main_model = models.Model(
|
main_model = models.Model(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue