当前位置: 首页 > 知识库问答 >
问题:

与alpha-beta测试人员和生产的上下文操作谷歌问题

郏志诚
2023-03-14

我有一个问题与谷歌行动和我的alpha-beta测试用户和生产版本。我正在使用Dialogflow V2,当我在测试模式下使用我的应用程序时,模拟器或我的手机与我的开发帐户相关联,一切正常,我没有任何问题。

但是我已经用alpha-beta测试用户测试了我的项目。我将Opt-in链接发送给我的用户,他们可以接受成为alpha-beta测试人员,并且可以使用调用示例启动代理。

欢迎意图启动是可以的,然后在使用上下文时出现问题,因为在请求体的日志中存在,但在实现中没有退出。

任何上下文都存在。我还更改了数组上下文,现在我只使用一个单词的参数。我也有同样的问题。

package.json

{
  "name": "dialogflowCFPUPVASISTENTE",
  "description": "This is the dialogflowCFPUPVASISTENTE for a Dialogflow agents using Cloud Functions for Firebase",
  "version": "0.0.1",
  "private": true,
  "license": "Apache Version 2.0",
  "author": "Google Inc.",
  "engines": {
    "node": "8"
  },
  "scripts": {
    "start": "firebase serve --only functions:dialogflowCFPUPVASISTENTE",
    "deploy": "firebase deploy --only functions:dialogflowCFPUPVASISTENTE"
  },
  "dependencies": {
    "actions-on-google": "^2.2.0",
    "firebase-admin": "^5.13.1",
    "firebase-functions": "^2.0.2",
    "dialogflow": "^0.6.0",
    "dialogflow-fulfillment": "^0.6.0",
    "axios": "^0.18.0",
    "i18next": "^15.0.5",
    "moment": "^2.24.0",
    "crypto-js": "^4.0.0",
    "google-auth-library": "^5.10.0"
  }
} 

index.js

 const numero = agent.parameters.numero;
conole.log(numero);
console.log('prueba6666666 cursos1 context');


//prueba
let contexto_busqueda = agent.context.get('busqueda1');
console.log(contexto_busqueda);  //HERE is UNDEFINED WHEN USE TESTER PHONE
let busqueda = contexto_busqueda.parameters.busqueda;

dialogflowFirebaseFulfillment(请求正文),上下文为“busqueda1”,简单参数为“busqueda”

