gpt4 book ai didi

slack - 检测 Google Home 或亚马逊 Alexa 的扬声器

转载 作者:行者123 更新时间:2023-12-01 13:39:50 25 4
gpt4 key购买 nike

我想检测谁在与我的代理交互。

例如,我读到 Alexa 应该能够检测到不同的用户。 Google Home 广告也让我认为它应该检测谁在说话。那么我如何才能看到谁在说话呢?

在 slack 中似乎更容易,因为众所周知谁在写。但是我看不到当前用户是谁。

最佳答案

我发现了如何在 slack 中检测用户:如果你实现那个钩子(Hook),你将得到这个示例 json:

{
"id": "f7912345-e21c-450f-a8ca-d01e38012345",
"timestamp": "2016-12-20T06:53:51.071Z",
"result": {
"source": "agent",
"resolvedQuery": "echo hallo welt",
"speech": "",
"action": "",
"actionIncomplete": false,
"parameters": {
"myInput": "hallo welt"
},
"contexts": [{
"name": "generic",
"parameters": {
"slack_user_id": "U0AT12345",
"myInput": "hallo welt",
"slack_channel": "D3DR12345",
"myInput.original": "hallo welt"
},
"lifespan": 4
}],
"metadata": {
"intentId": "06212345-06a0-40fe-bbeb-9189db412345",
"webhookUsed": "true",
"webhookForSlotFillingUsed": "false",
"intentName": "Response"
},
"fulfillment": {
"speech": "",
"messages": [{
"type": 0,
"speech": ""
}]
},
"score": 0.75
},
"status": {
"code": 200,
"errorType": "success"
},
"sessionId": "10612345-c681-11e6-af08-875120912345",
"originalRequest": {
"source": "slack_testbot",
"data": {
"channel": "D3DR12345",
"match": ["echo hallo welt"],
"text": "echo hallo welt",
"team": "T04H12345",
"type": "message",
"event": "direct_message",
"user": "U0AT12345",
"ts": "1482216830.000005"
}
}
}

因此,如果出现松弛,您可以访问 result->contexts[0]->paramaters->slack_user_id。

关于slack - 检测 Google Home 或亚马逊 Alexa 的扬声器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41230056/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com