js代码帮我把下面的json获取content内容idchatcmpl-6z7FllRDYPhpd06mikGDdIxz1IPCFobjectchatcompletioncreated1680023909modelgpt-35-turbo-0301usageprompt_tokens9completion_tokens9total_tokens18choicesmessageroleassista
var data = {"id":"chatcmpl-6z7FllRDYPhpd06mikGDdIxz1IPCF","object":"chat.completion","created":1680023909,"model":"gpt-3.5-turbo-0301","usage":{"prompt_tokens":9,"completion_tokens":9,"total_tokens":18},"choices":[{"message":{"role":"assistant","content":"Hello! How can I assist you today?"},"finish_reason":"stop","index":0}]};
var content = data.choices[0].message.content;
console.log(content); //输出:"Hello! How can I assist you today?"
原文地址: https://www.cveoy.top/t/topic/Kw4 著作权归作者所有。请勿转载和采集!