diff options
Diffstat (limited to '')
-rw-r--r-- | g4f/Provider/NoowAi.py | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/g4f/Provider/NoowAi.py b/g4f/Provider/NoowAi.py index c337514a..dba87273 100644 --- a/g4f/Provider/NoowAi.py +++ b/g4f/Provider/NoowAi.py @@ -1,17 +1,17 @@ from __future__ import annotations -import random, string, json +import json from aiohttp import ClientSession from ..typing import AsyncResult, Messages from .base_provider import AsyncGeneratorProvider - +from .helper import get_random_string class NoowAi(AsyncGeneratorProvider): url = "https://noowai.com" supports_message_history = True supports_gpt_35_turbo = True - working = True + working = False @classmethod async def create_async_generator( @@ -43,7 +43,7 @@ class NoowAi(AsyncGeneratorProvider): "botId": "default", "customId": "d49bc3670c3d858458576d75c8ea0f5d", "session": "N/A", - "chatId": random_string(), + "chatId": get_random_string(), "contextId": 25, "messages": messages, "newMessage": messages[-1]["content"], @@ -63,7 +63,4 @@ class NoowAi(AsyncGeneratorProvider): elif line["type"] == "end": break elif line["type"] == "error": - raise RuntimeError(line["data"]) - -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 + raise RuntimeError(line["data"])
\ No newline at end of file |