Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VPS ERROR: <aiohttp.connector.TCPConnector object at 0x7f56e0757110> #156

Open
DavidAI2024 opened this issue Feb 20, 2024 · 2 comments
Open

Comments

@DavidAI2024
Copy link

I know that maybe it's not a Sydney-py error but I'm going crazy, I can't understand why if I start the Sydney-py example script locally it works, as soon as I start the VPS (Ovh Cloud) I get this errore. Traceback (most recent call last): File "/home/ubuntu/pp.py", line 24, in <module> asyncio.run(main()) File "/usr/lib/python3.11/asyncio/runners.py", line 190, in run return runner.run(main) ^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/asyncio/runners.py", line 118, in run return self._loop.run_until_complete(task) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete return future.result() ^^^^^^^^^^^^^^^ File "/home/ubuntu/pp.py", line 8, in main async with SydneyClient() as sydney: File "/home/ubuntu/.local/lib/python3.11/site-packages/sydney/sydney.py", line 94, in __aenter__ await self.start_conversation() File "/home/ubuntu/.local/lib/python3.11/site-packages/sydney/sydney.py", line 444, in start_conversation response_dict = await response.json() ^^^^^^^^^^^^^^^^^^^^^ File "/home/ubuntu/.local/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 1166, in json raise ContentTypeError( aiohttp.client_exceptions.ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: ', url=URL('https://copilot.microsoft.com/turing/conversation/create?bundleVersion=1.1573.2') Unclosed client session client_session: <aiohttp.client.ClientSession object at 0x7f56e0757090> Unclosed connector connections: ['[(<aiohttp.client_proto.ResponseHandler object at 0x7f56e0902a50>, 1195.864796355)]'] connector: <aiohttp.connector.TCPConnector object at 0x7f56e0757110>

@DavidAI2024
Copy link
Author

Thanks so much for your help if you can 💕 @vsakkas

@DavidAI2024
Copy link
Author

DavidAI2024 commented Feb 20, 2024

Maybe you need to open some ports in the VPS? if I try to ping google.it in the VPS everything works with the connection, before I think I had read that you had to close the session manually and I found a code that did this, as soon as I started the VPS I got another NoConnection Copilot error while the connection is there The piece of code I repeat works locally on the PC only on VPS from this error🥲 @vsakkas

Traceback (most recent call last): File "/home/ubuntu/pp.py", line 24, in <module> asyncio.run(main()) File "/usr/lib/python3.11/asyncio/runners.py", line 190, in run return runner.run(main) ^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/asyncio/runners.py", line 118, in run return self._loop.run_until_complete(task) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete return future.result() ^^^^^^^^^^^^^^^ File "/home/ubuntu/pp.py", line 8, in main async with SydneyClient() as sydney: File "/home/ubuntu/.local/lib/python3.11/site-packages/sydney/sydney.py", line 94, in __aenter__ await self.start_conversation() File "/home/ubuntu/.local/lib/python3.11/site-packages/sydney/sydney.py", line 444, in start_conversation response_dict = await response.json() ^^^^^^^^^^^^^^^^^^^^^ File "/home/ubuntu/.local/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 1166, in json raise ContentTypeError( aiohttp.client_exceptions.ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: ', url=URL('https://copilot.microsoft.com/turing/conversation/create?bundleVersion=1.1573.2') Unclosed client session client_session: <aiohttp.client.ClientSession object at 0x7f56e0757090> Unclosed connector connections: ['[(<aiohttp.client_proto.ResponseHandler object at 0x7f56e0902a50>, 1195.864796355)]'] connector: <aiohttp.connector.TCPConnector object at 0x7f56e0757110>

import asyncio

from sydney import SydneyClient


async def main() -> None:
    async with SydneyClient() as sydney:
        while True:
            prompt = input("You: ")

            if prompt == "!reset":
                await sydney.reset_conversation()
                continue
            elif prompt == "!exit":
                break

            print("Sydney: ", end="", flush=True)
            async for response in sydney.ask_stream(prompt):
                print(response, end="", flush=True)
            print("\n")


if __name__ == "__main__":
    asyncio.run(main())

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant