aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorflu0r1ne <flu0r1ne@flu0r1ne.net>2023-05-06 16:24:12 -0500
committerflu0r1ne <flu0r1ne@flu0r1ne.net>2023-05-06 16:44:21 -0500
commit53379e5c9b0b45f37cc45dfb14f76e3d9864bce7 (patch)
tree71b29826808d2e9a97bd5c91ba827de5d2208bfe /src
parent788f6de2e37c01920f9b5befe5825d4c9fb20be8 (diff)
downloadgpt-chat-cli-53379e5c9b0b45f37cc45dfb14f76e3d9864bce7.tar.xz
gpt-chat-cli-53379e5c9b0b45f37cc45dfb14f76e3d9864bce7.zip
Add compat filter in list models
Diffstat (limited to 'src')
-rw-r--r--src/gpt_chat_cli/openai_wrappers.py6
1 files changed, 5 insertions, 1 deletions
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()