summaryrefslogtreecommitdiffstats
path: root/g4f/requests
diff options
context:
space:
mode:
authorHeiner Lohaus <hlohaus@users.noreply.github.com>2024-02-22 00:16:58 +0100
committerHeiner Lohaus <hlohaus@users.noreply.github.com>2024-02-22 00:16:58 +0100
commite5b7f72b719814ffa2748e8e8ed1c6713a24e1a6 (patch)
tree70e9f87cb18f165428492d53a1c6e28c0828490a /g4f/requests
parentUpdate docs / readme, Improve Gemini auth (diff)
downloadgpt4free-e5b7f72b719814ffa2748e8e8ed1c6713a24e1a6.tar
gpt4free-e5b7f72b719814ffa2748e8e8ed1c6713a24e1a6.tar.gz
gpt4free-e5b7f72b719814ffa2748e8e8ed1c6713a24e1a6.tar.bz2
gpt4free-e5b7f72b719814ffa2748e8e8ed1c6713a24e1a6.tar.lz
gpt4free-e5b7f72b719814ffa2748e8e8ed1c6713a24e1a6.tar.xz
gpt4free-e5b7f72b719814ffa2748e8e8ed1c6713a24e1a6.tar.zst
gpt4free-e5b7f72b719814ffa2748e8e8ed1c6713a24e1a6.zip
Diffstat (limited to '')
-rw-r--r--g4f/requests/__init__.py (renamed from g4f/requests.py)8
-rw-r--r--g4f/requests/aiohttp.py (renamed from g4f/requests_aiohttp.py)2
-rw-r--r--g4f/requests/curl_cffi.py (renamed from g4f/requests_curl_cffi.py)2
-rw-r--r--g4f/requests/defaults.py (renamed from g4f/defaults.py)0
4 files changed, 6 insertions, 6 deletions
diff --git a/g4f/requests.py b/g4f/requests/__init__.py
index d7b5996b..d278ffaf 100644
--- a/g4f/requests.py
+++ b/g4f/requests/__init__.py
@@ -4,15 +4,15 @@ from urllib.parse import urlparse
try:
from curl_cffi.requests import Session
- from .requests_curl_cffi import StreamResponse, StreamSession
+ from .curl_cffi import StreamResponse, StreamSession
has_curl_cffi = True
except ImportError:
from typing import Type as Session
- from .requests_aiohttp import StreamResponse, StreamSession
+ from .aiohttp import StreamResponse, StreamSession
has_curl_cffi = False
-from .webdriver import WebDriver, WebDriverSession, bypass_cloudflare, get_driver_cookies
-from .errors import MissingRequirementsError
+from ..webdriver import WebDriver, WebDriverSession, bypass_cloudflare, get_driver_cookies
+from ..errors import MissingRequirementsError
from .defaults import DEFAULT_HEADERS
def get_args_from_browser(url: str, webdriver: WebDriver = None, proxy: str = None, timeout: int = 120) -> dict:
diff --git a/g4f/requests_aiohttp.py b/g4f/requests/aiohttp.py
index 0da8973b..d9bd6541 100644
--- a/g4f/requests_aiohttp.py
+++ b/g4f/requests/aiohttp.py
@@ -3,7 +3,7 @@ from __future__ import annotations
from aiohttp import ClientSession, ClientResponse, ClientTimeout
from typing import AsyncGenerator, Any
-from .Provider.helper import get_connector
+from ..providers.helper import get_connector
from .defaults import DEFAULT_HEADERS
class StreamResponse(ClientResponse):
diff --git a/g4f/requests_curl_cffi.py b/g4f/requests/curl_cffi.py
index 64e41d65..cfcdd63b 100644
--- a/g4f/requests_curl_cffi.py
+++ b/g4f/requests/curl_cffi.py
@@ -44,7 +44,7 @@ class StreamResponse:
inner: Response = await self.inner
self.inner = inner
self.request = inner.request
- self.status_code: int = inner.status_code
+ self.status: int = inner.status_code
self.reason: str = inner.reason
self.ok: bool = inner.ok
self.headers = inner.headers
diff --git a/g4f/defaults.py b/g4f/requests/defaults.py
index 6ae6d7eb..6ae6d7eb 100644
--- a/g4f/defaults.py
+++ b/g4f/requests/defaults.py