Getting output with my first AI code using template

Good morning Sir/Ma’am
I expected my code to give an output of getting answer with my first AI code using template but in my case it ask question but isn’t answering, giving me error. Please solve this issue. Here, below is my code
import openai
import os
import sys

question=input(“What is your question?”)
try:
openai.api_key = os.environ[‘OPENAI_API_KEY’]
except KeyError:
sys.stderr.write(“”"
You haven’t set up your API key yet.

If you don’t have an API key yet, visit:

https://platform.openai.com/signup

  1. Make an account or sign in
  2. Click “View API Keys” from the top right menu.
  3. Click “Create new secret key”

Then, open the Secrets Tool and add OPENAI_API_KEY as a secret.
“”")
exit(1)
response = openai.ChatCompletion.create(
model=“gpt-3.5-turbo”,
messages=[
{“role”: “system”, “content”: “You are a helpful assistant.”},
{“role”: “user”, “content”: question}
]
)
output=response[‘choices’][0][‘message’][‘content’]
print(output)

Hi @anupktr883

Could you please provide screenshots of the error logs in the console. This will help us give you a better solution.

Please do install all required module and you have to register to get a api access key

Hii @anupktr883
make sure that you have installed boltiotai library and ur api key is correct
and revisit through videos and see if u have missed anything in code
this may solve your issue