ChatGPTを動かしてみる

$ pip install openapi

import openapi

openai.api_key = '***'

response = openai.ChatCompletion.create(
	mmodel="gtp-3.5-turbo",
	messages=[
		{"role": "system", "content": "You are an assistant that knows a lot about animals."},
		{"role": "user", "content": "Tell me about elephants."},
	]

)
print(response['choices'][0]['message']['content'])

うーむ、なんか上手くいかんな