from openai import OpenAI from dotenv import load_dotenv import os load_dotenv() client = OpenAI(api_key = os.getenv("openai_api_key")) def generate_response(prompt): completion = client.chat.completions.create( model="gpt-4-turbo", messages=[ {"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": prompt} ] ) return completion.choices[0].message.content