From 53379e5c9b0b45f37cc45dfb14f76e3d9864bce7 Mon Sep 17 00:00:00 2001 From: flu0r1ne Date: Sat, 6 May 2023 16:24:12 -0500 Subject: Add compat filter in list models --- src/gpt_chat_cli/openai_wrappers.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gpt_chat_cli/openai_wrappers.py b/src/gpt_chat_cli/openai_wrappers.py index 6eeba4d..3e1ec06 100644 --- a/src/gpt_chat_cli/openai_wrappers.py +++ b/src/gpt_chat_cli/openai_wrappers.py @@ -103,6 +103,9 @@ def create_chat_completion(hist : ChatHistory, args: CompletionArguments) \ for update in response ) +def is_compatible_model(_id : str): + ''' FIXME: There seems no better way to do this currently ... ''' + return 'gpt' in _id def list_models() -> List[str]: @@ -111,7 +114,8 @@ def list_models() -> List[str]: models = [] for model in model_data["data"]: - models.append(model["id"]) + if is_compatible_model(model["id"]): + models.append(model["id"]) models.sort() -- cgit v1.2.3