在开发对话时,您可能已经考虑过如何处理偏离主题的请求。Dialogflow 提供了一个名为 Small Talk 的可选功能。启用此功能后,代理将响应一般对话、情绪响应以及有关代理本身的问题。所有 Small Talk 响应都可以进行自定义,以确保无论是休闲、商务还是介于两者之间的体验都能体现您的品牌。
确保多个训练短语中添加了注释的文本包含训练短语的相似部分。例如,假设您有一个训练短语为“Set alarm at 6 a.m.”,其中“6 a.m.”被注释为 @sys.date。如果您的另一条训练语句为“wake me up at 7 a.m.”,请务必为“7 a.m.”添加注释,而不要为“up at 7 a.m.”添加注释。
例如,“hmmm”、“let's see”、“please”、“could you please”都是填充词和无意义文本。如果您尝试使用此类实体来增添多样性,只会降低机器学习的性能。Dialogflow 已经增强了数据来应对此类多样性。您应该将这类语句添加到训练语句中,而不是添加到实体中。
实体应具有有限的范围,可捕获一种信息类型的不同值。
实体应尽可能集中、简短、简洁。如果您的实体值很复杂,那么可能意图训练短语更适合您的情况。例如,假设最终用户的表述为“How can I make an international call with Plan A?”和“Using international data roaming with Plan B”。请不要同时为两种操作(“How can I make an international call”和“Using international data roaming”)和方案(“Plan A”、“Plan B”)创建实体。相反,您应使用训练语句和意图匹配来捕获操作,并使用实体来捕获方案。
[[["易于理解","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\u003eThis guide provides general best practices for designing agents, including considerations for objectives, platforms, and iterative building.\u003c/p\u003e\n"],["\u003cp\u003eDialogflow offers pre-built agents and system entities to help streamline agent creation, covering common use cases and handling popular information types.\u003c/p\u003e\n"],["\u003cp\u003eBest practices for agent design include implementing greetings and goodbyes, using varied and consistent training phrases, and ensuring intents have fallback and follow-up options.\u003c/p\u003e\n"],["\u003cp\u003eAgents should have a defined persona, tone, and style that reflect the brand consistently throughout interactions, while also being mindful of cultural and personal sensitivities.\u003c/p\u003e\n"],["\u003cp\u003eWhen designing for voice, agents should avoid content that requires visual interaction, create compact dialogues, and use SSML to make the agent's speech sound more natural.\u003c/p\u003e\n"]]],[],null,["# General agent design best practices\n\nThis guide provides general best practices for designing all types of agents.\n\nYou should also see the\n[voice agent design](/dialogflow/es/docs/voice-agent-design)\nguide specifically for designing voice agents,\nand the\n[best practices](/dialogflow/es/docs/best-practices)\nguide for using the Dialogflow service.\n\nBefore building an agent\n------------------------\n\nThis section provides information that you should consider\nbefore starting to build an agent.\n\n### Objective\n\nConsider the overall objective of your agent:\n\n- What is your business trying to achieve?\n- What will your users expect from your agent?\n- How often will users interact with your agent?\n\n### Platform\n\nConsider how users will access your agent.\nReview the\n[platforms supported by Dialogflow](/dialogflow/docs/integrations)\nbefore creating content.\nWhen you choose platforms to support,\nprepare your content accordingly.\nSome of Dialogflow's platform integrations support\n[rich messages](/dialogflow/docs/intents-rich-messages)\nthat can include elements like images, links, and suggestion chips.\n\n### Build agents iteratively\n\nIf your agent will be large or complex,\nstart by building a dialog that only addresses the top level requests.\nOnce the basic structure is established,\niterate on the conversation paths\nto ensure you're covering all of the possible routes a user may take.\n\n### Pre-built agents\n\nDialogflow offers pre-constructed agents to help you get started.\n[Pre-built agents](/dialogflow/docs/agents-prebuilt#prebuilt_agents)\ncover common use-cases like hotel booking, navigation, and online shopping.\nThese agents come with intents and entities\nto cover the most common user queries.\nAdd responses specific to your business,\nand you'll quickly build a functioning agent.\n\n### System entities\n\nWhen a user makes a request,\nthere's important information to parse from what they said.\nIn Dialogflow, these are called\n[entities](/dialogflow/docs/entities-overview).\nIn particular,\n[system entities](/dialogflow/docs/entities-system)\nare pre-built entities provided by Dialogflow\nthat handle the most popular types of information.\n\n### Small talk\n\nWhen developing your dialog,\nyou may have considered handling requests that are off-topic.\nDialogflow provides an optional feature called\n[small talk](/dialogflow/docs/agents-small-talk).\nWith this feature enabled,\nyour agent will respond to general conversation,\nemotional responses, and questions about the agent itself.\nAll of the small talk responses can be customized to make sure the experience,\nwhether casual, businesslike, or somewhere in between, is representative of your brand.\n\nAgent design best practices\n---------------------------\n\nThis section provides a list of best practices for a robust,\naccurate, performant, and usable agent.\n\n### Greetings and goodbyes\n\n### Machine learning and training\n\n### Intent naming\n\nIf your agent has many\n[intents](/dialogflow/es/docs/intents-overview),\nyou should consider a naming scheme that helps you keep them organized.\nIt is common to segment intent names with punctuation,\nwhere the specificity increases from left to right.\nIn addition, an intent name should reflect the end-user's intention\nfor a conversational turn.\n\nThere are many good naming schemes, but here is one example:\n\n- phone-service.order.cancel\n- phone-service.order.create\n- phone-service.order.change\n- tv-service.order.cancel\n- tv-service.order.create\n- tv-service.order.change\n- account.balance.get\n- account.balance.pay\n- account.address.get\n- account.address.update\n\n### Helpful intent features\n\n### Conversation repair\n\n### Persona\n\n### Designing for voice\n\nFor more information on designing for voice, see [Voice agent design](/dialogflow/es/docs/voice-agent-design).\n\n### Protection of consumer privacy\n\n### Using the knowledge base connector\n\n### Implementing Dialogflow APIs\n\n### Designing for voice and text in one agent\n\n### Testing\n\nEnterprise best practices\n-------------------------\n\n- See the [Google Cloud Well-Architected Framework](/architecture/framework).\n\nAdditional conversation design guides\n-------------------------------------\n\n- See the [conversation design guide](https://designguidelines.withgoogle.com/conversation) provided by the Actions on Google team.\n- See the [SSML guide](https://developers.google.com/assistant/actions/reference/ssml) provided by the Actions on Google team."]]