Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions tools/send_message_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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}"}

Expand Down
Loading