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 3 commits
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
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,33 @@ Documentation is available on [ReadTheDocs](https://jupyter-ai.readthedocs.io/en
- Python 3.8 - 3.11
- JupyterLab 4

## Setting Up Model Providers in a Notebook

To use any AI model provider within this notebook, you'll need the appropriate credentials, such as API keys.

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

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_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

Below is a simplified overview of the installation and usage process.
Expand Down