From f6cd64a7870dafa80cc81e52ad9a8f7fe6529154 Mon Sep 17 00:00:00 2001 From: flu0r1ne Date: Fri, 5 May 2023 02:35:50 -0500 Subject: Add command to list models --- src/gpt_chat_cli/gcli.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/gpt_chat_cli/gcli.py') diff --git a/src/gpt_chat_cli/gcli.py b/src/gpt_chat_cli/gcli.py index f0b754e..a9d36e4 100644 --- a/src/gpt_chat_cli/gcli.py +++ b/src/gpt_chat_cli/gcli.py @@ -10,6 +10,7 @@ from typing import Tuple from .openai_wrappers import ( create_chat_completion, + list_models, OpenAIChatResponse, OpenAIChatResponseStream, FinishReason, @@ -138,6 +139,13 @@ def main(): print(f'version {VERSION}') sys.exit(0) + if args.list_models: + + for model in list_models(): + print(model) + + sys.exit(0) + completion_args = args.completion_args COLOR_CODE = get_color_codes(no_color = not args.display_args.color) -- cgit v1.2.3