import openai
from dotenv import load_dotenv
import os
load_dotenv()
openai.api_key = os.getenv('OPENAI_API_KEY')
model_engine = "text-davinci-002"
prompt = "What is the meaning of life?"
# Call the OpenAI API
response = openai.Completion.create(
engine=model_engine,
prompt=prompt,
max_tokens=60,
n=1,
stop=None,
temperature=0.5,
)
# Print the API response
print(response.choices[0].text)