summaryrefslogtreecommitdiffstats
path: root/g4f/__init__.py
diff options
context:
space:
mode:
authorfoxfire52 <foxfire52@virgilio.it>2024-11-15 07:38:51 +0100
committerGitHub <noreply@github.com>2024-11-15 07:38:51 +0100
commitf38428ab23a1ec1f6ee22b976189d7e9da9b9167 (patch)
treed1f0ab8b2f849a8162e2a1430910d0b41d300de5 /g4f/__init__.py
parentMerge pull request #2331 from NoelisTired/main (diff)
downloadgpt4free-f38428ab23a1ec1f6ee22b976189d7e9da9b9167.tar
gpt4free-f38428ab23a1ec1f6ee22b976189d7e9da9b9167.tar.gz
gpt4free-f38428ab23a1ec1f6ee22b976189d7e9da9b9167.tar.bz2
gpt4free-f38428ab23a1ec1f6ee22b976189d7e9da9b9167.tar.lz
gpt4free-f38428ab23a1ec1f6ee22b976189d7e9da9b9167.tar.xz
gpt4free-f38428ab23a1ec1f6ee22b976189d7e9da9b9167.tar.zst
gpt4free-f38428ab23a1ec1f6ee22b976189d7e9da9b9167.zip
Diffstat (limited to 'g4f/__init__.py')
-rw-r--r--g4f/__init__.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/g4f/__init__.py b/g4f/__init__.py
index d77fe760..f59a1446 100644
--- a/g4f/__init__.py
+++ b/g4f/__init__.py
@@ -1,6 +1,7 @@
from __future__ import annotations
import os
+import logging
from . import debug, version
from .models import Model
@@ -12,6 +13,14 @@ from .providers.types import ProviderType
from .providers.base_provider import AsyncGeneratorProvider
from .client.service import get_model_and_provider, get_last_provider
+#Configure "g4f" logger
+logger = logging.getLogger(__name__)
+log_handler = logging.StreamHandler()
+log_handler.setFormatter(logging.Formatter(logging.BASIC_FORMAT))
+logger.addHandler(log_handler)
+
+logger.setLevel(logging.ERROR)
+
class ChatCompletion:
@staticmethod
def create(model : Union[Model, str],