多轮对话
/chat/completions
API 进行多轮对话。/chat/completions
API 是一个“无状态” API,即服务端不记录用户请求的上下文,用户在每次请求时,需将之前所有对话历史拼接好后,传递给对话 API。
messages
为:[
{"role": "user", "content": "What's the highest mountain in the world?"}
]
1.
messages
末尾2.
messages
末尾messages
为:[
{"role": "user", "content": "What's the highest mountain in the world?"},
{"role": "assistant", "content": "The highest mountain in the world is Mount Everest."},
{"role": "user", "content": "What is the second?"}
]
修改于 2025-02-05 09:07:00