Skip to content
This repository has been archived by the owner on Jan 31, 2025. It is now read-only.

Commit

Permalink
Adding support for openai_organization env variable (Significant-Grav…
Browse files Browse the repository at this point in the history
  • Loading branch information
kaneda2004 authored May 31, 2023
1 parent 9e9b128 commit 63b79a8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions .env.template
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
OPENAI_API_KEY=your-openai-api-key
# TEMPERATURE=0
# USE_AZURE=False
# OPENAI_ORGANIZATION=your-openai-organization-key-if-applicable

### AZURE
# moved to `azure.yaml.template`
Expand Down
4 changes: 4 additions & 0 deletions autogpt/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ def __init__(self) -> None:
)

self.openai_api_key = os.getenv("OPENAI_API_KEY")
self.openai_organization = os.getenv("OPENAI_ORGANIZATION")
self.temperature = float(os.getenv("TEMPERATURE", "0"))
self.use_azure = os.getenv("USE_AZURE") == "True"
self.execute_local_commands = (
Expand All @@ -79,6 +80,9 @@ def __init__(self) -> None:
openai.api_base = self.openai_api_base
openai.api_version = self.openai_api_version

if self.openai_organization is not None:
openai.organization = self.openai_organization

self.elevenlabs_api_key = os.getenv("ELEVENLABS_API_KEY")
self.elevenlabs_voice_1_id = os.getenv("ELEVENLABS_VOICE_1_ID")
self.elevenlabs_voice_2_id = os.getenv("ELEVENLABS_VOICE_2_ID")
Expand Down

0 comments on commit 63b79a8

Please sign in to comment.