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

Commit 0374a85

Browse files
aschelchharjotgill
authored andcommitted
feat(chatgpt): add apiOrg option for ChatGPTAPI (#217)
I added apiOrg option for ChatGPTAPI in case you need it to specify which organisation to use when you have multiple one in your OpenAI account I added a `OPENAI_API_ORG` optionnal env variable. cc @harjotgill
1 parent 0091157 commit 0374a85

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ To ignore a PR, add the following keyword in the PR description:
102102
- `OPENAI_API_KEY`: use this to authenticate with OpenAI API. You can get one
103103
[here](https://platform.openai.com/account/api-keys). Please add this key to
104104
your GitHub Action secrets.
105+
- `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.
105106

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

src/bot.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export class Bot {
2525
this.api = new openai.ChatGPTAPI({
2626
systemMessage: options.system_message,
2727
apiKey: process.env.OPENAI_API_KEY,
28+
apiOrg: process.env.OPENAI_API_ORG ?? null,
2829
debug: options.debug,
2930
maxModelTokens: openaiOptions.token_limits.max_tokens,
3031
maxResponseTokens: openaiOptions.token_limits.response_tokens,

0 commit comments

Comments
 (0)