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

Failed to run the example code 403 #148

Open
seriable opened this issue Jan 26, 2024 · 3 comments
Open

Failed to run the example code 403 #148

seriable opened this issue Jan 26, 2024 · 3 comments

Comments

@seriable
Copy link

When I running the example code
import asyncio

from sydney import SydneyClient

import os
os.environ["BING_COOKIES"] = "......."

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())

It happened a error
raise CreateConversationException(
sydney.exceptions.CreateConversationException: Failed to create conversation, received status: 403
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x000001D5B8C19930>
Unclosed connector

Could you help me to solve the problem

@Krasuszz
Copy link

I meet the same problem and I think the reason is the IP where you got cookies and where you run the client is not the same.
It might be easy to solve if author adds a proxy method for the client.

@Cyberes
Copy link

Cyberes commented Apr 10, 2024

@Krasuszz I'm not sure the IP difference is the problem. I was running it using a proxy that was a different IP than where I got my cookie.

@beingfanfan
Copy link

@Krasuszz I'm not sure the IP difference is the problem. I was running it using a proxy that was a different IP than where I got my cookie.

Could you please tell me how to run the code using a proxy? When I specify the proxy parameter, I get an HTTP 200 error. The only solution I currently know is to deploy the code on a server with a physical IP in the United States.

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

4 participants