14 个稳定版本 (3 个主要版本)
5.0.4+20240227 | 2024 年 3 月 5 日 |
---|---|
3.1.0+20220228 | 2022 年 4 月 26 日 |
3.0.0+20220228 | 2022 年 3 月 8 日 |
2.0.4+20210329 | 2021 年 4 月 15 日 |
1.0.7+20171211 | 2017 年 12 月 12 日 |
#1581 in Web 编程
264 每月下载量
5.5MB
67K SLoC
dialogflow2-beta1
命令行界面(CLI)允许您在终端中舒适地使用 Google Dialogflow 服务的大部分功能。
默认情况下,所有输出都打印到标准输出,但可以通过设置标志将其直接重定向到文件,而不受您的 shell 功能的限制。错误将打印到标准错误,并导致程序退出代码不为零。
如果请求数据结构,则这些结构将作为格式化的 JSON 返回,以便作为其他工具的输入。
关于 Dialogflow API 的其他所有内容,请参阅官方文档网站。
安装和源代码
使用 cargo 安装命令行界面:
cargo install google-dialogflow2_beta1-cli
在 GitHub 上找到源代码。
用法
此文档是根据修订版 20240227 的 Dialogflow API 生成的。CLI 版本为 5.0.4。
dialogflow2-beta1 [options]
projects
agent-entity-types-batch-delete <parent> (-r <kv>)... [-p <v>]... [-o <out>]
agent-entity-types-batch-update <parent> (-r <kv>)... [-p <v>]... [-o <out>]
agent-entity-types-create <parent> (-r <kv>)... [-p <v>]... [-o <out>]
agent-entity-types-delete <name> [-p <v>]... [-o <out>]
agent-entity-types-entities-batch-create <parent> (-r <kv>)... [-p <v>]... [-o <out>]
agent-entity-types-entities-batch-delete <parent> (-r <kv>)... [-p <v>]... [-o <out>]
agent-entity-types-entities-batch-update <parent> (-r <kv>)... [-p <v>]... [-o <out>]
agent-entity-types-get <name> [-p <v>]... [-o <out>]
agent-entity-types-list <parent> [-p <v>]... [-o <out>]
agent-entity-types-patch <name> (-r <kv>)... [-p <v>]... [-o <out>]
agent-environments-create <parent> (-r <kv>)... [-p <v>]... [-o <out>]
agent-environments-delete <name> [-p <v>]... [-o <out>]
agent-environments-get <name> [-p <v>]... [-o <out>]
agent-environments-get-history <parent> [-p <v>]... [-o <out>]
agent-environments-intents-list <parent> [-p <v>]... [-o <out>]
agent-environments-list <parent> [-p <v>]... [-o <out>]
agent-environments-patch <name> (-r <kv>)... [-p <v>]... [-o <out>]
agent-environments-users-sessions-contexts-create <parent> (-r <kv>)... [-p <v>]... [-o <out>]
agent-environments-users-sessions-contexts-delete <name> [-p <v>]... [-o <out>]
agent-environments-users-sessions-contexts-get <name> [-p <v>]... [-o <out>]
agent-environments-users-sessions-contexts-list <parent> [-p <v>]... [-o <out>]
agent-environments-users-sessions-contexts-patch <name> (-r <kv>)... [-p <v>]... [-o <out>]
agent-environments-users-sessions-delete-contexts <parent> [-p <v>]... [-o <out>]
agent-environments-users-sessions-detect-intent <session> (-r <kv>)... [-p <v>]... [-o <out>]
agent-environments-users-sessions-entity-types-create <parent> (-r <kv>)... [-p <v>]... [-o <out>]
agent-environments-users-sessions-entity-types-delete <name> [-p <v>]... [-o <out>]
agent-environments-users-sessions-entity-types-get <name> [-p <v>]... [-o <out>]
agent-environments-users-sessions-entity-types-list <parent> [-p <v>]... [-o <out>]
agent-environments-users-sessions-entity-types-patch <name> (-r <kv>)... [-p <v>]... [-o <out>]
agent-export <parent> (-r <kv>)... [-p <v>]... [-o <out>]
agent-get-fulfillment <name> [-p <v>]... [-o <out>]
agent-get-validation-result <parent> [-p <v>]... [-o <out>]
agent-import <parent> (-r <kv>)... [-p <v>]... [-o <out>]
agent-intents-batch-delete <parent> (-r <kv>)... [-p <v>]... [-o <out>]
agent-intents-batch-update <parent> (-r <kv>)... [-p <v>]... [-o <out>]
agent-intents-create <parent> (-r <kv>)... [-p <v>]... [-o <out>]
agent-intents-delete <name> [-p <v>]... [-o <out>]
agent-intents-get <name> [-p <v>]... [-o <out>]
agent-intents-list <parent> [-p <v>]... [-o <out>]
agent-intents-patch <name> (-r <kv>)... [-p <v>]... [-o <out>]
agent-knowledge-bases-create <parent> (-r <kv>)... [-p <v>]... [-o <out>]
agent-knowledge-bases-delete <name> [-p <v>]... [-o <out>]
agent-knowledge-bases-documents-create <parent> (-r <kv>)... [-p <v>]... [-o <out>]
agent-knowledge-bases-documents-delete <name> [-p <v>]... [-o <out>]
agent-knowledge-bases-documents-get <name> [-p <v>]... [-o <out>]
agent-knowledge-bases-documents-list <parent> [-p <v>]... [-o <out>]
agent-knowledge-bases-documents-patch <name> (-r <kv>)... [-p <v>]... [-o <out>]
agent-knowledge-bases-documents-reload <name> (-r <kv>)... [-p <v>]... [-o <out>]
agent-knowledge-bases-get <name> [-p <v>]... [-o <out>]
agent-knowledge-bases-list <parent> [-p <v>]... [-o <out>]
agent-knowledge-bases-patch <name> (-r <kv>)... [-p <v>]... [-o <out>]
agent-restore <parent> (-r <kv>)... [-p <v>]... [-o <out>]
agent-search <parent> [-p <v>]... [-o <out>]
agent-sessions-contexts-create <parent> (-r <kv>)... [-p <v>]... [-o <out>]
agent-sessions-contexts-delete <name> [-p <v>]... [-o <out>]
agent-sessions-contexts-get <name> [-p <v>]... [-o <out>]
agent-sessions-contexts-list <parent> [-p <v>]... [-o <out>]
agent-sessions-contexts-patch <name> (-r <kv>)... [-p <v>]... [-o <out>]
agent-sessions-delete-contexts <parent> [-p <v>]... [-o <out>]
agent-sessions-detect-intent <session> (-r <kv>)... [-p <v>]... [-o <out>]
agent-sessions-entity-types-create <parent> (-r <kv>)... [-p <v>]... [-o <out>]
agent-sessions-entity-types-delete <name> [-p <v>]... [-o <out>]
agent-sessions-entity-types-get <name> [-p <v>]... [-o <out>]
agent-sessions-entity-types-list <parent> [-p <v>]... [-o <out>]
agent-sessions-entity-types-patch <name> (-r <kv>)... [-p <v>]... [-o <out>]
agent-train <parent> (-r <kv>)... [-p <v>]... [-o <out>]
agent-update-fulfillment <name> (-r <kv>)... [-p <v>]... [-o <out>]
agent-versions-create <parent> (-r <kv>)... [-p <v>]... [-o <out>]
agent-versions-delete <name> [-p <v>]... [-o <out>]
agent-versions-get <name> [-p <v>]... [-o <out>]
agent-versions-list <parent> [-p <v>]... [-o <out>]
agent-versions-patch <name> (-r <kv>)... [-p <v>]... [-o <out>]
answer-records-get <name> [-p <v>]... [-o <out>]
answer-records-list <parent> [-p <v>]... [-o <out>]
answer-records-patch <name> (-r <kv>)... [-p <v>]... [-o <out>]
conversation-profiles-clear-suggestion-feature-config <conversation-profile> (-r <kv>)... [-p <v>]... [-o <out>]
conversation-profiles-create <parent> (-r <kv>)... [-p <v>]... [-o <out>]
conversation-profiles-delete <name> [-p <v>]... [-o <out>]
conversation-profiles-get <name> [-p <v>]... [-o <out>]
conversation-profiles-list <parent> [-p <v>]... [-o <out>]
conversation-profiles-patch <name> (-r <kv>)... [-p <v>]... [-o <out>]
conversation-profiles-set-suggestion-feature-config <conversation-profile> (-r <kv>)... [-p <v>]... [-o <out>]
conversations-complete <name> (-r <kv>)... [-p <v>]... [-o <out>]
conversations-create <parent> (-r <kv>)... [-p <v>]... [-o <out>]
conversations-get <name> [-p <v>]... [-o <out>]
conversations-list <parent> [-p <v>]... [-o <out>]
conversations-messages-batch-create <parent> (-r <kv>)... [-p <v>]... [-o <out>]
conversations-messages-list <parent> [-p <v>]... [-o <out>]
conversations-participants-analyze-content <participant> (-r <kv>)... [-p <v>]... [-o <out>]
conversations-participants-create <parent> (-r <kv>)... [-p <v>]... [-o <out>]
conversations-participants-get <name> [-p <v>]... [-o <out>]
conversations-participants-list <parent> [-p <v>]... [-o <out>]
conversations-participants-patch <name> (-r <kv>)... [-p <v>]... [-o <out>]
conversations-participants-suggestions-compile <parent> (-r <kv>)... [-p <v>]... [-o <out>]
conversations-participants-suggestions-list <parent> [-p <v>]... [-o <out>]
conversations-participants-suggestions-suggest-articles <parent> (-r <kv>)... [-p <v>]... [-o <out>]
conversations-participants-suggestions-suggest-faq-answers <parent> (-r <kv>)... [-p <v>]... [-o <out>]
conversations-participants-suggestions-suggest-smart-replies <parent> (-r <kv>)... [-p <v>]... [-o <out>]
conversations-suggestions-search-knowledge <conversation> (-r <kv>)... [-p <v>]... [-o <out>]
conversations-suggestions-suggest-conversation-summary <conversation> (-r <kv>)... [-p <v>]... [-o <out>]
delete-agent <parent> [-p <v>]... [-o <out>]
get-agent <parent> [-p <v>]... [-o <out>]
knowledge-bases-create <parent> (-r <kv>)... [-p <v>]... [-o <out>]
knowledge-bases-delete <name> [-p <v>]... [-o <out>]
knowledge-bases-documents-create <parent> (-r <kv>)... [-p <v>]... [-o <out>]
knowledge-bases-documents-delete <name> [-p <v>]... [-o <out>]
knowledge-bases-documents-get <name> [-p <v>]... [-o <out>]
knowledge-bases-documents-import <parent> (-r <kv>)... [-p <v>]... [-o <out>]
knowledge-bases-documents-list <parent> [-p <v>]... [-o <out>]
knowledge-bases-documents-patch <name> (-r <kv>)... [-p <v>]... [-o <out>]
knowledge-bases-documents-reload <name> (-r <kv>)... [-p <v>]... [-o <out>]
knowledge-bases-get <name> [-p <v>]... [-o <out>]
knowledge-bases-list <parent> [-p <v>]... [-o <out>]
knowledge-bases-patch <name> (-r <kv>)... [-p <v>]... [-o <out>]
locations-agent-entity-types-batch-delete <parent> (-r <kv>)... [-p <v>]... [-o <out>]
locations-agent-entity-types-batch-update <parent> (-r <kv>)... [-p <v>]... [-o <out>]
locations-agent-entity-types-create <parent> (-r <kv>)... [-p <v>]... [-o <out>]
locations-agent-entity-types-delete <name> [-p <v>]... [-o <out>]
locations-agent-entity-types-entities-batch-create <parent> (-r <kv>)... [-p <v>]... [-o <out>]
locations-agent-entity-types-entities-batch-delete <parent> (-r <kv>)... [-p <v>]... [-o <out>]
locations-agent-entity-types-entities-batch-update <parent> (-r <kv>)... [-p <v>]... [-o <out>]
locations-agent-entity-types-get <name> [-p <v>]... [-o <out>]
locations-agent-entity-types-list <parent> [-p <v>]... [-o <out>]
locations-agent-entity-types-patch <name> (-r <kv>)... [-p <v>]... [-o <out>]
locations-agent-environments-create <parent> (-r <kv>)... [-p <v>]... [-o <out>]
locations-agent-environments-delete <name> [-p <v>]... [-o <out>]
locations-agent-environments-get <name> [-p <v>]... [-o <out>]
locations-agent-environments-get-history <parent> [-p <v>]... [-o <out>]
locations-agent-environments-intents-list <parent> [-p <v>]... [-o <out>]
locations-agent-environments-list <parent> [-p <v>]... [-o <out>]
locations-agent-environments-patch <name> (-r <kv>)... [-p <v>]... [-o <out>]
locations-agent-environments-users-sessions-contexts-create <parent> (-r <kv>)... [-p <v>]... [-o <out>]
locations-agent-environments-users-sessions-contexts-delete <name> [-p <v>]... [-o <out>]
locations-agent-environments-users-sessions-contexts-get <name> [-p <v>]... [-o <out>]
locations-agent-environments-users-sessions-contexts-list <parent> [-p <v>]... [-o <out>]
locations-agent-environments-users-sessions-contexts-patch <name> (-r <kv>)... [-p <v>]... [-o <out>]
locations-agent-environments-users-sessions-delete-contexts <parent> [-p <v>]... [-o <out>]
locations-agent-environments-users-sessions-detect-intent <session> (-r <kv>)... [-p <v>]... [-o <out>]
locations-agent-environments-users-sessions-entity-types-create <parent> (-r <kv>)... [-p <v>]... [-o <out>]
locations-agent-environments-users-sessions-entity-types-delete <name> [-p <v>]... [-o <out>]
locations-agent-environments-users-sessions-entity-types-get <name> [-p <v>]... [-o <out>]
locations-agent-environments-users-sessions-entity-types-list <parent> [-p <v>]... [-o <out>]
locations-agent-environments-users-sessions-entity-types-patch <name> (-r <kv>)... [-p <v>]... [-o <out>]
locations-agent-export <parent> (-r <kv>)... [-p <v>]... [-o <out>]
locations-agent-get-fulfillment <name> [-p <v>]... [-o <out>]
locations-agent-get-validation-result <parent> [-p <v>]... [-o <out>]
locations-agent-import <parent> (-r <kv>)... [-p <v>]... [-o <out>]
locations-agent-intents-batch-delete <parent> (-r <kv>)... [-p <v>]... [-o <out>]
locations-agent-intents-batch-update <parent> (-r <kv>)... [-p <v>]... [-o <out>]
locations-agent-intents-create <parent> (-r <kv>)... [-p <v>]... [-o <out>]
locations-agent-intents-delete <name> [-p <v>]... [-o <out>]
locations-agent-intents-get <name> [-p <v>]... [-o <out>]
locations-agent-intents-list <parent> [-p <v>]... [-o <out>]
locations-agent-intents-patch <name> (-r <kv>)... [-p <v>]... [-o <out>]
locations-agent-restore <parent> (-r <kv>)... [-p <v>]... [-o <out>]
locations-agent-search <parent> [-p <v>]... [-o <out>]
locations-agent-sessions-contexts-create <parent> (-r <kv>)... [-p <v>]... [-o <out>]
locations-agent-sessions-contexts-delete <name> [-p <v>]... [-o <out>]
locations-agent-sessions-contexts-get <name> [-p <v>]... [-o <out>]
locations-agent-sessions-contexts-list <parent> [-p <v>]... [-o <out>]
locations-agent-sessions-contexts-patch <name> (-r <kv>)... [-p <v>]... [-o <out>]
locations-agent-sessions-delete-contexts <parent> [-p <v>]... [-o <out>]
locations-agent-sessions-detect-intent <session> (-r <kv>)... [-p <v>]... [-o <out>]
locations-agent-sessions-entity-types-create <parent> (-r <kv>)... [-p <v>]... [-o <out>]
locations-agent-sessions-entity-types-delete <name> [-p <v>]... [-o <out>]
locations-agent-sessions-entity-types-get <name> [-p <v>]... [-o <out>]
locations-agent-sessions-entity-types-list <parent> [-p <v>]... [-o <out>]
locations-agent-sessions-entity-types-patch <name> (-r <kv>)... [-p <v>]... [-o <out>]
locations-agent-train <parent> (-r <kv>)... [-p <v>]... [-o <out>]
locations-agent-update-fulfillment <name> (-r <kv>)... [-p <v>]... [-o <out>]
locations-agent-versions-create <parent> (-r <kv>)... [-p <v>]... [-o <out>]
locations-agent-versions-delete <name> [-p <v>]... [-o <out>]
locations-agent-versions-get <name> [-p <v>]... [-o <out>]
locations-agent-versions-list <parent> [-p <v>]... [-o <out>]
locations-agent-versions-patch <name> (-r <kv>)... [-p <v>]... [-o <out>]
locations-answer-records-get <name> [-p <v>]... [-o <out>]
locations-answer-records-list <parent> [-p <v>]... [-o <out>]
locations-answer-records-patch <name> (-r <kv>)... [-p <v>]... [-o <out>]
locations-conversation-profiles-clear-suggestion-feature-config <conversation-profile> (-r <kv>)... [-p <v>]... [-o <out>]
locations-conversation-profiles-create <parent> (-r <kv>)... [-p <v>]... [-o <out>]
locations-conversation-profiles-delete <name> [-p <v>]... [-o <out>]
locations-conversation-profiles-get <name> [-p <v>]... [-o <out>]
locations-conversation-profiles-list <parent> [-p <v>]... [-o <out>]
locations-conversation-profiles-patch <name> (-r <kv>)... [-p <v>]... [-o <out>]
locations-conversation-profiles-set-suggestion-feature-config <conversation-profile> (-r <kv>)... [-p <v>]... [-o <out>]
locations-conversations-complete <name> (-r <kv>)... [-p <v>]... [-o <out>]
locations-conversations-create <parent> (-r <kv>)... [-p <v>]... [-o <out>]
locations-conversations-get <name> [-p <v>]... [-o <out>]
locations-conversations-list <parent> [-p <v>]... [-o <out>]
locations-conversations-messages-batch-create <parent> (-r <kv>)... [-p <v>]... [-o <out>]
locations-conversations-messages-list <parent> [-p <v>]... [-o <out>]
locations-conversations-participants-analyze-content <participant> (-r <kv>)... [-p <v>]... [-o <out>]
locations-conversations-participants-create <parent> (-r <kv>)... [-p <v>]... [-o <out>]
locations-conversations-participants-get <name> [-p <v>]... [-o <out>]
locations-conversations-participants-list <parent> [-p <v>]... [-o <out>]
locations-conversations-participants-patch <name> (-r <kv>)... [-p <v>]... [-o <out>]
locations-conversations-participants-suggestions-suggest-articles <parent> (-r <kv>)... [-p <v>]... [-o <out>]
locations-conversations-participants-suggestions-suggest-faq-answers <parent> (-r <kv>)... [-p <v>]... [-o <out>]
locations-conversations-participants-suggestions-suggest-smart-replies <parent> (-r <kv>)... [-p <v>]... [-o <out>]
locations-conversations-suggestions-search-knowledge <conversation> (-r <kv>)... [-p <v>]... [-o <out>]
locations-conversations-suggestions-suggest-conversation-summary <conversation> (-r <kv>)... [-p <v>]... [-o <out>]
locations-delete-agent <parent> [-p <v>]... [-o <out>]
locations-get <name> [-p <v>]... [-o <out>]
locations-get-agent <parent> [-p <v>]... [-o <out>]
locations-knowledge-bases-create <parent> (-r <kv>)... [-p <v>]... [-o <out>]
locations-knowledge-bases-delete <name> [-p <v>]... [-o <out>]
locations-knowledge-bases-documents-create <parent> (-r <kv>)... [-p <v>]... [-o <out>]
locations-knowledge-bases-documents-delete <name> [-p <v>]... [-o <out>]
locations-knowledge-bases-documents-get <name> [-p <v>]... [-o <out>]
locations-knowledge-bases-documents-import <parent> (-r <kv>)... [-p <v>]... [-o <out>]
locations-knowledge-bases-documents-list <parent> [-p <v>]... [-o <out>]
locations-knowledge-bases-documents-patch <name> (-r <kv>)... [-p <v>]... [-o <out>]
locations-knowledge-bases-documents-reload <name> (-r <kv>)... [-p <v>]... [-o <out>]
locations-knowledge-bases-get <name> [-p <v>]... [-o <out>]
locations-knowledge-bases-list <parent> [-p <v>]... [-o <out>]
locations-knowledge-bases-patch <name> (-r <kv>)... [-p <v>]... [-o <out>]
locations-list <name> [-p <v>]... [-o <out>]
locations-operations-cancel <name> [-p <v>]... [-o <out>]
locations-operations-get <name> [-p <v>]... [-o <out>]
locations-operations-list <name> [-p <v>]... [-o <out>]
locations-set-agent <parent> (-r <kv>)... [-p <v>]... [-o <out>]
locations-suggestions-generate-stateless-summary <parent> (-r <kv>)... [-p <v>]... [-o <out>]
locations-suggestions-search-knowledge <parent> (-r <kv>)... [-p <v>]... [-o <out>]
operations-cancel <name> [-p <v>]... [-o <out>]
operations-get <name> [-p <v>]... [-o <out>]
operations-list <name> [-p <v>]... [-o <out>]
set-agent <parent> (-r <kv>)... [-p <v>]... [-o <out>]
suggestions-generate-stateless-summary <parent> (-r <kv>)... [-p <v>]... [-o <out>]
suggestions-search-knowledge <parent> (-r <kv>)... [-p <v>]... [-o <out>]
dialogflow2-beta1 --help
Configuration:
[--scope <url>]...
Specify the authentication a method should be executed in. Each scope
requires the user to grant this application permission to use it.
If unset, it defaults to the shortest scope url for a particular method.
--config-dir <folder>
A directory into which we will store our persistent data. Defaults to
a user-writable directory that we will create during the first invocation.
[default: ~/.google-service-cli]
配置
程序将所有持久数据存储在 ~/.google-service-cli
目录中,该目录中的 JSON 文件以 dialogflow2-beta1-
前缀开头。您可以使用 --config-dir
标志在每个调用的基础上更改用于存储配置的目录。
以下段落中提供了有关各种类型持久数据的更多信息。
身份验证
大多数 API 需要用户对请求进行身份验证。如果是这种情况,则 作用域 确定了授予的权限集。这些的粒度通常不超过 只读 或 完全访问。
如果没有设置,则系统将自动选择最小的可行作用域,例如,当调用只读方法时,它将仅请求只读作用域。您可以使用 --scope
标志直接指定作用域。所有适用的作用域都在相应方法的 CLI 文档中有记录。
第一次使用作用域时,会提示用户进行授权。按照CLI提供的说明进行授权或拒绝。
如果用户已经验证了作用域,相应的信息将以JSON格式存储在配置目录中,例如:~/.google-service-cli/dialogflow2-beta1-token-<scope-hash>.json
。无需手动管理这些令牌。
要撤销授权,请参考官方文档。
应用程序密钥
为了让任何应用程序使用Google服务,需要使用Google开发者控制台进行注册。为应用程序启用的API将逐个启用。大多数API可以免费使用,并设有每日配额。
为了使CLI更加方便使用,无需强制用户注册自己的应用程序,CLI自带默认应用程序密钥,并相应配置。这也意味着全球范围内的重用可能会耗尽每日配额。
您可以通过在此位置放置自己的密钥文件来解决这个问题:~/.google-service-cli/dialogflow2-beta1-secret.json
,假设已为它启用了所需的dialogflow API。这样的密钥文件可以在Google开发者控制台的APIs & auth -> Credentials -> Download JSON中下载并直接使用。
有关如何设置Google项目和启用API的更多信息,请参阅官方文档。
调试
尽管CLI会尽力提供可用的错误消息,但有时可能希望了解导致特定问题的确切原因。这是通过允许所有客户端-服务器通信输出到标准错误原样来完成的。
使用--debug
标志将错误以Debug
表示形式输出到标准错误。
您可以考虑将标准错误重定向到文件以方便使用,例如:dialogflow2-beta1 --debug <resource> <method> [options] 2>debug.txt
。
依赖项
~19–31MB
~578K SLoC