mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-02 11:50:37 +08:00
Merge pull request #2 from Codium-ai/feature/support_openai_org
Add support for OpenAI organization in the secrets file
This commit is contained in:
@ -12,6 +12,8 @@ class AiHandler:
|
|||||||
def __init__(self):
|
def __init__(self):
|
||||||
try:
|
try:
|
||||||
openai.api_key = settings.openai.key
|
openai.api_key = settings.openai.key
|
||||||
|
if settings.get("OPENAI.ORG", None):
|
||||||
|
openai.organization = settings.openai.org
|
||||||
except AttributeError as e:
|
except AttributeError as e:
|
||||||
raise ValueError("OpenAI key is required") from e
|
raise ValueError("OpenAI key is required") from e
|
||||||
|
|
||||||
|
@ -7,7 +7,8 @@
|
|||||||
# See README for details about GitHub App deployment.
|
# See README for details about GitHub App deployment.
|
||||||
|
|
||||||
[openai]
|
[openai]
|
||||||
key = "<API_KEY>"
|
key = "<API_KEY>" # Acquire through https://platform.openai.com
|
||||||
|
org = "<ORGANIZATION>" # Optional, may be commented out.
|
||||||
|
|
||||||
[github]
|
[github]
|
||||||
# The type of deployment to create. Valid values are 'app' or 'user'.
|
# The type of deployment to create. Valid values are 'app' or 'user'.
|
||||||
|
Reference in New Issue
Block a user