🚀 feat: Add OPENAI_ORGANIZATION for all OpenAI Requests (#1590)

This commit is contained in:
Danny Avila 2024-01-18 20:39:30 -05:00 committed by GitHub
parent 7e2e19a134
commit a7c54573c4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 17 additions and 0 deletions

View file

@ -954,6 +954,10 @@ ${convo}
opts.defaultHeaders = { ...opts.defaultHeaders, 'api-key': this.apiKey };
}
if (process.env.OPENAI_ORGANIZATION) {
opts.organization = process.env.OPENAI_ORGANIZATION;
}
let chatCompletion;
const openai = new OpenAI({
apiKey: this.apiKey,