vsakkas / sydney.py

Python Client for Copilot (formerly named Bing Chat), also known as Sydney.
MIT License
239 stars 31 forks source link

sydney.exceptions.ImageUploadException: Failed to upload image, received status: 400 #143

Open wdrink opened 5 months ago

wdrink commented 5 months ago

I failed to use the attachment with the above error, anyone has some ideas? Thanks

vsakkas commented 5 months ago

Hi @wangjk666

Thanks for opening this issue, I will take a look and follow up later

wdrink commented 5 months ago

Many thanks for your help, and looking forward to your reply.

vsakkas commented 5 months ago

Hi @wangjk666

I can't seem to be able to reproduce your issue. Can you provide some additional context?

wdrink commented 5 months ago
  1. I have tried several versions (0.20.1, 0.20.0, 0.17.4), all with the 400 error
  2. w/o cookies
  3. both answers are yes
  4. Occasionally, but I don't find the pattern (update)
wdrink commented 5 months ago

Here is the error:

line 159, in main
    response = await sydney.ask(this_prompt, attachment=f"xxx")
  File "xxx/sydney/sydney.py", line 516, in ask
    async for response, suggested_responses in self._ask(
  File "xxx/sydney/sydney.py", line 356, in _ask
    attachment_info = await self._upload_attachment(attachment)
  File "xxx/sydney.py", line 297, in _upload_attachment
    raise ImageUploadException(
sydney.exceptions.ImageUploadException: Failed to upload image, received status: 400
wdrink commented 5 months ago

Update:

Even if I use sydney without uploading an attachment, I will receive the following error:

sydney.exceptions.NoResponseException: No response was returned
Manamama commented 5 months ago

I have made some experiments, and in short 800 kB seems to be the limit in size. Random files, ls -l each:

762230 Rock and roll is devil music.png

852813 - Spiegelman's New Yorker cover cartoon of March 8, 1999 Police cartoon.png

But when saved to jpg and lower size: 384254 - Spiegelman's New Yorker cover cartoon of March 8, 1999 Police cartoon2.jpg

[1]: https://www.pinterest.com/pin/468867011190281773/ "" [2]: https://time.com/3847691/art-spiegelman-social-commentary-cartoons/ "" [3]: https://www.meremart.com/New-Yorker--March-8-1999 "" [4]: https://www.pinterest.de/zeldman/art-spiegelman/ "" [5]: https://singout.org/american-skin-41-shots/ ""

The image you sent is a cover of "The New Yorker" magazine dated March 8, 1999. It depicts a cartoon of a police officer aiming at a shooting gallery with targets on silhouetted figures and the backdrop of city buildings. The gallery is filled with stuffed animal prizes. The magazine cover is colorful and contains various elements. At the top, there's text indicating the price as $3.00 and the title "THE NEW YORKER". A large word "SHOOTING" is prominently displayed in red letters. A cartoon police officer in blue uniform is illustrated aiming his gun at silhouetted figures with targets on them. Behind the silhouetted figures are gray city buildings. Above the officer, there's a shooting gallery filled with stuffed animal prizes resembling dogs and cats. At the bottom right corner, “41 SHOTS” is written in red [^1^][1].

dickysuryos commented 3 weeks ago

resize your image