当我部署google home skill时,出现的问题是-
您的操作可能会让麦克风在没有提示(如问候语)的情况下对用户命令保持打开状态,也可能会让麦克风出现隐式或显式问题
url = "https://hrm-api.herokuapp.com"
def lambda_handler(event, context):
print("this is event = "+str(event))
nm = json.loads(event['body'])
nmm = nm['queryResult']['parameters']['any']
#nmm = nmm[0]
print(nmm,"hiiiii")
payload = {
"query":nmm
}
headers = {'x-ucontext-token': '23223'}
r = requests.post(url,headers=headers,data=payload)
astt = str((r.json())['userMessage'])
astt = astt.replace("<br>","\n")
astt = astt.replace("</b>","")
astt = astt.replace("<b>","")
a = {
"payload": {
"google": {
"expectUserResponse": True,
"richResponse": {
"items": [
{
"simpleResponse": {
"textToSpeech": astt
}
}
]
}
目前没有回答
相关问题 更多 >
编程相关推荐