← Back to Pull requests

feature: add `ShortVideo` message support #2739

Closed
unknown closed this pull request without merging on Aug 20, 2023 10:41 UTC
View on GitHub
unknown unknown commented on Jul 17, 2023 04:29 UTC
Author

close #867, #1664, #2011, partially #2621

---

短视频消息 ShortVideo

短视频消息,指的是可在聊天界面在线播放的视频消息,而非在群文件上传的视频文件.

短视频消息分为 OnlineShortVideo 与 OfflineShortVideo. 在本地上传的短视频为 OfflineShortVideo. 从服务器接收的短视频为 OnlineShortVideo.

最推荐存储的方式是下载视频文件,每次都通过上传该文件获取视频消息.
在上传视频时服务器会根据缓存情况选择回复已有视频 ID 或要求客户端上传.

获取短视频消息示例

上传短视频


使用 Contact.uploadShortVideo,将视频缩略图和视频资源ExternalResource 上传以得到 OfflineShortVideo.

使用 Builder 构建短视频


ShortVideo 提供 Builder 构建方式,必须指定 videoId, fileName, fileMd5, fileSize 和 fileFormat 参数.
可选指定 Builder.thumbnailMd5 和 Builder.thumbnailSize. 若不提供,可能会影响服务器判断缓存.

从服务器接收


通过监听消息接收的短视频消息可直接转换为 OnlineShortVideo.

下载视频


通过 OnlineShortVideo.urlForDownload 获取下载链接.
该下载链接不包含短视频的文件信息,可以使用 videoId 或 fileName 作为文件名,fileFormat 作为文件拓展名.

其他信息

mirai 码支持


ShortVideo 不支持 mirai 码,意味着如果通过 mirai 码持久化消息,短视频消息将不会被存储.

Diff: 112 lines (+84 / -28) across 1 files Reviewer: Karlatemp Review duration: 49331m
All Vouch review confidence checks passed
Residual risk 0.14 = Change Risk (0.31) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.31 · 112 lines diff across 1 files
0.31
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
56%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth shallow_review_depth
0.289
Diff Size diff_size
0.283
Real PR Conversation Timeline
1 comments
"Review active on #2739"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 56.8% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 31.3% (LOW) · Higher = larger blast radius
31.3%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 56.8% · Lower = rushed or shallow review
56.8%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 13.5% · Safe to merge
13.5%
Repository