Skip to content

Commit

Permalink
feat: Update package version to 0.7.7
Browse files Browse the repository at this point in the history
fix: Improve error handling for unsupported models in NOVITA and AsyncNOVITA classes
  • Loading branch information
Simatwa committed Nov 5, 2024
1 parent c883316 commit 1232766
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@

setup(
name="python-tgpt",
version="0.7.6",
version="0.7.7",
license="MIT",
author="Smartwa",
maintainer="Smartwa",
Expand Down
12 changes: 6 additions & 6 deletions src/pytgpt/novita/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ class NOVITA(OPENAI):
"""Novita AI provider"""

def __init__(self, *args, **kwargs):
kwargs.setdefault("model", model)
if not model in available_models:
model_choice = kwargs.setdefault("model", model)
if not model_choice in available_models:
raise UnsupportedModelError(
f"Model '{model}' is not yet supported. Choose from {available_models}"
f"Model '{model_choice}' is not yet supported. Choose from {available_models}"
)
super().__init__(*args, **kwargs)
self.chat_endpoint = "https://api.novita.ai/v3/openai/chat/completions"
Expand All @@ -49,10 +49,10 @@ class AsyncNOVITA(AsyncOPENAI):
"""Async Novita AI provider"""

def __init__(self, *args, **kwargs):
kwargs.setdefault("model", model)
if not model in available_models:
model_choice = kwargs.setdefault("model", model)
if not model_choice in available_models:
raise UnsupportedModelError(
f"Model '{model}' is not yet supported choose from {available_models}"
f"Model '{model_choice}' is not yet supported. Choose from {available_models}"
)
super().__init__(*args, **kwargs)
self.chat_endpoint = "https://api.novita.ai/v3/openai/chat/completions"

0 comments on commit 1232766

Please sign in to comment.