Polyv Live Watch AI SDK
Updated: 2026-01-19 09:16:42
The Polyv Live Watch AI SDK provides AI features such as intelligent conversation, smart outlines, subtitle parsing, and interactive quizzes, helping developers quickly build intelligent live streaming viewing experiences.
Features
| Module | Feature | Description |
|---|---|---|
| Core Module | PolyvWatchAICore | SDK core entry, manages all feature modules |
| AI Assistant | AIAssistantModule | Intelligent conversation, supports streaming responses and digital humans |
| AI Summary | AISummaryModule | Smart outlines, subtitle parsing, interactive quizzes |
SDK Composition
@polyv/live-watch-ai-sdk
Core SDK, provides pure JavaScript/TypeScript logic layer.
- Installation:
pnpm add @polyv/live-watch-ai-sdk - Documentation: SDK Usage Guide
- API Reference: Feature Overview page for each module
@polyv/live-watch-ai-ui
Companion UI component library, based on Vue 2.7, ready-to-use components.
- Installation:
pnpm add @polyv/live-watch-ai-ui - Documentation: UI Usage Guide
- Dependencies: Requires installation of
vue@^2.7.16and@polyv/live-watch-ai-sdk
Quick Start
1. Install Dependencies
# 安装核心 SDK
pnpm add @polyv/live-watch-ai-sdk
# 安装 UI 组件库(可选)
pnpm add @polyv/live-watch-ai-ui vue@^2.7.16
2. Initialize SDK
import { PolyvWatchAICore } from '@polyv/live-watch-ai-sdk';
const aiCore = new PolyvWatchAICore({
domainInfo: {
polyvApiDomain: 'https://api.polyv.net',
},
getViewerToken: () => ({ viewerToken: 'your-token' }),
getChatToken: () => ({ chatToken: 'your-token' }),
getChannelInfo: () => ({ channelId: '123456' }),
getUserInfo: () => ({ userId: 'user-123', nick: '用户', pic: '' }),
});
3. Use Feature Modules
// 使用 AI 助手
aiCore.aiAssistant.setupAIAssistant({ aiAssistantCode: 'code' });
await aiCore.aiAssistant.sendAIQuestionMsg({ content: '你好' });
// 使用 AI 总结
const outline = await aiCore.aiSummary.getPlaybackOutline({ id: 'video-123', type: 'playback' });
