| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Co-authored-by: binarywang <1343140+binarywang@users.noreply.github.com>
There was a problem hiding this comment.
本 PR 为小程序客服消息 API 添加了 aimsgcontext 字段支持,使得开发者可以在回复消息时关联之前的消息 ID 作为 AI 对话上下文。这是根据微信官方文档更新新增的功能字段,该字段为可选字段,不影响现有代码的向后兼容性。
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/WxMaKefuMessage.java | 新增 AiMsgContext 内部类和 aiMsgContext 字段,使用 Gson 注解支持 JSON 序列化 |
| weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/builder/BaseBuilder.java | 在基础构建器中添加 aiMsgContextMsgId 字段和对应的链式设置方法,并在 build() 方法中条件性创建 AiMsgContext 对象 |
| weixin-java-miniapp/src/test/java/cn/binarywang/wx/miniapp/bean/WxMaKefuMessageTest.java | 添加测试方法验证带有 aimsgcontext 字段的消息序列化为正确的 JSON 格式 |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
根据微信官方文档更新,小程序客服消息API新增了 aimsgcontext 字段用于AI消息上下文关联。
变更内容
使用示例
生成JSON:
{ "touser": "OPENID", "msgtype": "text", "text": {"content": "根据您的问题..."}, "aimsgcontext": {"msgid": "MSG_ID_123"} }字段可选,向后兼容现有代码。
参考
https://developers.weixin.qq.com/doc/subscription/api/customer/message/api_sendcustommessage.html#Body-aimsgcontext-Object-Payload
Original prompt💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.