c# idchatcmpl-703KLgHRhNxOHQHPFdCr94UZfxMvDobjectchatcompletionchunkcreated1680247145modelgpt-35-turbo-0301choicesdeltacontent信息index0finish_reasonnull content节点获取
您可以使用以下代码从JSON字符串中获取content节点的值:
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
// assuming jsonString contains the JSON data
JObject obj = JObject.Parse(jsonString);
string content = obj["choices"][0]["delta"]["content"].ToString();
这将从JSON对象中获取第一个choice节点的delta节点的content值。请注意,此代码需要Newtonsoft.Json库进行解析。
原文地址: https://www.cveoy.top/t/topic/61P 著作权归作者所有。请勿转载和采集!