{
textPayload: "Dialogflow Request body: {"responseId":"5c2cb699-3ca5-4062-9e12-7dc31f0b15b6-eec93b43","queryResult":{"queryText":"el curso 2","action":"MasInfoIntent","parameters":{"numero":2},"allRequiredParamsPresent":true,"outputContexts":[{"name":"projects/cfpupv-ojcaew/agent/environments/__aog-36/users/-/sessions/ABwppHFnTiCqjO9DEr-LPHi2SuK1Inxq2I69iMx-SPntmFZm-1zaZZrYanmh54bQ19yDPuTpvpYlmCUyBw/contexts/enviar_email1","lifespanCount":5,"parameters":{"idtoken":"xxxxx","palabra":"Java","palabra.original":"Java","numero":2,"numero.original":"2"}},{"name":"projects/cfpupv-ojcaew/agent/environments/__aog-36/users/-/sessions/ABwppHFnTiCqjO9DEr-LPHi2SuK1Inxq2I69iMx-SPntmFZm-1zaZZrYanmh54bQ19yDPuTpvpYlmCUyBw/contexts/info_curso1","lifespanCount":5,"parameters":{"numero":2,"numero.original":"2"}},{"name":"projects/cfpupv-ojcaew/agent/environments/__aog-36/users/-/sessions/ABwppHFnTiCqjO9DEr-LPHi2SuK1Inxq2I69iMx-SPntmFZm-1zaZZrYanmh54bQ19yDPuTpvpYlmCUyBw/contexts/actions_capability_web_browser","parameters":{"numero":2,"numero.original":"2"}},{"name":"projects/cfpupv-ojcaew/agent/environments/__aog-36/users/-/sessions/ABwppHFnTiCqjO9DEr-LPHi2SuK1Inxq2I69iMx-SPntmFZm-1zaZZrYanmh54bQ19yDPuTpvpYlmCUyBw/contexts/actions_capability_audio_output","parameters":{"numero":2,"numero.original":"2"}},{"name":"projects/cfpupv-ojcaew/agent/environments/__aog-36/users/-/sessions/ABwppHFnTiCqjO9DEr-LPHi2SuK1Inxq2I69iMx-SPntmFZm-1zaZZrYanmh54bQ19yDPuTpvpYlmCUyBw/contexts/actions_capability_account_linking","parameters":{"numero":2,"numero.original":"2"}},{"name":"projects/cfpupv-ojcaew/agent/environments/__aog-36/users/-/sessions/ABwppHFnTiCqjO9DEr-LPHi2SuK1Inxq2I69iMx-SPntmFZm-1zaZZrYanmh54bQ19yDPuTpvpYlmCUyBw/contexts/actions_capability_media_response_audio","parameters":{"numero":2,"numero.original":"2"}},{"name":"projects/cfpupv-ojcaew/agent/environments/__aog-36/users/-/sessions/ABwppHFnTiCqjO9DEr-LPHi2SuK1Inxq2I69iMx-SPntmFZm-1zaZZrYanmh54bQ19yDPuTpvpYlmCUyBw/contexts/actions_capability_screen_output","parameters":{"numero":2,"numero.original":"2"}},{"name":"projects/cfpupv-ojcaew/agent/environments/__aog-36/users/-/sessions/ABwppHFnTiCqjO9DEr-LPHi2SuK1Inxq2I69iMx-SPntmFZm-1zaZZrYanmh54bQ19yDPuTpvpYlmCUyBw/contexts/google_assistant_input_type_voice","parameters":{"numero":2,"numero.original":"2"}},{"name":"projects/cfpupv-ojcaew/agent/environments/__aog-36/users/-/sessions/ABwppHFnTiCqjO9DEr-LPHi2SuK1Inxq2I69iMx-SPntmFZm-1zaZZrYanmh54bQ19yDPuTpvpYlmCUyBw/contexts/busqueda1","lifespanCount":4,"parameters":{"palabra":"Java","palabra.original":"Java","busqueda":"Java","numero":2,"numero.original":"2"}},{"name":"projects/cfpupv-ojcaew/agent/environments/__aog-36/users/-/sessions/ABwppHFnTiCqjO9DEr-LPHi2SuK1Inxq2I69iMx-SPntmFZm-1zaZZrYanmh54bQ19yDPuTpvpYlmCUyBw/contexts/__system_counters__","parameters":{"no-input":0,"no-match":0,"numero":2,"numero.original":"2"}}],"intent":{"name":"projects/cfpupv-ojcaew/agent/intents/b74cc78e-8c1c-420e-ba0d-3b6da6e18dd9","displayName":"MasInfoIntent"},"intentDetectionConfidence":1,"languageCode":"es"},"originalDetectIntentRequest":{"source":"google","version":"2","payload":{"user":{"locale":"es-ES","lastSeen":"2020-04-24T11:37:19Z","idToken":"xxxxx"
insertId: "000001-5cbd2792-582d-45b5-a99c-62c51c1daae8"
resource: {
type: "cloud_function"
labels: {3}
}
timestamp: "2020-04-24T11:37:39.685Z"
severity: "INFO"
labels: {
execution_id: "o8obosdy5d5z"
}
logName: "projects/cfpupv-ojcaew/logs/cloudfunctions.googleapis.com%2Fcloud-functions"
trace: "projects/cfpupv-ojcaew/traces/b0fb3fa3c628d8cbaef2b73c09b64775"
receiveTimestamp: "2020-04-24T11:37:40.571089537Z"
}

具有上下文“busqueda1”简单参数“busqueda”的dialogflowFirebaseFulfillment(请求正文)正在工作

