例如,您可以创建一个天气代理,用于识别并响应最终用户关于天气的问题。您可以为与天气预报有关的问题定义一个意图。如果最终用户说出“What's the forecast?”,Dialogflow 会将该最终用户表述与预测意图相匹配。您还可以定义意图,以便从最终用户表述中提取实用信息,例如所需哪个时间或地方的天气预报。提取的数据对于系统为最终用户执行天气查询非常重要。
[[["易于理解","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\u003eAn intent categorizes an end-user's intention within a conversation, and each agent can have multiple intents to handle a complete conversation flow.\u003c/p\u003e\n"],["\u003cp\u003eDialogflow matches an end-user's expression to the most suitable intent, known as intent classification, and this match can be set to extract specific information.\u003c/p\u003e\n"],["\u003cp\u003eBasic intent components include training phrases, actions, parameters, and responses to guide the conversation and provide feedback to the user.\u003c/p\u003e\n"],["\u003cp\u003eComplex intents may also include contexts to understand end-user expressions within a conversation's flow, and events that trigger an intent based on occurrences rather than direct user input.\u003c/p\u003e\n"]]],[],null,["# Intents\n\nAn\n\n*intent*\n\ncategorizes an end-user's intention for one conversation turn.\nFor each agent, you define many intents,\nwhere your combined intents can handle a complete conversation.\nWhen an end-user writes or says something,\nreferred to as an *end-user expression* ,\nDialogflow matches the end-user expression to the best intent in your agent.\nMatching an intent is also known as *intent classification*.\n\n\nFor example, you could create a weather agent\nthat recognizes and responds to end-user questions about the weather.\nYou would likely define an intent for questions about the weather forecast.\nIf an end-user says \"What's the forecast?\",\nDialogflow would match that end-user expression to the forecast intent.\nYou can also define your intent to extract useful information from the end-user expression,\nlike a time or location for the desired weather forecast.\nThis extracted data is important for your system\nto perform a weather query for the end-user.\n\n\nA basic intent contains the following:\n\n- [**Training phrases**](/dialogflow/docs/intents-training-phrases): These are example phrases for what end-users might say. When an end-user expression resembles one of these phrases, Dialogflow matches the intent. You don't have to define every possible example, because Dialogflow's built-in machine learning expands on your list with other, similar phrases.\n- [**Action**](/dialogflow/docs/intents-actions-parameters#actions): You can define an action for each intent. When an intent is matched, Dialogflow provides the action to your system, and you can use the action to trigger certain actions defined in your system.\n- [**Parameters**](/dialogflow/docs/intents-actions-parameters#params): When an intent is matched at runtime, Dialogflow provides the extracted values from the end-user expression as *parameters* . Each parameter has a type, called the [entity type](/dialogflow/docs/entities-overview), which dictates exactly how the data is extracted. Unlike raw end-user input, parameters are structured data that can easily be used to perform some logic or generate responses.\n- [**Responses**](/dialogflow/docs/intents-responses): You define text, speech, or visual responses to return to the end-user. These may provide the end-user with answers, ask the end-user for more information, or terminate the conversation.\n\n\nThe following diagram shows the basic flow for intent matching and responding to the end-user:\n\nA more complex intent may also contain the following:\n\n- [**Contexts**](/dialogflow/docs/contexts-overview): Dialogflow contexts are similar to natural language context. If a person says to you \"they are orange\", you need context in order to understand what the person is referring to. Similarly, for Dialogflow to handle an end-user expression like that, it needs to be provided with context in order to correctly match an intent.\n- [**Events**](/dialogflow/docs/events-overview): With events, you can invoke an intent based on something that has happened, instead of what an end-user communicates."]]