Commit 7a1ad569 authored by Yaowentong's avatar Yaowentong

ai调用 空摘要不调用

parent 8cceaeeb
...@@ -689,10 +689,14 @@ def ai_get_brand_sentiment_and_mentions_by_articles(brand_name, article_list, ba ...@@ -689,10 +689,14 @@ def ai_get_brand_sentiment_and_mentions_by_articles(brand_name, article_list, ba
source_id = item.get("sourceId") source_id = item.get("sourceId")
if source_id is None: if source_id is None:
continue continue
snippet = item.get("snippet")
# 空值、非字符串、纯空格都不进入大模型
if not isinstance(snippet, str) or not snippet.strip():
continue
normalized_articles.append({ normalized_articles.append({
"sourceId": str(source_id), "sourceId": str(source_id),
"snippet": item.get("snippet", "") or "" "snippet": snippet.strip()
}) })
if not normalized_articles: if not normalized_articles:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment