diff options
author | t.me/xtekky <98614666+xtekky@users.noreply.github.com> | 2023-06-24 03:47:00 +0200 |
---|---|---|
committer | t.me/xtekky <98614666+xtekky@users.noreply.github.com> | 2023-06-24 03:47:00 +0200 |
commit | 5db58fd87f230fbe5bae599bb4b120ab42cad3be (patch) | |
tree | 770be13bca77c5d04dfe3265f378431df788706f /unfinished/gptbz | |
parent | Merge pull request #664 from LopeKinz/main (diff) | |
download | gpt4free-2.tar gpt4free-2.tar.gz gpt4free-2.tar.bz2 gpt4free-2.tar.lz gpt4free-2.tar.xz gpt4free-2.tar.zst gpt4free-2.zip |
Diffstat (limited to 'unfinished/gptbz')
-rw-r--r-- | unfinished/gptbz/README.md | 4 | ||||
-rw-r--r-- | unfinished/gptbz/__init__.py | 46 |
2 files changed, 0 insertions, 50 deletions
diff --git a/unfinished/gptbz/README.md b/unfinished/gptbz/README.md deleted file mode 100644 index 05bc2770..00000000 --- a/unfinished/gptbz/README.md +++ /dev/null @@ -1,4 +0,0 @@ -https://chat.gpt.bz - -to do: -- code refractoring
\ No newline at end of file diff --git a/unfinished/gptbz/__init__.py b/unfinished/gptbz/__init__.py deleted file mode 100644 index e95d5716..00000000 --- a/unfinished/gptbz/__init__.py +++ /dev/null @@ -1,46 +0,0 @@ -from json import dumps, loads - -import websockets - - -# Define the asynchronous function to test the WebSocket connection - - -async def test(): - # Establish a WebSocket connection with the specified URL - async with websockets.connect('wss://chatgpt.func.icu/conversation+ws') as wss: - - # Prepare the message payload as a JSON object - payload = { - 'content_type': 'text', - 'engine': 'chat-gpt', - 'parts': ['hello world'], - 'options': {} - } - - # Send the payload to the WebSocket server - await wss.send(dumps(obj=payload, separators=(',', ':'))) - - # Initialize a variable to track the end of the conversation - ended = None - - # Continuously receive and process messages until the conversation ends - while not ended: - try: - # Receive and parse the JSON response from the server - response = await wss.recv() - json_response = loads(response) - - # Print the entire JSON response - print(json_response) - - # Check for the end of the conversation - ended = json_response.get('eof') - - # If the conversation has not ended, print the received message - if not ended: - print(json_response['content']['parts'][0]) - - # Handle cases when the connection is closed by the server - except websockets.ConnectionClosed: - break |