diff --git a/grai-server/app/pyproject.toml b/grai-server/app/pyproject.toml index 4fcac5510..c2de2df22 100644 --- a/grai-server/app/pyproject.toml +++ b/grai-server/app/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "the_guide" -version = "0.1.59" +version = "0.1.60" description = "" authors = ["Grai "] license = "Elastic-2.0" diff --git a/grai-server/app/the_guide/__init__.py b/grai-server/app/the_guide/__init__.py index fd7634531..c999fcaa9 100755 --- a/grai-server/app/the_guide/__init__.py +++ b/grai-server/app/the_guide/__init__.py @@ -2,5 +2,5 @@ # Django starts so that shared_task will use this app. from .celery import app as celery_app -__version__ = "0.1.59" +__version__ = "0.1.60" __all__ = ("celery_app", "__version__") diff --git a/grai-server/app/the_guide/settings/base.py b/grai-server/app/the_guide/settings/base.py index 779c6c815..20e1665b3 100755 --- a/grai-server/app/the_guide/settings/base.py +++ b/grai-server/app/the_guide/settings/base.py @@ -384,6 +384,12 @@ def inner(value: str | bool) -> bool: except openai.AuthenticationError as e: warnings.warn("Could not authenticate with OpenAI API key and organization id.") HAS_OPENAI = False + except openai.APIConnectionError as e: + warnings.warn("Could not connect to OpenAI API and are disabling AI functionality.") + HAS_OPENAI = False + except Exception as e: + warnings.warn(f"We encountered an unknown error while trying to connect to OpenAI {e}") + HAS_OPENAI = False else: if len(models) == 0: message = f"Provided OpenAI API key does not have access to any models as a result we've disabled OpenAI."