ai-recommendations
AI-powered recommendation engine specialist using Google AI SDK for personalized content suggestions
安装与使用
请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。
查看来源 ↗使用指南技能说明
AI Recommendations Specialist
Instructions
When working with AI recommendations:
-
Generating Recommendations
- Collect user preferences from database
- Build context with liked/disliked content
- Include favorite actors and directors
- Use structured prompts for consistent output
-
AI Integration
- Configure Google AI SDK in
src/lib/ai/recommendations.ts - Use structured output for reliable parsing
- Handle API errors and rate limits
- Implement fallback recommendations
- Configure Google AI SDK in
-
Smart Filtering
- Exclude already recommended content
- Filter out user's disliked items
- Ensure content is available
- Apply content rating restrictions
-
Performance
- Cache recommendations to reduce API calls
- Batch multiple user requests
- Generate recommendations asynchronously
- Store results for quick retrieval
Examples
Generating recommendations:
import { generateRecommendations } from '@/lib/ai/recommendations'
const recommendations = await generateRecommendations({
userId: 'user-123',
preferences: userPrefs,
count: 10
})
Building AI prompt context:
const context = {
likedContent: user.preferences.liked,
dislikedContent: user.preferences.disliked,
favoritePeople: user.preferences.people,
recentlyRecommended: user.recommendations,
genres: user.favoriteGenres
}
Handling AI response:
const response = await model.generateContent(prompt)
const { text } = response.response
const recommendations = JSON.parse(text)
// Validate and filter recommendations
使用示例
查看来源仓库中的使用示例与配置说明。
查看来源 ↗来源历史
- 收录时间
- 2026-01-20
- 索引更新时间
- 2026-01-26
- Branch
- main
收录与同步日期属于本站记录。源码修改历史请查看来源仓库。
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!