st1vms / unofficial-claude-api

Unofficial Claude API supporting direct HTTP chat creation/deletion/retrieval, messages with multiple file attachments and auto session gathering using Firefox with geckodriver.
MIT License
131 stars 12 forks source link

curl_cffi: NotImplementedError: Files has not been implemented. #9

Closed gadelkareem closed 10 months ago

gadelkareem commented 10 months ago

Hitting this issue https://github.com/yifeikong/curl_cffi/issues/105

Are file uploads not possible?

st1vms commented 10 months ago

@gadelkareem Could you be more specific? What's not working as expected? You mean the http_post call on line 266 that uses files parameter?

st1vms commented 10 months ago

Could you be more specific? What's not working as expected? You mean the http_post call on line 266 that uses files parameter?

As I remember there should be no problems in using that parameter with curl_cffi

gadelkareem commented 10 months ago

You mean the http_post call on line 266 that uses files parameter?

Yes, exactly. If I add an attachment file path then I get that not implemented exception. Not sure if it is just my config. curl-cffi==0.5.10

st1vms commented 10 months ago

Apologies then, it seems I didn't payed enough attention when using curl_cffi for building the 0.2.0 patch...

Anyways, I prepared a PR that should fix this, basically I'm switching to requests module for this very request (__prepare_file_attachment) which uses files parameter.

I was able to send a .pdf to Claude and receive a summary with no problems. I'll publish the v0.2.5 with the patch very soon!

st1vms commented 10 months ago

Fixed in v0.2.5. Closing this issue...