diff options
author | Heiner Lohaus <hlohaus@users.noreply.github.com> | 2023-11-18 04:38:31 +0100 |
---|---|---|
committer | Heiner Lohaus <hlohaus@users.noreply.github.com> | 2023-11-18 04:38:31 +0100 |
commit | cadc507fad2fee59b23d1d8e73c472c077f468fc (patch) | |
tree | 42b1c0c0ccf5e3aa7a843a3766d4d19b6a7ade8e /g4f/Provider/NoowAi.py | |
parent | Improve providers (diff) | |
download | gpt4free-cadc507fad2fee59b23d1d8e73c472c077f468fc.tar gpt4free-cadc507fad2fee59b23d1d8e73c472c077f468fc.tar.gz gpt4free-cadc507fad2fee59b23d1d8e73c472c077f468fc.tar.bz2 gpt4free-cadc507fad2fee59b23d1d8e73c472c077f468fc.tar.lz gpt4free-cadc507fad2fee59b23d1d8e73c472c077f468fc.tar.xz gpt4free-cadc507fad2fee59b23d1d8e73c472c077f468fc.tar.zst gpt4free-cadc507fad2fee59b23d1d8e73c472c077f468fc.zip |
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 |