Update 20230302.2 ️ Create Your First Program Using OpenAI ChatGPT API [Beginner’s Guide].md

格式化代码块
This commit is contained in:
六开箱 2023-03-03 19:42:51 +08:00 committed by GitHub
parent 6b7a3c6259
commit 59eab04be9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,5 +1,5 @@
[#]: subject: "Create Your First Program Using OpenAI ChatGPT API [Beginners Guide]"
[#]: via: "https://www.debugpoint.com/openai-chatgpt-api-python/"
[#]: via: "https://www.debugpoint.com/openai-chatgpt-api-python"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
[#]: translator: " "
@ -139,9 +139,12 @@ The basic function of OpenAI chat API is below. The `openai.ChatCompletion.creat
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": "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?"}
] )
]
)
```
**Explanation**
@ -284,7 +287,7 @@ _[Reference][10]_
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/openai-chatgpt-api-python/
via: https://www.debugpoint.com/openai-chatgpt-api-python
作者:[Arindam][a]
选题:[lkxed][b]