diff options
author | Tekky <98614666+xtekky@users.noreply.github.com> | 2023-11-18 12:24:39 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-18 12:24:39 +0100 |
commit | 2fcb3f949bbde7f5380acc68dc6b1f938dec12bc (patch) | |
tree | 035bd400b4057a744b29a0ebee96579bfbf429f6 /g4f/Provider/NoowAi.py | |
parent | ~ | g4f `v-0.1.8.5` (diff) | |
parent | Add AiChatOnline, ChatgptDemoAi, ChatgptNext Providers (diff) | |
download | gpt4free-2fcb3f949bbde7f5380acc68dc6b1f938dec12bc.tar gpt4free-2fcb3f949bbde7f5380acc68dc6b1f938dec12bc.tar.gz gpt4free-2fcb3f949bbde7f5380acc68dc6b1f938dec12bc.tar.bz2 gpt4free-2fcb3f949bbde7f5380acc68dc6b1f938dec12bc.tar.lz gpt4free-2fcb3f949bbde7f5380acc68dc6b1f938dec12bc.tar.xz gpt4free-2fcb3f949bbde7f5380acc68dc6b1f938dec12bc.tar.zst gpt4free-2fcb3f949bbde7f5380acc68dc6b1f938dec12bc.zip |
Diffstat (limited to 'g4f/Provider/NoowAi.py')
-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 |