diff options
Diffstat (limited to 'g4f/Provider/Opchatgpts.py')
-rw-r--r-- | g4f/Provider/Opchatgpts.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/g4f/Provider/Opchatgpts.py b/g4f/Provider/Opchatgpts.py index c77acb22..8abdf39b 100644 --- a/g4f/Provider/Opchatgpts.py +++ b/g4f/Provider/Opchatgpts.py @@ -5,7 +5,7 @@ from aiohttp import ClientSession from ..typing import Messages, AsyncResult from .base_provider import AsyncGeneratorProvider - +from .helper import get_random_string class Opchatgpts(AsyncGeneratorProvider): url = "https://opchatgpts.net" @@ -36,7 +36,7 @@ class Opchatgpts(AsyncGeneratorProvider): ) as session: data = { "botId": "default", - "chatId": random_string(), + "chatId": get_random_string(), "contextId": 28, "customId": None, "messages": messages, @@ -68,7 +68,4 @@ class Opchatgpts(AsyncGeneratorProvider): ("proxy", "str"), ] param = ", ".join([": ".join(p) for p in params]) - return f"g4f.provider.{cls.__name__} supports: ({param})" - -def random_string(length: int = 10): - return ''.join(random.choice(string.ascii_lowercase + string.digits) for _ in range(length))
\ No newline at end of file + return f"g4f.provider.{cls.__name__} supports: ({param})"
\ No newline at end of file |