python-archieve-projects/M3101/2/sum.py

14 lines
545 B
Python

import openai
openai.api_base = "https://api.open.passingai.com"
openai.api_key = "sk-L968sI6TYbd9XcwJ290aB121393148B39e86E1652f467f26"
# print(openai.Model.list())
openai.ChatCompletion.create(
model="gpt-3.5-turbo",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Who won the world series in 2020?"},
{"role": "assistant", "content": "The Los Angeles Dodgers won the World Series in 2020."},
{"role": "user", "content": "Where was it played?"}
]
)