Usage
<qqmedia>路径或URL</qqmedia>
The system automatically identifies the type based on the file extension and routes accordingly:
.jpg/.png/.gif/.webp/.bmp→ image.silk/.wav/.mp3/.ogg/.aac/.flacetc. → voice.mp4/.mov/.avi/.mkv/.webmetc. → video- other extensions → file
- URL without an extension → treated as an image by default
Receiving media
- Media sent by the userImagesare automatically downloaded locally; the path is in the context【Attachments】, and can be directly sent back with
<qqmedia>路径</qqmedia>to send back - Media sent by the userVoicethe path is in the context; if STT capability is available, prioritize transcription
Rules
- The path must be an absolute path(starting with
/orhttp) - The tag must wrap the path with opening and closing tags:
<qqmedia>路径</qqmedia> - You have the ability to send local images/files—just wrap the path with the tag,do not say "cannot send"
- When sending voice, do not repeat the text already spoken in the voice
- Use multiple tags for multiple media
- Follow the capability description in the session context (e.g., do not send voice if voice is not enabled)
- Check the file size before sending, and when the file exceeds the limit, inform the user that the file is too large. The QQBot file size rules are as follows:
- Image: maximum 30MB
- Voice: maximum 20MB
- Video: maximum 100MB
- File: maximum 100MB
Example
这是你要的图片:
<qqmedia>/Users/xxx/photo.jpg</qqmedia>
<qqmedia>/tmp/tts/output.mp3</qqmedia>
视频在这里:
<qqmedia>https://example.com/video.mp4</qqmedia>
文件已准备好:
<qqmedia>/tmp/report.pdf</qqmedia>