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

howto add key #330

Merged
merged 8 commits into from
Aug 11, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 18 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,32 @@ Documentation is available on [ReadTheDocs](https://jupyter-ai.readthedocs.io/en
- Python 3.8 - 3.11
- JupyterLab 4

## Setting Up ChatGPT in a Notebook
## Setting Up Model Providers in a Notebook

To use ChatGPT in this notebook, you'll need to set your OpenAI API key.
To use any AI model provider within this notebook, you'll need the appropriate credentials, such as API keys.

Follow these steps:
Obtain the necessary credentials (e.g., API keys) from your model provider's platform.

1. Obtain your API key from the OpenAI platform.
2. In a new cell, set your key as follows:
In a new cell, set the credentials as follows:
bjornjorgensen marked this conversation as resolved.
Show resolved Hide resolved

```python
import os

# NOTE: Replace 'YOUR_API_KEY_HERE' with your actual API key.
# NOTE: Replace 'YOUR_CREDENTIAL_HERE' with your actual credential.
# And replace 'YOUR_ENVIRONMENT_VARIABLE' with the appropriate name.
os.environ["YOUR_ENVIRONMENT_VARIABLE"] = 'YOUR_CREDENTIAL_HERE'
```

If you're using ChatGPT from OpenAI, it would look like:
bjornjorgensen marked this conversation as resolved.
Show resolved Hide resolved
```python
import os

os.environ["OPENAI_API_KEY"] = 'YOUR_API_KEY_HERE'
```
Adjust the environment variable name and the placeholder for your specific model provider.
For more specific instructions for each model provider, refer to [the model providers documentation](https://jupyter-ai.readthedocs.io/en/latest/users/index.html#model-providers).



## Installation

Expand Down