diff --git a/pr_agent/servers/github_action_runner.py b/pr_agent/servers/github_action_runner.py index 53b54a29a..1aafcaae2 100644 --- a/pr_agent/servers/github_action_runner.py +++ b/pr_agent/servers/github_action_runner.py @@ -46,15 +46,16 @@ async def run_action(): if not GITHUB_EVENT_PATH: print("GITHUB_EVENT_PATH not set") return - if not OPENAI_KEY: - print("OPENAI_KEY not set") - return if not GITHUB_TOKEN: print("GITHUB_TOKEN not set") return # Set the environment variables in the settings - get_settings().set("OPENAI.KEY", OPENAI_KEY) + if OPENAI_KEY: + get_settings().set("OPENAI.KEY", OPENAI_KEY) + else: + # Might not be set if the user is using models not from OpenAI + print("OPENAI_KEY not set") if OPENAI_ORG: get_settings().set("OPENAI.ORG", OPENAI_ORG) get_settings().set("GITHUB.USER_TOKEN", GITHUB_TOKEN)