summaryrefslogtreecommitdiffstats
path: root/gpt4free/theb/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'gpt4free/theb/__init__.py')
-rw-r--r--gpt4free/theb/__init__.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/gpt4free/theb/__init__.py b/gpt4free/theb/__init__.py
index 741de34d..e3a7f783 100644
--- a/gpt4free/theb/__init__.py
+++ b/gpt4free/theb/__init__.py
@@ -20,7 +20,7 @@ class Completion:
last_msg_id = None
@staticmethod
- def request(prompt: str, proxy: Optional[str]=None):
+ def request(prompt: str, proxy: Optional[str] = None):
headers = {
'authority': 'chatbot.theb.ai',
'content-type': 'application/json',
@@ -45,8 +45,10 @@ class Completion:
Completion.stream_completed = True
@staticmethod
- def create(prompt: str, proxy: Optional[str]=None) -> Generator[str, None, None]:
+
+ def create(prompt: str, proxy: Optional[str] = None) -> Generator[str, None, None]:
Completion.stream_completed = False
+
Thread(target=Completion.request, args=[prompt, proxy]).start()
while not Completion.stream_completed or not Completion.message_queue.empty():