You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- `%ai list` shows all providers by default, and ask the user to run %ai list <provider-name>.
477
+
- `%ai list <provider-name>` shows all models available from one provider. It should also note that the list is not comprehensive, and include a reference to the upstream LiteLLM docs.
478
+
- `%ai list all` should list all models.
472
479
"""
473
480
# Get list of available models from litellm
474
481
models=CHAT_MODELS
475
482
476
-
# Format output for both text and markdown
477
-
text_output="Available models:\n\n"
478
-
markdown_output="## Available models\n\n"
483
+
# If provider_id is None, only return provider IDs
484
+
ifgetattr(args, 'provider_id', None) isNone:
485
+
# Extract unique provider IDs from model IDs
486
+
provider_ids=set()
487
+
formodelinmodels:
488
+
if'/'inmodel:
489
+
provider_ids.add(model.split('/')[0])
490
+
491
+
# Format output for both text and markdown
492
+
text_output="Available providers\n\n (Run `%ai list <provider_name>` to see models for a specific provider)\n\n"
493
+
markdown_output="## Available providers\n\n (Run `%ai list <provider_name>` to see models for a specific provider)\n\n"
text_output="All available models\n\n (The list is not comprehensive, a list of models is available at https://docs.litellm.ai/docs/providers)\n\n"
504
+
markdown_output="## All available models \n\n (The list is not comprehensive, a list of models is available at https://docs.litellm.ai/docs/providers)\n\n"
text_output=f"Available models for provider '{provider_id}'\n\n (The list is not comprehensive, a list of models is available at https://docs.litellm.ai/docs/providers/{provider_id})\n\n"
532
+
markdown_output=f"## Available models for provider `{provider_id}`\n\n (The list is not comprehensive, a list of models is available at https://docs.litellm.ai/docs/providers/{provider_id})\n\n"
0 commit comments