aboutsummaryrefslogtreecommitdiff
path: root/src/gpt_chat_cli/openai_wrappers.py
diff options
context:
space:
mode:
authorFurkan Sahin <furkan-dev@proton.me>2023-05-06 16:24:12 -0500
committerFurkan Sahin <furkan-dev@proton.me>2023-05-06 16:24:12 -0500
commit17d642863e612b8c44afa944c16c84ee48ca0c16 (patch)
treee66ee0250165f3071a360fd7b61742594b7eee45 /src/gpt_chat_cli/openai_wrappers.py
parent9065071621d499e5270e59ad8cac05ca0d66e10c (diff)
Add compat filter in list models
Diffstat (limited to 'src/gpt_chat_cli/openai_wrappers.py')
-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()