gpt_engineer.applications.cli.main.load_env_if_needed

gpt_engineer.applications.cli.main.load_env_if_needed()[source]

Load environment variables if the OPENAI_API_KEY is not already set.

This function checks if the OPENAI_API_KEY environment variable is set, and if not, it attempts to load it from a .env file in the current working directory. It then sets the openai.api_key for use in the application.