dialogflow-cx - “请切换到 'us-east1-dialogflow.googleapis.com' 以访问位于 'us-east1' 中的资源” Dialogflow CX GO API V3
问题描述
我正在尝试使用 RPC DetectIntent 方法与 Dialogflow CX 代理进行交互,但我收到错误消息“请切换到 'us-east1-dialogflow.googleapis.com' 以访问位于 'us-east1' 中的资源”。
我的代理位于“us-east1”。我提供给 API 的会话路径采用以下格式:“projects/myproject/locations/us-east1/agents/my-agent-id/sessions/mysessionid
我的进口是:
cx“cloud.google.com/go/dialogflow/cx/apiv3”
cxpb“goolge.golang.org/genproto/goolgeapis/cloud/dialogflow/cx/v3”
我使用类似的会话路径在 Python 中工作,我不明白 GO API 想要什么。谁能告诉我这个错误是什么意思?
解决方案
我想到了。它指的是端点 ID。需要使用引用该位置的端点 ID 创建代理。
dialogflow.NewSessionsClient(ctx, option.WithEndpoint("us-east1-dialogflow.googleapis.com:443"))
推荐阅读
- javascript - 方法在节点 js 中使用 forEach 循环用于云 Firestore 时给出空数组而不是完整数据
- sql - 如何在 Redshift 中优化这种方法?
- routes - 所有模块的主/前缀路由
- c - gcc 内置的 __atomic 或 __sync 函数无法提供对全局变量的一致访问
- ios - 从json响应swift中删除数组中的双引号
- c - OBS - 录制屏幕时捕获帧
- python - 无法从函数定义中解包错误
- regex - 在 2 个子字符串之间选择一个子字符串
- typescript - 在ionic 4中打开带有图像和选择图像的模态?
- reactjs - 使用另一个函数中的更新状态作为参数