diff --git a/tools/send_message_tool.py b/tools/send_message_tool.py index a2321c2e..e282f4c2 100644 --- a/tools/send_message_tool.py +++ b/tools/send_message_tool.py @@ -556,6 +556,21 @@ async def _send_to_platform(platform, pconfig, chat_id, message, thread_id=None, last_result = result return last_result + # --- Yuanbao: native media attachment support via running gateway adapter --- + if platform == Platform.YUANBAO and media_files: + last_result = None + for i, chunk in enumerate(chunks): + is_last = (i == len(chunks) - 1) + result = await _send_yuanbao( + chat_id, + chunk, + media_files=media_files if is_last else None, + ) + if isinstance(result, dict) and result.get("error"): + return result + last_result = result + return last_result + # --- Non-media platforms --- if media_files and not message.strip(): return { @@ -599,6 +614,8 @@ async def _send_to_platform(platform, pconfig, chat_id, message, thread_id=None, result = await _send_bluebubbles(pconfig.extra, chat_id, chunk) elif platform == Platform.QQBOT: result = await _send_qqbot(pconfig, chat_id, chunk) + elif platform == Platform.YUANBAO: + result = await _send_yuanbao(chat_id, chunk) else: result = {"error": f"Direct sending not yet implemented for {platform.value}"}