mirror of
https://github.com/xtekky/gpt4free.git
synced 2025-12-06 02:30:41 -08:00
Fix unittests (#1472)
* Fix unittests * Fix missing distutils, install setuptools * Fix version not found * Remove deprecation in get_event_loop
This commit is contained in:
parent
faa5f0f9bc
commit
42709f55b2
6 changed files with 16 additions and 14 deletions
|
|
@ -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(),
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue