我能够使用C#和以下语法以编程方式添加,删除qna对
new_kb =“ {'添加':{'qnaList':[{'id':101001,'answer':'” + answer +“','source':'Editorial' ,“问题”:['” +问题+“'],“元数据”:[]}],“网址”:[]},“删除”:{},“更新”:{}}”; >
new_kb =“ {\” add \“:null,\” 删除 \“:{\” ids \“:[” + id +“],\” sources \“:null },\“ update \”:null}“;
我在尝试以下Update语法时遇到了问题,但没有运气
new_kb = "{'update': { 'qnaList': [{'id': '" + id + "','answer': '" + ans + "','source': 'Editorial','questions': ['" + qs+ "'],'metadata': []}],'urls': []},'delete': {},'add': {}}";
new_kb = "{\"add\":null,\"update\":{\"ids\":[" + id + "],\"questions\":[" + qs + "],\"answer\":[" + ans+ "],\"sources\":null},\"delete\":null}";
答案 0 :(得分:0)
如果您只想更新您的qna对的问题/答案,请尝试以下操作:
new_kb = "{'update':{'qnaList':[{'id':"+ id +",'answer':'"+ answer + "','questions':{'add':['"+ qs_new + "'],'delete':['"+ qs_old + "']}}]}}";
如果您还有其他疑问,请随时告诉我:)