Skip to content
This repository was archived by the owner on Mar 6, 2024. It is now read-only.

feat(chatgpt): add apiOrg option for ChatGPTAPI #217

Merged
merged 2 commits into from
Apr 20, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ To ignore a PR, add the following keyword in the PR description:
- `OPENAI_API_KEY`: use this to authenticate with OpenAI API. You can get one
[here](https://platform.openai.com/account/api-keys). Please add this key to
your GitHub Action secrets.
- `OPENAI_API_ORG`: (optional) use this to use the specified organisation with OpenAI API if you have multiple. Please add this key to your GitHub Action secrets.

### Models: `gpt-4` and `gpt-3.5-turbo`

Expand Down
1 change: 1 addition & 0 deletions src/bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export class Bot {
this.api = new openai.ChatGPTAPI({
systemMessage: options.system_message,
apiKey: process.env.OPENAI_API_KEY,
apiOrg: process.env.OPENAI_API_ORG ?? null,
debug: options.debug,
maxModelTokens: openaiOptions.token_limits.max_tokens,
maxResponseTokens: openaiOptions.token_limits.response_tokens,
Expand Down