Claude-API
Claude-API copied to clipboard
upload_attachment response:{"error": {"type": "permission_error", "message": "We are unable to serve your request"}}
def upload_attachment(self, file_path):
# ....
response = req.post(url, headers=headers, proxies=self.proxies, files=files)
print(response.content)
if response.status_code == 200:
return response.json()
else:
return False
It seems that because 'curl_cffi' does not support uploading files, we have to use 'requests' to upload files. However, this seems to result in an error:
b'{"error": {"type": "permission_error", "message": "We are unable to serve your request"}}'
Chatbot: {'Error: Invalid file format. Please try again.'}