我发现 API /v1/chat/completions 的结果与网页上的结果差异很大。
这是 API 对问题“What is the birthday of George Washington”的响应:
curl --location 'https://api.openai.com/v1/chat/completions' \ --header 'Authorization: Bearer TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "model": "gpt-4", "messages": [ { "role": "user", "content": "What is the birthday of George Washington" } ] }'
"choices": [ { "message": { "role": "assistant", "content": "George Washington was born on February 22, 1732." }, "finish_reason": "stop", "index": 0 } ]
回答:
遗憾的是,ChatGPT-4 也不愿意透露更多信息。虽然可以通过 API 调整温度参数找到一个好的平衡点,但我也很想知道网页版的默认温度到底是多少。
通过网页向 ChatGPT-4 提问:使用网页版 ChatGPT 时的默认温度是多少?
ChatGPT-4 的回答:使用网页界面时,ChatGPT 的默认温度可能不会明确说明。然而,使用 OpenAI 的 API 时,默认温度通常设置为 0.7。这个值在创造性和连贯性之间提供了一个很好的平衡。你可以调整温度来控制生成文本的随机性:较低的温度(例如 0.2)使输出更加集中和确定性,而较高的温度(例如 1.0)使其更加随机和富有创造性。请记住,网页界面和 API 可能有不同的默认值或行为。