mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-25 00:51:20 +00:00
feat(agent): add PLATFORM_HINTS for matrix, mattermost, and feishu (#14428)
* feat(agent): add PLATFORM_HINTS for matrix, mattermost, and feishu These platform adapters fully support media delivery (send_image, send_document, send_voice, send_video) but were missing from PLATFORM_HINTS, leaving agents unaware of their platform context, markdown rendering, and MEDIA: tag support. Salvaged from PR #7370 by Rutimka — wecom excluded since main already has a more detailed version. Co-Authored-By: Marco Rutsch <marco@rutimka.de> * test: add missing Markdown assertion for feishu platform hint --------- Co-authored-by: Marco Rutsch <marco@rutimka.de>
This commit is contained in:
parent
88b6eb9ad1
commit
d1ce358646
2 changed files with 44 additions and 0 deletions
|
|
@ -370,6 +370,32 @@ PLATFORM_HINTS = {
|
||||||
"MEDIA:/absolute/path/to/file in your response. Images (.jpg, .png, "
|
"MEDIA:/absolute/path/to/file in your response. Images (.jpg, .png, "
|
||||||
".heic) appear as photos and other files arrive as attachments."
|
".heic) appear as photos and other files arrive as attachments."
|
||||||
),
|
),
|
||||||
|
"mattermost": (
|
||||||
|
"You are in a Mattermost workspace communicating with your user. "
|
||||||
|
"Mattermost renders standard Markdown — headings, bold, italic, code "
|
||||||
|
"blocks, and tables all work. "
|
||||||
|
"You can send media files natively: include MEDIA:/absolute/path/to/file "
|
||||||
|
"in your response. Images (.jpg, .png, .webp) are uploaded as photo "
|
||||||
|
"attachments, audio and video as file attachments. "
|
||||||
|
"Image URLs in markdown format  are rendered as inline previews automatically."
|
||||||
|
),
|
||||||
|
"matrix": (
|
||||||
|
"You are in a Matrix room communicating with your user. "
|
||||||
|
"Matrix renders Markdown — bold, italic, code blocks, and links work; "
|
||||||
|
"the adapter converts your Markdown to HTML for rich display. "
|
||||||
|
"You can send media files natively: include MEDIA:/absolute/path/to/file "
|
||||||
|
"in your response. Images (.jpg, .png, .webp) are sent as inline photos, "
|
||||||
|
"audio (.ogg, .mp3) as voice/audio messages, video (.mp4) inline, "
|
||||||
|
"and other files as downloadable attachments."
|
||||||
|
),
|
||||||
|
"feishu": (
|
||||||
|
"You are in a Feishu (Lark) workspace communicating with your user. "
|
||||||
|
"Feishu renders Markdown in messages — bold, italic, code blocks, and "
|
||||||
|
"links are supported. "
|
||||||
|
"You can send media files natively: include MEDIA:/absolute/path/to/file "
|
||||||
|
"in your response. Images (.jpg, .png, .webp) are uploaded and displayed "
|
||||||
|
"inline, audio files as voice messages, and other files as attachments."
|
||||||
|
),
|
||||||
"weixin": (
|
"weixin": (
|
||||||
"You are on Weixin/WeChat. Markdown formatting is supported, so you may use it when "
|
"You are on Weixin/WeChat. Markdown formatting is supported, so you may use it when "
|
||||||
"it improves readability, but keep the message compact and chat-friendly. You can send media files natively: "
|
"it improves readability, but keep the message compact and chat-friendly. You can send media files natively: "
|
||||||
|
|
|
||||||
|
|
@ -807,6 +807,24 @@ class TestPromptBuilderConstants:
|
||||||
# check that this test is calibrated correctly).
|
# check that this test is calibrated correctly).
|
||||||
assert "include MEDIA:" in PLATFORM_HINTS["telegram"]
|
assert "include MEDIA:" in PLATFORM_HINTS["telegram"]
|
||||||
|
|
||||||
|
def test_platform_hints_mattermost(self):
|
||||||
|
hint = PLATFORM_HINTS["mattermost"]
|
||||||
|
assert "Mattermost" in hint
|
||||||
|
assert "MEDIA:" in hint
|
||||||
|
assert "Markdown" in hint
|
||||||
|
|
||||||
|
def test_platform_hints_matrix(self):
|
||||||
|
hint = PLATFORM_HINTS["matrix"]
|
||||||
|
assert "Matrix" in hint
|
||||||
|
assert "MEDIA:" in hint
|
||||||
|
assert "Markdown" in hint
|
||||||
|
|
||||||
|
def test_platform_hints_feishu(self):
|
||||||
|
hint = PLATFORM_HINTS["feishu"]
|
||||||
|
assert "Feishu" in hint
|
||||||
|
assert "MEDIA:" in hint
|
||||||
|
assert "Markdown" in hint
|
||||||
|
|
||||||
|
|
||||||
# =========================================================================
|
# =========================================================================
|
||||||
# Environment hints
|
# Environment hints
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue