Migrates to the new OpenAI client library for improved compatibility
and to align with the latest API standards.
This change replaces the deprecated `openai.ChatCompletion.create` method
with `client.chat.completions.create`, ensuring the script remains
functional with future OpenAI API updates.