Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upload_attachment response:{"error": {"type": "permission_error", "message": "We are unable to serve your request"}} #87

Open
roaringmyshallowwater opened this issue Nov 21, 2023 · 2 comments

Comments

@roaringmyshallowwater
Copy link

    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.'}
@roaringmyshallowwater
Copy link
Author

I think this project may help.

@KiRyuWen
Copy link

Hi, I also face this problem. However, I digged into the file "claude_api.py" in line 97 and I change the model from "claude-2" to "claude-2.1" then it works! Hoping that solves your problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants