Hello. I am new here. I am trying to learn how can i use openai api. But for this basic beginner code:
from openai import OpenAI
client = OpenAI(“sk-gMAw****************”)
chat_completion = client.chat.completions.create(
model=“gpt-3.5-turbo”,
messages=[{“role”: “user”, “content”: “Hello world”}])
I have got this error message:
client = OpenAI("■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■SGLtuCcD")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: OpenAI.init() takes 1 positional argument but 2 were given
Could you help me, pls?