diff --git a/tools/send_message_tool.py b/tools/send_message_tool.py index 0ad30d6dcb..b4de998fe5 100644 --- a/tools/send_message_tool.py +++ b/tools/send_message_tool.py @@ -588,11 +588,28 @@ async def _send_to_platform(platform, pconfig, chat_id, message, thread_id=None, last_result = result return last_result + # --- Feishu: native media attachment support via adapter --- + if platform == Platform.FEISHU and media_files: + last_result = None + for i, chunk in enumerate(chunks): + is_last = (i == len(chunks) - 1) + result = await _send_feishu( + pconfig, + chat_id, + chunk, + media_files=media_files if is_last else None, + thread_id=thread_id, + ) + 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 { "error": ( - f"send_message MEDIA delivery is currently only supported for telegram, discord, matrix, weixin, signal and yuanbao; " + f"send_message MEDIA delivery is currently only supported for telegram, discord, matrix, weixin, signal, yuanbao and feishu; " f"target {platform.value} had only media attachments" ) } @@ -600,7 +617,7 @@ async def _send_to_platform(platform, pconfig, chat_id, message, thread_id=None, if media_files: warning = ( f"MEDIA attachments were omitted for {platform.value}; " - "native send_message media delivery is currently only supported for telegram, discord, matrix, weixin, signal and yuanbao" + "native send_message media delivery is currently only supported for telegram, discord, matrix, weixin, signal, yuanbao and feishu" ) last_result = None