summaryrefslogtreecommitdiffstats
path: root/g4f/gui
diff options
context:
space:
mode:
authorH Lohaus <hlohaus@users.noreply.github.com>2024-01-14 16:37:21 +0100
committerGitHub <noreply@github.com>2024-01-14 16:37:21 +0100
commit42709f55b27f52048939907b34f42cfdc3537ec0 (patch)
treed7e5f2ad86beabd68fb08612b86b2a66242bf385 /g4f/gui
parentMerge pull request #1471 from xtekky/upp (diff)
downloadgpt4free-42709f55b27f52048939907b34f42cfdc3537ec0.tar
gpt4free-42709f55b27f52048939907b34f42cfdc3537ec0.tar.gz
gpt4free-42709f55b27f52048939907b34f42cfdc3537ec0.tar.bz2
gpt4free-42709f55b27f52048939907b34f42cfdc3537ec0.tar.lz
gpt4free-42709f55b27f52048939907b34f42cfdc3537ec0.tar.xz
gpt4free-42709f55b27f52048939907b34f42cfdc3537ec0.tar.zst
gpt4free-42709f55b27f52048939907b34f42cfdc3537ec0.zip
Diffstat (limited to 'g4f/gui')
-rw-r--r--g4f/gui/server/backend.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/g4f/gui/server/backend.py b/g4f/gui/server/backend.py
index 4a5cafa8..b4c8f56c 100644
--- a/g4f/gui/server/backend.py
+++ b/g4f/gui/server/backend.py
@@ -5,6 +5,7 @@ from typing import Generator
from g4f import debug, version, models
from g4f import _all_models, get_last_provider, ChatCompletion
from g4f.image import is_allowed_extension, to_image
+from g4f.errors import VersionNotFoundError
from g4f.Provider import __providers__
from g4f.Provider.bing.create_images import patch_provider
from .internet import get_search_message
@@ -91,8 +92,12 @@ class Backend_Api:
Returns:
dict: A dictionary containing the current and latest version.
"""
+ try:
+ current_version = version.utils.current_version
+ except VersionNotFoundError:
+ current_version = None
return {
- "version": version.utils.current_version,
+ "version": current_version,
"latest_version": version.get_latest_version(),
}