[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-18。"],[[["\u003cp\u003eDialogflow's agent validation feature automatically checks for errors during agent training to help improve agent quality and performance, but it does not affect the agent's runtime behavior.\u003c/p\u003e\n"],["\u003cp\u003eValidation results, which can be viewed in the Dialogflow Console or accessed via the API, are categorized by severity (INFO, WARNING, ERROR, CRITICAL) and highlight specific issues such as similar training phrases or unused parameters.\u003c/p\u003e\n"],["\u003cp\u003eAgent validation can be toggled on or off via the agent's ML Settings, and you can manually trigger validation by disabling automatic validation.\u003c/p\u003e\n"],["\u003cp\u003eValidation errors can appear on the intents and entities pages, as well as on the versions and environments pages, identified by an error indicator.\u003c/p\u003e\n"],["\u003cp\u003eThe validation feature will show at most 5000 issues at a time, therefore it's recommended that you fix them in small batches.\u003c/p\u003e\n"]]],[],null,["# Agent validation\n\nAs discussed on the\n[Agent design](/dialogflow/docs/agents-design)\npage, the design of your agent can greatly influence the quality of your agent.\nTo help agent designers create high-quality agents,\nDialogflow provides a validation feature.\nAgent validation results are available automatically whenever\nagent training is performed and completed.\nYou can access the results of validation\nfrom either the Dialogflow Console or the API.\n\nThe validation results are informational only.\nThey provide a list of errors\nthat you should correct to improve the quality and performance of your agent.\nIf your agent has errors,\nyou can choose to ignore them and launch your agent.\nAgent validation does not affect the behavior of an agent in any way.\n\nHere are some example results that you might find:\n\n- Intent has training phrases which are too similar.\n- Intent contains a parameter that is not used in enough training phrases.\n- There are no negative examples for the fallback intent.\n- This text is annotated in some training phrases but not others.\n\nEnable and disable automatic validation\n---------------------------------------\n\nBy default, agent validation is automatically performed whenever the agent is trained. You can enable and disable this setting:\n\n1. Go to the [Dialogflow ES console](https://dialogflow.cloud.google.com).\n2. Select your agent.\n3. Click the settings *settings* icon next to the agent name.\n4. Select the **ML Settings** tab.\n5. Toggle the **Agent Validation** setting on (default) or off.\n\nAgent validation page\n---------------------\n\nTo access the validation data for your agent:\n\n1. Go to the [Dialogflow ES console](https://dialogflow.cloud.google.com).\n2. Select your agent.\n3. Click **Validation** in the [sidebar menu](/dialogflow/docs/console#console_interface_layout).\n\nValidation results for intents and entities\n-------------------------------------------\n\nWhen you visit either the intents list or the entities list pages,\nany intents or entities with validation errors show an error\n*error_outline*\nindicator next to the name.\n\nWhen you visit a page for a specific intent or entity that has validation errors,\nan error *error_outline* indicator is shown near the **Save** button.\n\nClicking this button shows a list of errors for the intent or entity.\nBy default, only errors with a severity of `CRITICAL` or `ERROR` are shown.\nYou can toggle the types of severities to also show `WARNING` and `INFO`.\n\nYou may also see error indicators for specific training phrases and parameters,\nand you can hover over these indicators to see the details.\n\nValidation results for versions and environments\n------------------------------------------------\n\nWhen viewing\n[versions and environments](/dialogflow/docs/agents-versions),\neach agent version may have unique validation errors.\nIf any errors are present, the validation icon appears next to the version.\n\nClicking the icon will show the details.\n\nValidation results with the API\n-------------------------------\n\nIn most cases, you will view validation results using the Dialogflow Console.\nHowever, you can access this data from the API as well. \n\n### REST\n\nCall the `getValidationResult` method on the [`Agents`](/dialogflow/docs/reference/common-types#agents) type.\n\n\u003cbr /\u003e\n\n\nBefore using any of the request data,\nmake the following replacements:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: your Google Cloud project ID\n\n\nHTTP method and URL:\n\n```\nGET https://dialogflow.googleapis.com/v2/projects/PROJECT_ID/agent/validationResult?languageCode=en\n```\n\nTo send your request, expand one of these options:\n\n#### curl (Linux, macOS, or Cloud Shell)\n\n| **Note:** The following command assumes that you have logged in to the `gcloud` CLI with your user account by running [`gcloud init`](/sdk/gcloud/reference/init) or [`gcloud auth login`](/sdk/gcloud/reference/auth/login) , or by using [Cloud Shell](/shell/docs), which automatically logs you into the `gcloud` CLI . You can check the currently active account by running [`gcloud auth list`](/sdk/gcloud/reference/auth/list).\n\n\nExecute the following command:\n\n```\ncurl -X GET \\\n -H \"Authorization: Bearer $(gcloud auth print-access-token)\" \\\n -H \"x-goog-user-project: PROJECT_ID\" \\\n \"https://dialogflow.googleapis.com/v2/projects/PROJECT_ID/agent/validationResult?languageCode=en\"\n```\n\n#### PowerShell (Windows)\n\n| **Note:** The following command assumes that you have logged in to the `gcloud` CLI with your user account by running [`gcloud init`](/sdk/gcloud/reference/init) or [`gcloud auth login`](/sdk/gcloud/reference/auth/login) . You can check the currently active account by running [`gcloud auth list`](/sdk/gcloud/reference/auth/list).\n\n\nExecute the following command:\n\n```\n$cred = gcloud auth print-access-token\n$headers = @{ \"Authorization\" = \"Bearer $cred\"; \"x-goog-user-project\" = \"PROJECT_ID\" }\n\nInvoke-WebRequest `\n -Method GET `\n -Headers $headers `\n -Uri \"https://dialogflow.googleapis.com/v2/projects/PROJECT_ID/agent/validationResult?languageCode=en\" | Select-Object -Expand Content\n```\n\nYou should receive a JSON response similar to the following:\n\n```\n{\n \"validationErrors\": [\n {\n \"severity\": \"ERROR\",\n \"entries\": [\n \"projects/my-project/agent/intents/58b44b2d-4967-4a81-b017-12623dcd5d28/parameters/bf6fdf55-b862-4101-b5b1-36f1423629d0\"\n ],\n \"errorMessage\": \"Parameter 'test' has an empty value.\"\n },\n {\n \"severity\": \"WARNING\",\n \"entries\": [\n \"projects/my-project/agent/intents/271e3808-3c91-4e6b-89e8-47951abcec8d\"\n ],\n \"errorMessage\": \"Intent 'app.current.update' does not have enough unique training phrases. Consider adding more different examples.\"\n },\n {\n \"severity\": \"ERROR\",\n \"entries\": [\n \"projects/my-project/agent/intents/26e64b1b-eaa7-4ce2-be46-631a501fccbe/trainingPhrases/a650375e-083c-4bb5-9794-ba9453e51282\",\n \"projects/my-project/agent/intents/58b44b2d-4967-4a81-b017-12623dcd5d28/trainingPhrases/1d947780-22d3-4f80-8d7a-3f86efbf0be3\"\n ],\n \"errorMessage\": \"Multiple intents share training phrases which are too similar:\\n - Intent 'app.notifications.open': training phrase 'open allo notifications settings'\\n - Intent 'app.current.notifications.open': training phrase 'open notifications settings'\"\n },\n ]\n}\n```\n\n\u003cbr /\u003e\n\nSeverity States\n---------------\n\nValidation can show the following severity states:\n\nForce validation\n----------------\n\nAgent validation results are available automatically whenever\nagent training is performed and completed.\nTo force new validation results,\nyou can disable automatic validation, and trigger it manually.\nSee the [Agent ML settings](/dialogflow/docs/agents-settings#ml)\npage on the console.\n\nHandling many issues\n--------------------\n\nWhen a large number of issues are found,\nyou should consider the following:\n\n- Fix issues in small batches. If there are many similar issues, fixing one issue may fix similar issues after you retrain the agent.\n- At most 5000 issues are shown at a time. If you have over 5000 issues, you may not see a count reduction until less than 5000 remain."]]