这是一个批量整理提交,包含以下主要改动: 1. 删除多处冗余的空行和未使用的导入 2. 修复文件末尾缺少换行符的问题 3. 调整部分模块的导入顺序与代码排版 4. 修复部分配置默认值与策略逻辑 5. 新增多个功能模块与辅助工具 6. 完善异常处理与日志记录 7. 修复速率限制、消息缓存、权限校验等逻辑bug 8. 废弃部分旧有API与配置项并添加警告提示
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"
|
|
"- 单条消息限制 4000 字符,长回复请分段发送\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: 4000 characters, split long replies\n"
|
|
"- Interactive components (buttons, cards) are NOT supported\n"
|
|
)
|