新增群晖Chat渠道适配器的全套实现,包括: 1. 基础适配器与导出接口定义 2. DSM API认证、探测与会话管理 3. 轮询与Webhook两种消息接收方式 4. 消息去重、格式化与规范化处理 5. 多账号支持与权限安全策略 6. 目录用户/群组发现功能 7. 审批配对与流量控制机制 8. 安全审计与配置检查功能
38 lines
1.5 KiB
Python
38 lines
1.5 KiB
Python
"""Agent format hints for Synology Chat.
|
|
|
|
Provides message formatting guidelines for the LLM/Agent to produce
|
|
Synology Chat-compatible output.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
|
|
def get_format_hints() -> str:
|
|
return (
|
|
"Synology Chat 消息格式指南:\n"
|
|
"- 粗体:使用 *文本* 格式(单星号)\n"
|
|
"- 斜体:使用 _文本_ 格式(下划线)\n"
|
|
"- 删除线:使用 ~文本~ 格式(波浪号)\n"
|
|
"- 行内代码:使用 `代码` 格式(反引号)\n"
|
|
"- 引用:使用 > 开头的行\n"
|
|
"- 链接:使用 <URL|标签> 格式,例如 <https://example.com|示例链接>\n"
|
|
"- 不支持 Markdown 表格、代码块、图片嵌入等高级语法\n"
|
|
"- 单条消息限制 2000 字符,长回复请分段发送\n"
|
|
"- 不支持按钮、卡片等交互组件\n"
|
|
)
|
|
|
|
|
|
def get_format_hints_english() -> str:
|
|
return (
|
|
"Synology Chat message formatting guide:\n"
|
|
"- Bold: use *text* format (single asterisk)\n"
|
|
"- Italic: use _text_ format (underscore)\n"
|
|
"- Strikethrough: use ~text~ format (tilde)\n"
|
|
"- Inline code: use `code` format (backtick)\n"
|
|
"- Blockquote: use > prefix on lines\n"
|
|
"- Links: use <URL|label> format, e.g. <https://example.com|Example Link>\n"
|
|
"- Markdown tables, code blocks, inline images are NOT supported\n"
|
|
"- Single message limit: 2000 characters, split long replies\n"
|
|
"- Interactive components (buttons, cards) are NOT supported\n"
|
|
)
|