From aa9ce6955b18574cc920907703fa22654c1078d4 Mon Sep 17 00:00:00 2001 From: ZHANG RUI Date: Sat, 28 Feb 2026 15:29:51 +0800 Subject: [PATCH] Update pkg/channels/wecom/aibot.go Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- pkg/channels/wecom/aibot.go | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/pkg/channels/wecom/aibot.go b/pkg/channels/wecom/aibot.go index 7b0470b40..d26ed9066 100644 --- a/pkg/channels/wecom/aibot.go +++ b/pkg/channels/wecom/aibot.go @@ -93,21 +93,24 @@ type WeComAIBotMessage struct { } `json:"event,omitempty"` } +// WeComAIBotStreamInfo represents the detailed stream content in streaming responses +type WeComAIBotStreamInfo struct { + ID string `json:"id"` + Finish bool `json:"finish"` + Content string `json:"content,omitempty"` + MsgItem []struct { + MsgType string `json:"msgtype"` + Image *struct { + Base64 string `json:"base64"` + MD5 string `json:"md5"` + } `json:"image,omitempty"` + } `json:"msg_item,omitempty"` +} + // WeComAIBotStreamResponse represents the streaming response format type WeComAIBotStreamResponse struct { - MsgType string `json:"msgtype"` - Stream struct { - ID string `json:"id"` - Finish bool `json:"finish"` - Content string `json:"content,omitempty"` - MsgItem []struct { - MsgType string `json:"msgtype"` - Image *struct { - Base64 string `json:"base64"` - MD5 string `json:"md5"` - } `json:"image,omitempty"` - } `json:"msg_item,omitempty"` - } `json:"stream"` + MsgType string `json:"msgtype"` + Stream WeComAIBotStreamInfo `json:"stream"` } // WeComAIBotEncryptedResponse represents the encrypted response wrapper