Forums

Problem using Cohere

Hi,

I got this error below when I try to use cohere in my python code:

File "/home/boylubis/.local/lib/python3.7/site-packages/cohere/client.py", line 445, in summarize response = self._request(cohere.SUMMARIZE_URL, json=json_body) File "/home/boylubis/.local/lib/python3.7/site-packages/cohere/client.py", line 682, in _request raise_on_status=False, TypeError: init() got an unexpected keyword argument 'allowed_methods'

my code has no problem if I run it in repl.it

Pls help

Thanks

Boy HL

That looks like you may be trying to use a version of cohere that is incompatible with your code. Make sure that you are using the version of cohere that your code was written for.

I also got 403 error code. It is fine when I try locally but on pythonanywhere it doesn't work anymore. Any suggestions?

Free accounts on PythonAnywhere have restricted Internet access, so they can only make HTTP or HTTPS via a proxy, and are limited to accessing sites on our allowlist. If the site you are trying to connect to is not on the list, but it has an official public API, you can request an allowlist addition from this page.