|
@@ -190,14 +190,13 @@ class ManagerTask:
|
|
|
logger.info("开始执行竞品关键词分析...")
|
|
logger.info("开始执行竞品关键词分析...")
|
|
|
|
|
|
|
|
# 初始化AI服务
|
|
# 初始化AI服务
|
|
|
- llm_service = LiteLLMService(format_type='json')
|
|
|
|
|
|
|
+ # llm_service = LiteLLMService(model='openai/deepseek-reasoner',format_type='json')
|
|
|
|
|
+ llm_service = LiteLLMService(model='openai/deepseek-chat',format_type='json')
|
|
|
analysis_service = AnalysisService(llm_service, self.db_mongo)
|
|
analysis_service = AnalysisService(llm_service, self.db_mongo)
|
|
|
|
|
|
|
|
|
|
|
|
|
# 执行实际分析
|
|
# 执行实际分析
|
|
|
analyze_result, prompt = await analysis_service.execute_analysis(product, dry_run=dry_run)
|
|
analyze_result, prompt = await analysis_service.execute_analysis(product, dry_run=dry_run)
|
|
|
- logger.info(f"提示词:{prompt}")
|
|
|
|
|
- logger.info(f"分析结果: {json.dumps(analyze_result, indent=2, ensure_ascii=False)}")
|
|
|
|
|
|
|
|
|
|
# 转换monthly_searches字段为整数
|
|
# 转换monthly_searches字段为整数
|
|
|
def convert_monthly_searches(value):
|
|
def convert_monthly_searches(value):
|
|
@@ -221,6 +220,8 @@ class ManagerTask:
|
|
|
|
|
|
|
|
# 更新产品分析结果
|
|
# 更新产品分析结果
|
|
|
product.competitor_analyze = AICompetitorAnalyzeMainKeywordsResult(**analyze_result)
|
|
product.competitor_analyze = AICompetitorAnalyzeMainKeywordsResult(**analyze_result)
|
|
|
|
|
+ logger.info(f"提示词:{prompt}")
|
|
|
|
|
+ logger.info(f"分析结果: {product.competitor_analyze.model_dump_json(indent=2)}")
|
|
|
if dry_run:
|
|
if dry_run:
|
|
|
# logger.info(f"{product.competitor_analyze.model_dump_json(indent=2)}")
|
|
# logger.info(f"{product.competitor_analyze.model_dump_json(indent=2)}")
|
|
|
return
|
|
return
|