AshwinPathi / claude-api-py

Unofficial Python API for Anthropic's Claude LLM
https://pypi.org/project/claude-api-py/
MIT License
108 stars 11 forks source link

HTTP Error 500: Internal Server Error when using file attachment #12

Closed Haris-Dilawar closed 11 months ago

Haris-Dilawar commented 11 months ago

code am using on google collab for testing

!pip install claude-api-py !pip install sseclient-py !pip install git+git://github.com/AshwinPathi/claude-api-py.git from claude import claude_wrapper from claude import claude_client client = claude_client.ClaudeClient("my_Session_key") organizations = client.get_organizations() claude_obj = claude_wrapper.ClaudeWrapper(client) attachment = claude_obj.get_attachment('train.txt') response = claude_obj.send_message("Hi Claude, what does this attachment say?", attachments=[attachment], conversation_uuid = conversation_uuid)

error am getting

image
AshwinPathi commented 11 months ago

What OS are you using? And what is the text encoding?

Haris-Dilawar commented 11 months ago

hey thanks for the reply. am using windows, and i have 2 files. the json file has utf-8 and a csv file with UTF-8-SIG encoding.

Haris-Dilawar commented 11 months ago

hey really sorry for disturbing you. your code works smoothly . its just some very uncleaned data in my csv file. i have tested it for other files and formats and it works great. as per my testing it works great for all file formats. thanks again!

What OS are you using? And what is the text encoding?