{
textPayload: "Dialogflow Request body: {"responseId":"a3703a6d-9fca-4e4d-91f3-ecb58212a0f3-eec93b43","queryResult":{"queryText":"el curso 3","action":"MasInfoIntent","parameters":{"numero":3},"allRequiredParamsPresent":true,"outputContexts":[{"name":"projects/cfpupv-ojcaew/agent/sessions/ABwppHEYyiNzdo2qmZnOOb7FKufwyuTJ6tetAC7KkGYLp7PBEleCLaO6QIrC91Ql1a9DgWormHN_HNVb8Q/contexts/enviar_email1","lifespanCount":5,"parameters":{"idtoken":"xxxxx","palabra":"java","palabra.original":"java","numero":3,"numero.original":"3"}},{"name":"projects/cfpupv-ojcaew/agent/sessions/ABwppHEYyiNzdo2qmZnOOb7FKufwyuTJ6tetAC7KkGYLp7PBEleCLaO6QIrC91Ql1a9DgWormHN_HNVb8Q/contexts/info_curso1","lifespanCount":5,"parameters":{"numero":3,"numero.original":"3"}},{"name":"projects/cfpupv-ojcaew/agent/sessions/ABwppHEYyiNzdo2qmZnOOb7FKufwyuTJ6tetAC7KkGYLp7PBEleCLaO6QIrC91Ql1a9DgWormHN_HNVb8Q/contexts/actions_capability_screen_output","parameters":{"numero":3,"numero.original":"3"}},{"name":"projects/cfpupv-ojcaew/agent/sessions/ABwppHEYyiNzdo2qmZnOOb7FKufwyuTJ6tetAC7KkGYLp7PBEleCLaO6QIrC91Ql1a9DgWormHN_HNVb8Q/contexts/actions_capability_account_linking","parameters":{"numero":3,"numero.original":"3"}},{"name":"projects/cfpupv-ojcaew/agent/sessions/ABwppHEYyiNzdo2qmZnOOb7FKufwyuTJ6tetAC7KkGYLp7PBEleCLaO6QIrC91Ql1a9DgWormHN_HNVb8Q/contexts/actions_capability_media_response_audio","parameters":{"numero":3,"numero.original":"3"}},{"name":"projects/cfpupv-ojcaew/agent/sessions/ABwppHEYyiNzdo2qmZnOOb7FKufwyuTJ6tetAC7KkGYLp7PBEleCLaO6QIrC91Ql1a9DgWormHN_HNVb8Q/contexts/actions_capability_audio_output","parameters":{"numero":3,"numero.original":"3"}},{"name":"projects/cfpupv-ojcaew/agent/sessions/ABwppHEYyiNzdo2qmZnOOb7FKufwyuTJ6tetAC7KkGYLp7PBEleCLaO6QIrC91Ql1a9DgWormHN_HNVb8Q/contexts/google_assistant_input_type_voice","parameters":{"numero":3,"numero.original":"3"}},{"name":"projects/cfpupv-ojcaew/agent/sessions/ABwppHEYyiNzdo2qmZnOOb7FKufwyuTJ6tetAC7KkGYLp7PBEleCLaO6QIrC91Ql1a9DgWormHN_HNVb8Q/contexts/busqueda1","lifespanCount":4,"parameters":{"palabra":"java","palabra.original":"java","busqueda":"java","numero":3,"numero.original":"3"}},{"name":"projects/cfpupv-ojcaew/agent/sessions/ABwppHEYyiNzdo2qmZnOOb7FKufwyuTJ6tetAC7KkGYLp7PBEleCLaO6QIrC91Ql1a9DgWormHN_HNVb8Q/contexts/__system_counters__","parameters":{"no-input":0,"no-match":0,"numero":3,"numero.original":"3"}}],"intent":{"name":"projects/cfpupv-ojcaew/agent/intents/b74cc78e-8c1c-420e-ba0d-3b6da6e18dd9","displayName":"MasInfoIntent"},"intentDetectionConfidence":1,"languageCode":"es"},"originalDetectIntentRequest":{"source":"google","version":"2","payload":{"user":{"locale":"es-ES","lastSeen":"2020-04-24T12:07:58Z","idToken":"xxxxx","userVerificationStatus":"VERIFIED"},"conversation":{"conversationId":"ABwppHEYyiNzdo2"
insertId: "000001-3770d84b-b3e1-4610-a4e1-91f9c27573a5"
resource: {
type: "cloud_function"
labels: {3}
}
timestamp: "2020-04-24T12:08:09.311Z"
severity: "INFO"
labels: {
execution_id: "0hxf6o3oumx8"
}
logName: "projects/cfpupv-ojcaew/logs/cloudfunctions.googleapis.com%2Fcloud-functions"
trace: "projects/cfpupv-ojcaew/traces/ee0e462e5b7fcab9b45d7ef9acdcebe8"
receiveTimestamp: "2020-04-24T12:08:10.552786312Z"
}

"TypeError:无法读取在masInfo(/srv/index.js:122: 29)未定义的属性'参数'在WebookClient.handle请求(/srv/node_modules/DidiogFlow-履行/src/dialogflow-fulfillment.js:313: 44)在exports.dialogflowFirebasFulfillment.functions.https.on请求(/srv/index.js:173: 9)在云函数(/srv/node_modules/Firebase函数/lib/提供者/https.js:57: 9)在 /worker/worker.js:783: 7在 /worker/worker.js:766: 11在_combinedTickCallback(内部/进程/next_tick.js:132: 7)在进程。_tickDomainCallback(内部/进程/next_tick.js:219: 9)”

我认为这是谷歌云平台的权限问题。任何想法?

