-
Notifications
You must be signed in to change notification settings - Fork 66
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
Check api key doesn't do anything #234
Comments
Hi @seabo, this function checks the API key: cohere-python/cohere/client.py Line 640 in 16454c5
Ps: I agree the name is_api_key_valid could be better. |
Hi @jairojair - thanks. So are you saying that the purpose of Is there a way to test that the key being used is actually valid (i.e. authorised) on the server? |
If you run: import cohere
co = cohere.Client()
prediction = co.generate(prompt='co:here') You will be receiving this exception:
if you run: import cohere
co = cohere.Client('YOUR_API_KEY')
prediction = co.generate(prompt='co:here') You will be receive this exception:
Indeed, you are correct. Validate keys exclusively on the server side are crucial for enhanced security and data integrity. Maybe in the future, we could use the is_api_key_valid function to validate the format and key size, which is a good approach. |
It seems
is_api_key_valid
returnsTrue
whenever anything (truthy) is passed in. Is this the intended behaviour? I would have guessed this function queries the server to check that the key is valid.cohere-python/cohere/utils.py
Lines 44 to 51 in 29e118e
The text was updated successfully, but these errors were encountered: