analyze_topic_trend
Analyze how a topic's popularity evolves, detect sudden spikes, and forecast future trends using multiple analytical modes.
Instructions
统一话题趋势分析工具 - 整合多种趋势分析模式
Args: topic: 话题关键词(必需) analysis_type: 分析类型,可选值: - "trend": 热度趋势分析(追踪话题的热度变化) - "lifecycle": 生命周期分析(从出现到消失的完整周期) - "viral": 异常热度检测(识别突然爆火的话题) - "predict": 话题预测(预测未来可能的热点) date_range: 日期范围(trend和lifecycle模式),可选 - 格式: {"start": "YYYY-MM-DD", "end": "YYYY-MM-DD"}(必须是标准日期格式) - 说明: AI必须根据当前日期自动计算并填入具体日期,不能使用"今天"等自然语言 - 计算示例: - 用户说"最近7天" → AI计算: {"start": "2025-11-11", "end": "2025-11-17"}(假设今天是11-17) - 用户说"上周" → AI计算: {"start": "2025-11-11", "end": "2025-11-17"}(上周一到上周日) - 用户说"本月" → AI计算: {"start": "2025-11-01", "end": "2025-11-17"}(11月1日到今天) - 默认: 不指定时默认分析最近7天 granularity: 时间粒度(trend模式),默认"day"(仅支持 day,因为底层数据按天聚合) threshold: 热度突增倍数阈值(viral模式),默认3.0 time_window: 检测时间窗口小时数(viral模式),默认24 lookahead_hours: 预测未来小时数(predict模式),默认6 confidence_threshold: 置信度阈值(predict模式),默认0.7
Returns: JSON格式的趋势分析结果
AI使用说明: 当用户使用相对时间表达时(如"最近7天"、"过去一周"、"上个月"), AI必须根据当前日期(从环境 获取)计算出具体的 YYYY-MM-DD 格式日期。
重要:date_range 不接受"今天"、"昨天"等自然语言,必须是 YYYY-MM-DD 格式!
Examples (假设今天是 2025-11-17): - 用户:"分析AI最近7天的趋势" → analyze_topic_trend(topic="人工智能", analysis_type="trend", date_range={"start": "2025-11-11", "end": "2025-11-17"}) - 用户:"看看特斯拉本月的热度" → analyze_topic_trend(topic="特斯拉", analysis_type="lifecycle", date_range={"start": "2025-11-01", "end": "2025-11-17"}) - analyze_topic_trend(topic="比特币", analysis_type="viral", threshold=3.0) - analyze_topic_trend(topic="ChatGPT", analysis_type="predict", lookahead_hours=6)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| topic | Yes | ||
| threshold | No | ||
| date_range | No | ||
| granularity | No | day | |
| time_window | No | ||
| analysis_type | No | trend | |
| lookahead_hours | No | ||
| confidence_threshold | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |