PermissionDenied:403 IAM权限“ dialogflow.intents.list” [英] PermissionDenied: 403 IAM permission 'dialogflow.intents.list'

查看:111
本文介绍了PermissionDenied:403 IAM权限“ dialogflow.intents.list”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Dialogflow的V2 API在Dialogflow代理中获取意图列表,但一直收到以下错误:

I'm trying to get the list of the intents in my Dialogflow agent using Dialogflow's V2 APIs but have been getting the following error:

PermissionDenied:403对'projects / xxxx / agent'的IAM权限'dialogflow.intents.list'。

我采取了以下步骤:


  1. 我创建了一个新的代理(启用了V2 API)和一个新的服务帐户。

  2. 我下载了JSON密钥并将GOOGLE_APPLICATION_CREDENTIALS变量设置为其路径。

以下是我的代码:

import dialogflow_v2 as dialogflow

os.environ["GOOGLE_APPLICATION_CREDENTIALS"]="/home/user/folder/service-account-key.json"

client=dialogflow.IntentsClient()

parent = client.project_agent_path('[PROJECT_ID]')

for element in client.list_intents(parent):
    pass

我已经建立了各种代理和服务帐户,甚至将角色从管理员更改为客户端,但无法弄清楚解。我尝试了以下解决方案,但没有成功

I have made various agents and service accounts and even changed the role from Admin to Client but can't figure out any solution. I tried the following solution but didnt' work

尝试过的解决方案: DialogFlow PermissionDenied:403 IAM权限'dialogflow.sessions.detectIntent'

推荐答案

无需创建新的代理。您可以编辑现有的代理IAM。

There is no need for creating a new Agent. You can edit the existing agents IAM.


  1. 在Dialogflow的控制台中,转到常规标签下的设置⚙>,您将看到项目带有Google Cloud链接的ID部分,以打开Goog​​le Cloud控制台>打开Goog​​le Cloud。

  2. 在Google Cloud中,转到成员标签下的IAM管理员> IAM。找到您的代理商名称,然后单击编辑。

  3. 授予代理管理员权限以授予列出意图。

这篇关于PermissionDenied:403 IAM权限“ dialogflow.intents.list”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