소스 검색

空指针判断

jiayongqiang 7 시간 전
부모
커밋
0b8139be7b
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      agent/src/agent/api_outter.py

+ 1 - 1
agent/src/agent/api_outter.py

@@ -184,7 +184,7 @@ async def run_ai_pipeline(log_id: str, tag_category_id: str, phrase: str, instuc
             if not result or len(result) == 0:
                 result = vector_similarity_search(phrase)
             # step3: LLM 打标
-            if result:
+            if result and len(result) > 0:
                 try:
                     tags = dao.query_dict(""" select id,tag_nm as tag_name,tag_code, tag_path,category_id,tag_prompt from aitag_tag_info where id in %s """, (tuple(result),))
                     logger.info(f"筛选结果: {tags}")