mirror of
https://github.com/xtekky/gpt4free.git
synced 2026-01-04 08:11:56 -08:00
Improve tools support in OpenaiTemplate and GeminiPro
Update models in DDG, PerplexityLabs, Gemini Fix issues with curl_cffi in new versions
This commit is contained in:
parent
c3ed6d0f8f
commit
e53483d85b
33 changed files with 300 additions and 172 deletions
|
|
@ -1,3 +1,4 @@
|
|||
import sys
|
||||
from .providers.types import ProviderType
|
||||
|
||||
logging: bool = False
|
||||
|
|
@ -8,6 +9,9 @@ version: str = None
|
|||
log_handler: callable = print
|
||||
logs: list = []
|
||||
|
||||
def log(text):
|
||||
def log(text, file = None):
|
||||
if logging:
|
||||
log_handler(text)
|
||||
log_handler(text, file=file)
|
||||
|
||||
def error(error, name: str = None):
|
||||
log(error if isinstance(error, str) else f"{type(error).__name__ if name is None else name}: {error}", file=sys.stderr)
|
||||
Loading…
Add table
Add a link
Reference in a new issue