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

I meet errors 'http.client.RemoteDisconnected: Remote end closed connection without response' when chat with attachments #6

Closed Hongbin98 closed 11 months ago

Hongbin98 commented 11 months ago

When I try to run response = claude_obj.send_message("How are you doing today!", conversation_uuid=conversation_uuid), it returns a normal response to me I'm doing well, thanks for asking! As an AI assistant without human emotions, XXX

However, when I try to run

attachment = claude_obj.get_attachment('test.txt')
response = claude_obj.send_message("Hi Claude, what does this attachment say?", attachments=[attachment],
                                    conversation_uuid = conversation_uuid)

I randomly got errors: http.client.RemoteDisconnected: Remote end closed connection without response and HTTP Error 500: Internal Server Error.

Anyone could offer me a hand?

AshwinPathi commented 11 months ago

@Hongbin98 did you fix this issue? 500 usually means malformed request

Hongbin98 commented 11 months ago

@Hongbin98 did you fix this issue? 500 usually means malformed request

@AshwinPathi Yes, I repeatedly upload the same file, resulting in this error. Now I have fixed this issue :)