diff --git a/scripts/batch_o3_prompts.py b/scripts/batch_o3_prompts.py index 044ec19..df6ad8b 100644 --- a/scripts/batch_o3_prompts.py +++ b/scripts/batch_o3_prompts.py @@ -46,13 +46,19 @@ def write_output(path: Path, record: Dict[str, Any]) -> None: def call_o3(prompt: str) -> str: - response = client.completions.create( + """ + Send the prompt to the chat-completions endpoint (OpenAI ≥ 1.0.0). + + The prompt is wrapped in a single user message so the new API remains + compatible with the existing template-based workflow. + """ + response = client.chat.completions.create( model=MODEL, - prompt=prompt, + messages=[{"role": "user", "content": prompt}], max_tokens=1024, temperature=0.7, ) - return response.choices[0].text.strip() + return response.choices[0].message.content.strip() def main(argv: list[str] | None = None) -> None: