33 lines
1.2 KiB
Python
33 lines
1.2 KiB
Python
|
|
from __future__ import annotations
|
||
|
|
|
||
|
|
|
||
|
|
def build_session_key(agent_id: str, account_id: str, user_id: str) -> str:
|
||
|
|
return f"agent:{agent_id}:synology-chat:{account_id}:direct:{user_id}"
|
||
|
|
|
||
|
|
|
||
|
|
CHANNEL_FORMAT_INSTRUCTIONS = """
|
||
|
|
### Synology Chat Formatting
|
||
|
|
Synology Chat supports limited formatting. Use these patterns:
|
||
|
|
|
||
|
|
**Links**: Use <URL|display text> to create clickable links.
|
||
|
|
Example: <https://example.com|Click here> renders as a clickable link.
|
||
|
|
Markdown links [label](url) are automatically converted to <URL|label> format.
|
||
|
|
|
||
|
|
**File sharing**: Include a publicly accessible URL to share files or images.
|
||
|
|
The NAS will download and attach the file (max 32 MB).
|
||
|
|
|
||
|
|
**Interactive buttons**: Bot can send action buttons via attachments.
|
||
|
|
Supported button styles: green, grey, red, orange, blue, teal.
|
||
|
|
|
||
|
|
**Limitations**:
|
||
|
|
- No markdown, bold, italic, or code blocks
|
||
|
|
- No message editing after send
|
||
|
|
- Keep messages under 2000 characters for best readability
|
||
|
|
|
||
|
|
**Best practices**:
|
||
|
|
- Use short, clear responses (Synology Chat has a minimal UI)
|
||
|
|
- Use line breaks to separate sections
|
||
|
|
- Use numbered or bulleted lists for clarity
|
||
|
|
- Wrap URLs with <URL|label> for user-friendly links
|
||
|
|
"""
|