From 6ef282de3a3245acbfecd08ae48dba85ff91d031 Mon Sep 17 00:00:00 2001 From: H Lohaus Date: Tue, 12 Mar 2024 02:06:06 +0100 Subject: Remove all not working provider (#1679) Fix many providers Add selenium-wire to requierments --- g4f/providers/helper.py | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) (limited to 'g4f/providers') diff --git a/g4f/providers/helper.py b/g4f/providers/helper.py index c027216b..df6767a4 100644 --- a/g4f/providers/helper.py +++ b/g4f/providers/helper.py @@ -3,10 +3,8 @@ from __future__ import annotations import random import secrets import string -from aiohttp import BaseConnector -from ..typing import Messages, Optional -from ..errors import MissingRequirementsError +from ..typing import Messages def format_prompt(messages: Messages, add_special_tokens=False) -> str: """ @@ -49,16 +47,4 @@ def get_random_hex() -> str: Returns: str: A random hexadecimal string of 32 characters (16 bytes). """ - return secrets.token_hex(16).zfill(32) - -def get_connector(connector: BaseConnector = None, proxy: str = None, rdns: bool = False) -> Optional[BaseConnector]: - if proxy and not connector: - try: - from aiohttp_socks import ProxyConnector - if proxy.startswith("socks5h://"): - proxy = proxy.replace("socks5h://", "socks5://") - rdns = True - connector = ProxyConnector.from_url(proxy, rdns=rdns) - except ImportError: - raise MissingRequirementsError('Install "aiohttp_socks" package for proxy support') - return connector \ No newline at end of file + return secrets.token_hex(16).zfill(32) \ No newline at end of file -- cgit v1.2.3