← 返回
开发者工具 Key 中文

Dialogflow Cx Nlu

Manage intents and entity types in Google Dialogflow CX via REST API. Use for creating, updating, and managing natural language understanding components. Sup...
通过 REST API 管理 Google Dialogflow CX 中的意图和实体类型,用于创建、更新和管理自然语言理解组件。
yash-kavaiya
开发者工具 clawhub v1.0.0 1 版本 100000 Key: 需要
★ 0
Stars
📥 520
下载
💾 6
安装
1
版本
#latest

概述

Dialogflow CX NLU

Manage intents and entity types in Google Dialogflow CX via REST API for natural language understanding.

Prerequisites

  • Google Cloud project with Dialogflow CX API enabled
  • Service account or OAuth credentials with Dialogflow API access
  • gcloud CLI authenticated OR bearer token

Authentication

Option 1: gcloud CLI (recommended)

gcloud auth application-default login
TOKEN=$(gcloud auth print-access-token)

Option 2: Service Account

export GOOGLE_APPLICATION_CREDENTIALS="/path/to/service-account.json"
TOKEN=$(gcloud auth application-default print-access-token)

API Base URL

https://dialogflow.googleapis.com/v3beta1

Regional endpoints available:

  • https://{region}-dialogflow.googleapis.com (e.g., us-central1, europe-west1)

Common Operations

List Intents

curl -X GET \
  "https://dialogflow.googleapis.com/v3beta1/projects/${PROJECT_ID}/locations/${LOCATION}/agents/${AGENT_ID}/intents" \
  -H "Authorization: Bearer ${TOKEN}"

Create Intent

curl -X POST \
  "https://dialogflow.googleapis.com/v3beta1/projects/${PROJECT_ID}/locations/${LOCATION}/agents/${AGENT_ID}/intents" \
  -H "Authorization: Bearer ${TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{
    "displayName": "Book Flight",
    "trainingPhrases": [
      {
        "parts": [{"text": "I want to book a flight"}],
        "repeatCount": 1
      }
    ]
  }'

List Entity Types

curl -X GET \
  "https://dialogflow.googleapis.com/v3beta1/projects/${PROJECT_ID}/locations/${LOCATION}/agents/${AGENT_ID}/entityTypes" \
  -H "Authorization: Bearer ${TOKEN}"

Create Entity Type

curl -X POST \
  "https://dialogflow.googleapis.com/v3beta1/projects/${PROJECT_ID}/locations/${LOCATION}/agents/${AGENT_ID}/entityTypes" \
  -H "Authorization: Bearer ${TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{
    "displayName": "Cities",
    "kind": "KIND_LIST",
    "entities": [
      {"value": "New York"},
      {"value": "Los Angeles"}
    ]
  }'

Key Resources

| Resource | Description |

|----------|-------------|

| Intents | Classify user utterances and extract parameters |

| Entity Types | Define structured data extraction patterns |

Quick Reference

For detailed API reference:

Scripts

  • scripts/nlu.py — CLI wrapper for intents and entity types operations

Usage

python scripts/nlu.py list-intents --agent AGENT_NAME
python scripts/nlu.py create-intent --agent AGENT_NAME --intent "Book Flight" --phrases "book a flight,I want to fly"
python scripts/nlu.py list-entities --agent AGENT_NAME
python scripts/nlu.py create-entity --agent AGENT_NAME --name "Cities" --values "New York,Los Angeles"

Tips

  • Use training phrases that cover various ways users might express the intent
  • Entity types can be system (built-in) or custom
  • Use KIND_MAP for entities with synonyms, KIND_LIST for simple lists

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-30 05:46 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-intelligence

Cx Agent Studio

yash-kavaiya
Google 客户体验代理工作室(CX Agent Studio)的使用指南和说明,适用于创建对话代理、编写或构建交互流程。
★ 0 📥 788
developer-tools

Gog

steipete
Google Workspace 命令行工具,支持 Gmail、日历、云端硬盘、通讯录、表格和文档。
★ 921 📥 185,924
developer-tools

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 68 📥 180,461