Skip to content

Commit 726b012

Browse files
committed
add openai tut section
1 parent d13d6af commit 726b012

File tree

4 files changed

+39
-2
lines changed

4 files changed

+39
-2
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ repos:
2222
- id: black
2323

2424
- repo: https://github.com/PyCQA/isort
25-
rev: 5.10.1
25+
rev: 5.12.0
2626
hooks:
2727
- id: isort
2828

README.md

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,44 @@ Now that you have your Nylas project set up, you need to set the Client ID, Clie
236236

237237
By setting the `NYLAS_CLIENT_ID`, `NYLAS_CLIENT_SECRET` and `NYLAS_SYSTEM_TOKEN` environment variables, your application will have the necessary credentials to authenticate and interact with the Nylas API for email and scheduling functionality. These credentials are essential for secure communication with Nylas services.
238238

239-
### 7. Run The Project Locally
239+
### 7. Create an OpenAI Account and Configure the API Key
240+
241+
To use OpenAI's services in your application, you need to create an OpenAI account and obtain an API key. Follow these steps to set up your OpenAI account and configure the API key:
242+
243+
#### 7.1 Create an OpenAI Account
244+
245+
1. **Register for an OpenAI Account:** Go to the official OpenAI website at [https://www.openai.com](https://www.openai.com).
246+
![Register for an OpenAI Account](static/openai-website.png)
247+
248+
1. **Sign Up:** Click on the "Log In" button to create a new OpenAI account. You may need to provide some basic information during the registration process.
249+
250+
#### 7.2 Generate Your OpenAI API Key
251+
252+
After registering for an OpenAI account, you'll need to generate an API key to access OpenAI's services:
253+
254+
1. **Access the API Keys Page:** Once you've logged in to your OpenAI account, go to the API Keys page at [https://platform.openai.com/account/api-keys](https://platform.openai.com/account/api-keys).
255+
256+
1. **Generate a Secret Key:** On the API Keys page, you can generate a new secret key. Click on the "Create new secret key" button to create a new API key.
257+
![OpenAI Account keys](static/generate-openai-token.png)
258+
259+
1. **Copy the Secret Key:** After generating the API key, OpenAI will provide you with a secret key. This is a confidential credential that should be kept secure.
260+
261+
#### 7.3 Set Your OpenAI API Key
262+
263+
Now that you have generated your OpenAI API key, you'll need to configure it in your project:
264+
265+
1. **Update Your Environment Variables:** Open your project's configuration file or `.env` file, where you store environment variables.
266+
267+
2. **Set the OpenAI API Key:** In your configuration file, add the following environment variable, replacing `<Your_OpenAI_API_Key>` with the actual secret key you obtained from the OpenAI platform:
268+
```yaml
269+
# OpenAI
270+
OPENAI_API_KEY=<Your_OpenAI_API_Key>
271+
```
272+
- Save the changes to your configuration file.
273+
274+
By setting the `OPENAI_API_KEY` environment variable, your application will have the necessary credentials to authenticate and interact with the OpenAI API. This API key allows your application to access OpenAI's language models and services securely.
275+
276+
### 8. Run The Project Locally
240277

241278
```sh
242279
make run

static/generate-openai-token.png

104 KB
Loading

static/openai-website.png

874 KB
Loading

0 commit comments

Comments
 (0)