Zero6992 / chatGPT-discord-bot

Integrate ChatGPT into your own discord bot
GNU General Public License v2.0
2.6k stars 699 forks source link

Now the bot is broken {I'm dumb with python atm} #351

Closed iamxorum closed 1 year ago

iamxorum commented 1 year ago

is telling me this. 17.04 15:45:33 [Bot] 2023-04-17 16:45:33 [INFO] discord.client logging in using static token 17.04 15:45:34 [Bot] 2023-04-17 16:45:34 [INFO] discord.gateway Shard ID None has connected to Gateway (Session ID: 6f29cd5d5982c4c8247f88873626f0c3). 17.04 15:45:36 [Bot] 2023-04-17 16:45:36 [INFO] src.aclient -> Send system prompt with size 11 17.04 15:45:36 [Bot] 2023-04-17 16:45:36 [ERROR] src.aclient -> Error while sending system prompt: [Errno -2] Name or service not known 17.04 15:45:36 [Bot] Traceback (most recent call last): 17.04 15:45:36 [Bot] File "/.local/lib/python3.10/site-packages/anyio/_core/_sockets.py", line 186, in connect_tcp 17.04 15:45:36 [Bot] addr_obj = ip_address(remote_host) 17.04 15:45:36 [Bot] File "/python/lib/python3.10/ipaddress.py", line 54, in ip_address 17.04 15:45:36 [Bot] raise ValueError('%r does not appear to be an IPv4 or IPv6 address' % 17.04 15:45:36 [Bot] ValueError: 'chat.gateway.do' does not appear to be an IPv4 or IPv6 address 17.04 15:45:36 [Bot] During handling of the above exception, another exception occurred: 17.04 15:45:36 [Bot] Traceback (most recent call last): 17.04 15:45:36 [Bot] File "/.local/lib/python3.10/site-packages/httpcore/_exceptions.py", line 10, in map_exceptions 17.04 15:45:36 [Bot] yield 17.04 15:45:36 [Bot] File "/.local/lib/python3.10/site-packages/httpcore/backends/asyncio.py", line 111, in connect_tcp 17.04 15:45:36 [Bot] stream: anyio.abc.ByteStream = await anyio.connect_tcp( 17.04 15:45:36 [Bot] File "/.local/lib/python3.10/site-packages/anyio/_core/_sockets.py", line 189, in connect_tcp 17.04 15:45:36 [Bot] gai_res = await getaddrinfo( 17.04 15:45:36 [Bot] File "/python/lib/python3.10/concurrent/futures/thread.py", line 52, in run 17.04 15:45:36 [Bot] result = self.fn(*self.args, self.kwargs) 17.04 15:45:36 [Bot] File "/python/lib/python3.10/socket.py", line 955, in getaddrinfo 17.04 15:45:36 [Bot] for res in _socket.getaddrinfo(host, port, family, type, proto, flags): 17.04 15:45:36 [Bot] socket.gaierror: [Errno -2] Name or service not known 17.04 15:45:36 [Bot] During handling of the above exception, another exception occurred: 17.04 15:45:36 [Bot] Traceback (most recent call last): 17.04 15:45:36 [Bot] File "/.local/lib/python3.10/site-packages/httpx/_transports/default.py", line 60, in map_httpcore_exceptions 17.04 15:45:36 [Bot] yield 17.04 15:45:36 [Bot] File "/.local/lib/python3.10/site-packages/httpx/_transports/default.py", line 353, in handle_async_request 17.04 15:45:36 [Bot] resp = await self._pool.handle_async_request(req) 17.04 15:45:36 [Bot] File "/.local/lib/python3.10/site-packages/httpcore/_async/connection_pool.py", line 253, in handle_async_request 17.04 15:45:36 [Bot] raise exc 17.04 15:45:36 [Bot] File "/.local/lib/python3.10/site-packages/httpcore/_async/connection_pool.py", line 237, in handle_async_request 17.04 15:45:36 [Bot] response = await connection.handle_async_request(request) 17.04 15:45:36 [Bot] File "/.local/lib/python3.10/site-packages/httpcore/_async/connection.py", line 86, in handle_async_request 17.04 15:45:36 [Bot] raise exc 17.04 15:45:36 [Bot] File "/.local/lib/python3.10/site-packages/httpcore/_async/connection.py", line 63, in handle_async_request 17.04 15:45:36 [Bot] stream = await self._connect(request) 17.04 15:45:36 [Bot] File "/.local/lib/python3.10/site-packages/httpcore/_async/connection.py", line 111, in _connect 17.04 15:45:36 [Bot] stream = await self._network_backend.connect_tcp(kwargs) 17.04 15:45:36 [Bot] File "/.local/lib/python3.10/site-packages/httpcore/backends/auto.py", line 29, in connect_tcp 17.04 15:45:36 [Bot] return await self._backend.connect_tcp( 17.04 15:45:36 [Bot] File "/.local/lib/python3.10/site-packages/httpcore/backends/asyncio.py", line 109, in connect_tcp 17.04 15:45:36 [Bot] with map_exceptions(exc_map): 17.04 15:45:36 [Bot] File "/python/lib/python3.10/contextlib.py", line 153, in exit 17.04 15:45:36 [Bot] self.gen.throw(typ, value, traceback) 17.04 15:45:36 [Bot] File "/.local/lib/python3.10/site-packages/httpcore/_exceptions.py", line 14, in map_exceptions 17.04 15:45:36 [Bot] raise to_exc(exc) 17.04 15:45:36 [Bot] httpcore.ConnectError: [Errno -2] Name or service not known 17.04 15:45:36 [Bot] The above exception was the direct cause of the following exception: 17.04 15:45:36 [Bot] Traceback (most recent call last): 17.04 15:45:36 [Bot] File "/src/aclient.py", line 146, in send_start_prompt 17.04 15:45:36 [Bot] response = f"{response}{await responses.unofficial_handle_response(prompt, self)}" 17.04 15:45:36 [Bot] File "/src/responses.py", line 8, in unofficial_handle_response 17.04 15:45:36 [Bot] async for response in client.chatbot.ask(message): 17.04 15:45:36 [Bot] File "/.local/lib/python3.10/site-packages/revChatGPT/V1.py", line 1012, in ask 17.04 15:45:36 [Bot] async for msg in self.post_messages( 17.04 15:45:36 [Bot] File "/.local/lib/python3.10/site-packages/revChatGPT/V1.py", line 965, in post_messages 17.04 15:45:36 [Bot] async for msg in self.send_request( 17.04 15:45:36 [Bot] File "/.local/lib/python3.10/site-packages/revChatGPT/V1.py", line 847, in __send_request 17.04 15:45:36 [Bot] async with self.session.stream( 17.04 15:45:36 [Bot] File "/python/lib/python3.10/contextlib.py", line 199, in aenter 17.04 15:45:36 [Bot] return await anext(self.gen) 17.04 15:45:36 [Bot] File "/.local/lib/python3.10/site-packages/httpx/_client.py", line 1573, in stream 17.04 15:45:36 [Bot] response = await self.send( 17.04 15:45:36 [Bot] File "/.local/lib/python3.10/site-packages/httpx/_client.py", line 1617, in send 17.04 15:45:36 [Bot] response = await self._send_handling_auth( 17.04 15:45:36 [Bot] File "/.local/lib/python3.10/site-packages/httpx/_client.py", line 1645, in _send_handling_auth 17.04 15:45:36 [Bot] response = await self._send_handling_redirects( 17.04 15:45:36 [Bot] File "/.local/lib/python3.10/site-packages/httpx/_client.py", line 1682, in _send_handling_redirects 17.04 15:45:36 [Bot] response = await self._send_single_request(request) 17.04 15:45:36 [Bot] File "/.local/lib/python3.10/site-packages/httpx/_client.py", line 1719, in _send_single_request 17.04 15:45:36 [Bot] response = await transport.handle_async_request(request) 17.04 15:45:36 [Bot] File "/.local/lib/python3.10/site-packages/httpx/_transports/default.py", line 352, in handle_async_request 17.04 15:45:36 [Bot] with map_httpcore_exceptions(): 17.04 15:45:36 [Bot] File "/python/lib/python3.10/contextlib.py", line 153, in exit__ 17.04 15:45:36 [Bot] self.gen.throw(typ, value, traceback) 17.04 15:45:37 [Bot] File "/.local/lib/python3.10/site-packages/httpx/_transports/default.py", line 77, in map_httpcore_exceptions 17.04 15:45:37 [Bot] raise mapped_exc(message) from exc 17.04 15:45:37 [Bot] httpx.ConnectError: [Errno -2] Name or service not known

thoughs?

joaquinv98 commented 1 year ago

any news? same issue here

KasperZzz commented 1 year ago

Work only gpt-3.5turbo official... gpt-4 not work unofficial gpt-4 official not work

joaquinv98 commented 1 year ago

I have made a pull request with a fix, pleasy try it

Abduallah76 commented 1 year ago

I don't know how to thank you joaquinv98 this fixed all my problems

joaquinv98 commented 1 year ago

NP. It was merged into main. Should be fine for everyone now

iamxorum commented 1 year ago

I have made a pull request with a fix, pleasy try it

Thank you buddy, it works! :D