ChatGPT API Python

parmarjatin4911@gmail.com - Jan 28 - - Dev Community

ChatGPT API Python

import openai
client = openai.OpenAI()

reponse = client.chat.completions.create(
model= "gpt-3.5-turbo",
messages=[
{"role": "user", "content": "Who won the cricket world cup in 2019?"}
]
)

print(reponse.choices[0].message.content)

Image description

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Terabox Video Player