360 Secure SkillHub
360 安全技能中心

Dialogflow Cx Advanced

这是Google Dialogflow CX的高级管理工具,基于v3beta1 API,核心功能含环境、webhook的增列管理及持续测试支持。典型场景包括多环境部署(开发/ staging/生产)、外部服务集成、对话质量监控。需满足GCP项目、API启用、认证前置条件,支持区域端点。可通过curl请求或配套Python脚本操作,输入带认证的参数,输出JSON格式资源数据。

yash-kavaiya
yash-kavaiya
热度 82.49
最近更新 2026-05-11 17:27:47
分类:开发依赖:代码执行 / 第三方 API应用场景:API 集成 / 自动化脚本 / DevOps

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add dialogflow-cx-advanced
Metadata
name
dialogflow-cx-advanced
description
Manage advanced features in Google Dialogflow CX via REST API. Use for environments, webhooks, and deployment management. Supports v3beta1 API.

Dialogflow CX Advanced

Manage advanced features in Google Dialogflow CX via REST API for deployment and external integrations.

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 Environments

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

Create Environment

curl -X POST \
  "https://dialogflow.googleapis.com/v3beta1/projects/${PROJECT_ID}/locations/${LOCATION}/agents/${AGENT_ID}/environments" \
  -H "Authorization: Bearer ${TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{
    "displayName": "production",
    "description": "Production environment"
  }'

List Webhooks

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

Create Webhook

curl -X POST \
  "https://dialogflow.googleapis.com/v3beta1/projects/${PROJECT_ID}/locations/${LOCATION}/agents/${AGENT_ID}/webhooks" \
  -H "Authorization: Bearer ${TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{
    "displayName": "Order Fulfillment",
    "genericWebService": {
      "uri": "https://your-webhook.com/fulfill"
    }
  }'

Key Resources

Resource Description
Environments Deployment stages (draft, production)
Webhooks External fulfillment endpoints
Continuous Testing Ongoing health monitoring

Quick Reference

For detailed API reference:

Scripts

  • scripts/advanced.py — CLI wrapper for advanced operations

Usage

python scripts/advanced.py list-environments --agent AGENT_NAME
python scripts/advanced.py list-webhooks --agent AGENT_NAME

Tips

  • Use environments to separate development, staging, and production
  • Webhooks enable external processing and integrations
  • Continuous testing helps maintain conversation quality