Skip to content

Commit

Permalink
Support organization.
Browse files Browse the repository at this point in the history
  • Loading branch information
winlinvip committed Feb 2, 2024
1 parent 045a427 commit e44dcf1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ def openai_init(key, proxy):
else:
raise Exception("OPENAI_API_KEY is not set")

if os.environ.get("OPENAI_ORGANIZATION") is not None:
openai.organization = os.environ.get("OPENAI_ORGANIZATION")

if proxy is not None:
openai.api_base = "http://" + proxy + "/v1/"
elif os.environ.get("OPENAI_PROXY") is not None:
Expand Down

0 comments on commit e44dcf1

Please sign in to comment.