build: load OPENAI_API_KEY from .env using python-dotenv in batch_o3_prompts.py
Co-authored-by: aider (o3) <aider@aider.chat>
This commit is contained in:
@@ -1 +1,2 @@
|
||||
openai>=1.0.0
|
||||
python-dotenv>=1.0.0
|
||||
|
||||
@@ -19,6 +19,7 @@ import sys
|
||||
from pathlib import Path
|
||||
from typing import Any, Dict
|
||||
|
||||
from dotenv import load_dotenv
|
||||
import openai
|
||||
|
||||
MODEL = "o3"
|
||||
@@ -53,6 +54,7 @@ def call_o3(prompt: str) -> str:
|
||||
|
||||
def main(argv: list[str] | None = None) -> None:
|
||||
argv = argv or sys.argv[1:]
|
||||
load_dotenv() # read variables from .env if present
|
||||
if len(argv) != 3:
|
||||
print(main.__doc__)
|
||||
sys.exit(1)
|
||||
|
||||
Reference in New Issue
Block a user