我无法返回response.query_result
我想返回result["action"]
,result["query_text"]["fulfillment_text"]
我试过response.query_result.fulfillment_text
但是它显示出来了
"too many values to unpack"
response_id: "39a7bc01-2432-4de2-b134-6d7c5bbee6ea-f308a5c4"
query_result {
query_text: "you annoy me"
action: "smalltalk.agent.annoying"
parameters {
}
all_required_params_present: true
fulfillment_text: "I\'ll try not to annoy you."
fulfillment_messages {
text {
text: "I\'ll try not to annoy you."
}
}
intent {
name: "projects/my-project-1560026125515/agent/intents/c50c7c63-aa76-4781-ba7d-d9ba4c93df64"
display_name: "smalltalk.agent.annoying"
}
intent_detection_confidence: 1.0
language_code: "en"
}
您必须将响应转换为JSON格式。 对于此用途:
现在可以解析这个JSON响应了。 希望有帮助
相关问题 更多 >
编程相关推荐