(docs) validate keys

This commit is contained in:
ishaan-jaff 2023-10-30 14:07:35 -07:00
parent c7752be7d3
commit 313eee17e3

View file

@ -124,7 +124,7 @@ response = completion("command-nightly", messages, api_version="2023-02-15")
Check if a user submitted a valid key for the model they're trying to call.
```
```python
key = "bad-key"
response = check_valid_key(model="gpt-3.5-turbo", api_key=key)
assert(response == False)
@ -134,7 +134,7 @@ assert(response == False)
This helper reads the .env and returns a list of supported llms for user
```
```python
old_environ = os.environ
os.environ = {'OPENAI_API_KEY': 'temp'} # mock set only openai key in environ