feat: add media message support in agent context and message tool

Cherry-picked from PR #2355 (ad128a7) — only agent/context.py and agent/tools/message.py.

Co-Authored-By: qulllee <qullkui@tencent.com>
This commit is contained in:
qulllee
2026-03-23 09:09:25 +08:00
committed by Xubin Ren
parent ebc4c2ec35
commit bc9f861bb1

View File

@@ -42,7 +42,12 @@ class MessageTool(Tool):
@property
def description(self) -> str:
return "Send a message to the user. Use this when you want to communicate something."
return (
"Send a message to the user, optionally with file attachments. "
"This is the ONLY way to deliver files (images, documents, audio, video) to the user. "
"Use the 'media' parameter with file paths to attach files. "
"Do NOT use read_file to send files — that only reads content for your own analysis."
)
@property
def parameters(self) -> dict[str, Any]: