summaryrefslogtreecommitdiffstats
path: root/g4f/Provider/Aura.py
diff options
context:
space:
mode:
Diffstat (limited to 'g4f/Provider/Aura.py')
-rw-r--r--g4f/Provider/Aura.py21
1 files changed, 5 insertions, 16 deletions
diff --git a/g4f/Provider/Aura.py b/g4f/Provider/Aura.py
index d8f3471c..877b7fef 100644
--- a/g4f/Provider/Aura.py
+++ b/g4f/Provider/Aura.py
@@ -4,6 +4,8 @@ from aiohttp import ClientSession
from ..typing import AsyncResult, Messages
from .base_provider import AsyncGeneratorProvider
+from ..requests import get_args_from_browser
+from ..webdriver import WebDriver
class Aura(AsyncGeneratorProvider):
url = "https://openchat.team"
@@ -15,24 +17,11 @@ class Aura(AsyncGeneratorProvider):
model: str,
messages: Messages,
proxy: str = None,
+ webdriver: WebDriver = None,
**kwargs
) -> AsyncResult:
- headers = {
- "Accept": "*/*",
- "Accept-Encoding": "gzip, deflate, br",
- "Accept-Language": "en-GB,en-US;q=0.9,en;q=0.8",
- "Content-Type": "application/json",
- "Origin": f"{cls.url}",
- "Referer": f"{cls.url}/",
- "Sec-Ch-Ua": '"Not_A Brand";v="8", "Chromium";v="120", "Google Chrome";v="120"',
- "Sec-Ch-Ua-Mobile": "?0",
- "Sec-Ch-Ua-Platform": '"Linux"',
- "Sec-Fetch-Dest": "empty",
- "Sec-Fetch-Mode": "cors",
- "Sec-Fetch-Site": "same-origin",
- "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
- }
- async with ClientSession(headers=headers) as session:
+ args = get_args_from_browser(cls.url, webdriver, proxy)
+ async with ClientSession(**args) as session:
new_messages = []
system_message = []
for message in messages: