You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
1005 B
35 lines
1005 B
"""
|
|
测试分类点击功能
|
|
"""
|
|
|
|
import asyncio
|
|
from ai_agent import get_creative_guidance
|
|
|
|
|
|
async def test_category():
|
|
"""测试不同分类"""
|
|
|
|
categories = ["校园", "美食", "游戏", "全部"]
|
|
|
|
for category in categories:
|
|
print("=" * 80)
|
|
print(f"测试分类: {category}")
|
|
print("=" * 80)
|
|
|
|
result = await get_creative_guidance(category=category)
|
|
|
|
if result["success"]:
|
|
print(f"✓ 成功获取数据")
|
|
print(f" - 分类: {result['category']}")
|
|
print(f" - 视频数量: {result['total_count']}")
|
|
if result['total_count'] > 0:
|
|
print(f" - 第一个视频作者: {result['videos'][0]['author']}")
|
|
print(f" - 第一个视频描述: {result['videos'][0]['description'][:50]}...")
|
|
else:
|
|
print(f"✗ 获取失败: {result.get('error')}")
|
|
|
|
print()
|
|
|
|
|
|
if __name__ == "__main__":
|
|
asyncio.run(test_category())
|
|
|