Adding support for openai_organization env variable (#289)

This commit is contained in:
kaneda2004
2023-05-30 19:02:16 -07:00
committed by GitHub
parent 9e9b128b72
commit 63b79a88c6
2 changed files with 5 additions and 0 deletions

View File

@@ -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`

View File

@@ -64,6 +64,7 @@ class Config(metaclass=Singleton):
)
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 = (
@@ -79,6 +80,9 @@ class Config(metaclass=Singleton):
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")