mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-01-25 23:11:02 +08:00
Update 20230302.2 ⭐️⭐️ Create Your First Program Using OpenAI ChatGPT API [Beginner’s Guide].md
格式化代码块
This commit is contained in:
parent
6b7a3c6259
commit
59eab04be9
@ -1,5 +1,5 @@
|
||||
[#]: subject: "Create Your First Program Using OpenAI ChatGPT API [Beginner’s 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]
|
||||
|
Loading…
Reference in New Issue
Block a user