智能回复
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。

利用机器学习套件的智能回复 API,您可以自动生成对消息的相关回复。智能回复功能可帮助用户快速回复消息,还能让您在输入功能受限的设备上更轻松地回复消息。
iOS
Android
主要功能
- 智能回复模型会根据对话的完整上下文(而不仅仅是单条消息)生成回复建议。这意味着这些建议对用户更有帮助。
- 设备端模型可以快速生成回复,不需要您将用户的消息发送到远程服务器。
限制
- 智能回复适用于消费者应用中的闲聊对话。回复建议可能不适合其他情境或受众群体。
- 目前只支持英语。该模型会自动识别所使用的语言,并且仅在其为英语时才提供建议。
模型的工作原理
- 模型最多使用对话历史记录中的 10 条最新消息来生成回复建议。
- 它会检测对话的语言,并且仅在确定语言为英语时才尝试提供回复。
- 模型会将消息与敏感主题列表进行比较,在检测到敏感主题时不会提供建议。
- 如果确定语言为英语,并且未检测到敏感主题,则模型最多提供三项建议响应。回复的数量取决于有多少回复符合足够高的置信度,具体取决于模型的输入。
提供反馈
由于自然语言处理的复杂性,模型提供的建议可能并不适合所有情境或受众群体。如果您遇到不恰当的回复建议,请与机器学习套件支持团队联系。您的反馈有助于改进模型以及敏感主题的过滤器。
示例结果
时间戳 |
User-ID |
本地用户? |
消息 |
太平洋标准时间 2019 年 2 月 21 日星期四 13:13:39 |
|
true |
你在路上吗? |
太平洋标准时间 2019 年 2 月 21 日星期四 13:15:03 |
FRIEND0 |
false |
要迟到了,抱歉! |
建议的回复
建议 1 |
建议 2 |
第 3 条建议 |
不用担心 |
😞 |
没关系! |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-17。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-17。"],[[["\u003cp\u003eML Kit's Smart Reply API automatically generates relevant replies to messages, aiding quick responses and assisting devices with limited input.\u003c/p\u003e\n"],["\u003cp\u003eThe on-device model processes conversation history locally to provide quick replies without sending data to a remote server, prioritizing user privacy.\u003c/p\u003e\n"],["\u003cp\u003eSmart Reply is designed for casual English conversations and may not be suitable for all contexts; feedback on inappropriate suggestions is encouraged for model improvement.\u003c/p\u003e\n"],["\u003cp\u003eThe model analyzes up to 10 recent messages, identifies English language, filters sensitive topics, and offers up to 3 suggestions based on confidence levels.\u003c/p\u003e\n"]]],[],null,["With ML Kit's smart reply API, you can automatically generate relevant\nreplies to messages. Smart reply helps your users respond to messages quickly,\nand makes it easier to reply to messages on devices with limited input\ncapabilities.\n\n[iOS](/ml-kit/language/smart-reply/ios)\n[Android](/ml-kit/language/smart-reply/android)\n\nKey capabilities\n\n- The smart reply model generates reply suggestions based on the full context of a conversation, not just a single message. This means the suggestions are more helpful to your users.\n- The on-device model generates replies quickly and doesn't require you to send users' messages to a remote server.\n\nLimitations\n\n- Smart reply is intended for casual conversations in consumer apps. Reply suggestions might not be appropriate for other contexts or audiences.\n- Currently, only English is supported. The model automatically identifies the language being used and only provides suggestions when it's English.\n\nHow the model works\n\n- The model uses up to 10 of the most recent messages from a conversation history to generate reply suggestions.\n- It detects the language of the conversation and only attempts to provide responses when the language is determined to be English.\n- The model compares the messages against a list of sensitive topics and won't provide suggestions when it detects a sensitive topic.\n- If the language is determined to be English and no sensitive topics are detected, the model provides up to three suggested responses. The number of responses depends on how many meet a sufficient level of confidence based on the input to the model.\n\nProvide feedback\n\nDue to the complexity of natural language processing, the suggestions provided\nby the model may not be appropriate for all contexts or audiences. If you\nencounter inappropriate reply suggestions, reach out to\n[ML Kit support](/ml-kit/community). Your feedback\nhelps to improve the model and the filters for sensitive topics.\n\nExample results\n\nInput\n\n| Timestamp | User ID | Local User? | Message |\n|------------------------------|---------|-------------|----------------------|\n| Thu Feb 21 13:13:39 PST 2019 | | true | are you on your way? |\n| Thu Feb 21 13:15:03 PST 2019 | FRIEND0 | false | Running late, sorry! |\n\nSuggested replies\n\n| Suggestion #1 | Suggestion #2 | Suggestion #3 |\n|---------------|---------------|---------------|\n| No worries | 😞 | No problem! |"]]