Skip to content

Commit

Permalink
Added a note emphasizing that API keys should not be hard-coded.
Browse files Browse the repository at this point in the history
  • Loading branch information
btfranklin committed Jul 16, 2023
1 parent 4e6c028 commit 8ccbfce
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions README.md
Expand Up @@ -29,14 +29,13 @@ Import the `CleverBird` package:
import CleverBird
```

Initialize an `OpenAIAPIConnection` with your API key:
Initialize an `OpenAIAPIConnection` with your API key. Please note that API keys should always be loaded from environment variables, and not hard-coded into your source. After you have loaded your API key, pass it to the initializer of the connection:

```swift
let openAIAPIConnection = OpenAIAPIConnection(apiKey: "your_api_key_here")
let openAIAPIConnection = OpenAIAPIConnection(apiKey: <OPENAI_API_KEY>)
```

Create a `ChatThread` instance with the connection, and
add system, user, or assistant messages to the chat thread:
Create a `ChatThread` instance with the connection, and add system, user, or assistant messages to the chat thread:

```swift
let chatThread = ChatThread(connection: openAIAPIConnection)
Expand Down

0 comments on commit 8ccbfce

Please sign in to comment.