Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pr_agent/algo/ai_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ class AiHandler:
def __init__(self):
try:
openai.api_key = settings.openai.key
if settings.get("OPENAI.ORG", None):
openai.organization = settings.openai.org
except AttributeError as e:
raise ValueError("OpenAI key is required") from e

Expand Down
3 changes: 2 additions & 1 deletion pr_agent/settings/.secrets_template.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
# See README for details about GitHub App deployment.

[openai]
key = "<API_KEY>"
key = "<API_KEY>" # Acquire through https://platform.openai.com
org = "<ORGANIZATION>" # Optional, may be commented out.

[github]
# The type of deployment to create. Valid values are 'app' or 'user'.
Expand Down