权限云

我是否需要alpha tester和production的其他权限才能使用上下文?

https://cloud.google.com/dialogflow/docs/fulfillment-inline-editor

https://cloud.google.com/dialogflow/docs/fulfillment-webhook

如果我使用其他alpha测试项目不工作,因为虽然对话流上下文存在于程序中的谷歌云平台的请求体是未定义的。我必须做一些在行动谷歌使用程序在公司内测或生产?

你能帮助我吗?

共有3个答案

凤修为
2023-03-14

行动答案Google Assitant Support:

感谢您提供所要求的信息,并添加我作为阿尔法测试员的帐户。基于这些,我们可以理解为“参数”属性导致了操作崩溃。在检查提供的代码片段时,我们注意到您使用了“代理”而不是“conv”。你可以做的是将“代理”更新为“conv”。这样做的原因是代理更多的是为了对话流的其他集成。这也是与对话流团队协调的,他们也提出了同样的建议。请参考下面的代码片段,了解如何直接获取参数的值或在webook的上下文中获取参数的值。

// Handle the Dialogflow intent named 'Curso Intent' without context.
// The intent collects a parameter named 'numero'.
app.intent('Curso Intent', (conv, {numero}) => {
    const numero = numero;
});


// Handle the Dialogflow intent named 'Curso Intent' with context "curso_out".
// The intent collects a parameter named 'numero'.
app.intent('Curso Intent', (conv, {conv}) => {
    const cCursoOut = conv.contexts.get('curso_out');
    const pCursoOut = cCursoOut.parameters;
    const numero = pCursoOut.numero;
});

使用conv项目完美的工作!

非常感谢你

东郭腾
2023-03-14

看起来参数“listado”有一个JavaScript数组作为值。Context参数的留档表明,在某些有限的情况下,映射中的值应该是复合类型(即另一个映射),但通常应该是字符串。

因此,当您认为您正在设置一个数组时——当它被读回时,由于它不是一个字符串,它可能被清空,或者整个上下文被认为是无效的。

伏欣悦
2023-03-14

您可能达到了上下文的最大大小,因为您在上下文中存储了大量信息。我还没有找到上下文的文档限制,但我认为值得尝试用较小的参数计数来重现这个问题,看看它是否成功。

 类似资料:
  • 我的应用程序还没有发布。通过Google Play测试应用程序的Alpha/Beta测试者的最大数量是多少?对于iOS来说,每个构建需要1000个外部测试人员。Google Play的限制是多少?

  • 我已经在谷歌应用商店配置了alpha/beta测试。为此目的创建了新的Google组,并邀请了所需用户加入该组。 当新更新可用时,用户必须通过alpha/beta链接下载并安装更新。是否有任何选项将更新推送到alpha/beta测试人员(如prod Play Store works)?

  • Android开发者控制台有3个选项卡用于发布应用程序的apk文件:alpha、beta和production,如下所示: 正如我在一次谷歌IO讲座中回忆的那样,在进行100%规模的发布之前,检查你的应用程序有多好的一个很酷的方法是只允许一部分用户先下载应用程序。我认为这被称为“分阶段展开”,因为如果发布有太多问题而无法发布给所有人,您可以展开发布。 > 它们之间,尤其是α和β之间到底有什么区别?

  • 本文向大家介绍Alpha和Beta测试之间的区别,包括了Alpha和Beta测试之间的区别的使用技巧和注意事项,需要的朋友参考一下 Alpha和Beta测试是用于测试软件的两种类型的测试,它们基于在真实环境中使用真实产品的真实客户的反馈,但是它们是由不同的目标和过程驱动的。 序号 键 阿尔法测试 Beta测试 1 目的 Alpha测试基本上侧重于发现错误,并确定产品是否按预期工作。 Beta测试可

  • 我试图在Google Play控制台中使用Alpha和Beta测试机制,我的问题是:Alpha和PROD中的APK版本代码是否相关?也就是说,如果我将版本代码为9的APK上传到Alpha,我是否必须在版本代码为10的PROD中继续?或者我可以上传到产品版本代码6吗?

  • 我想获得关于一个发布我的应用程序的Beta测试的程序的信息,但没有在商店上发布,因为他们不愿意进行任何发布。 我会解释哪一个是我的问题。我已经在Beta测试部分加载了apk,以便将您的用户发送到测试。 我不得不说,该应用程序目前没有加载的APK,在制造部分,然后该部分是空的,该应用程序没有发布。 在加载并在“beta testing”部分的链接部分进行了滚动后,我看到它给了我以下消息:“当你发布你