jihuaqiang 3 days ago
parent
commit
bb974d0ec8
2 changed files with 5 additions and 5 deletions
  1. 1 1
      tools/agent_tools.py
  2. 4 4
      tools/indentify/image_identifier.py

+ 1 - 1
tools/agent_tools.py

@@ -18,7 +18,7 @@ class QueryDataTool:
 
     @staticmethod
     def fetch_crawl_data_list(request_id: str) -> List[Dict[str, Any]]:
-        sql = "SELECT * FROM knowledge_crawl_content WHERE request_id = %s ORDER BY id ASC"
+        sql = "SELECT content_id, crawl_data FROM knowledge_crawl_content WHERE request_id = %s ORDER BY id ASC"
         rows = MysqlHelper.get_values(sql, (request_id,))
         if not rows:
             logger.info(f"request_id={request_id} 未查询到数据,使用默认值")

+ 4 - 4
tools/indentify/image_identifier.py

@@ -75,7 +75,7 @@ class ImageIdentifier:
             response = self.model.generate_content([prompt, image])
             
             return {
-                "text_content": response.text,
+                "content": response.text,
                 "success": True
             }
             
@@ -101,8 +101,8 @@ class ImageIdentifier:
                 image = self.download_image(image_url)
                 if image is None:
                     results.append({
-                        "image_url": image_url,
-                        "text_content": "",
+                        "url": image_url,
+                        "content": "",
                         "success": False,
                         "error": "图片下载失败"
                     })
@@ -110,7 +110,7 @@ class ImageIdentifier:
                 
                 # 分析图片
                 result = self.analyze_image_with_gemini(image)
-                result["image_url"] = image_url
+                result["url"] = image_url
                 results.append(result)
                 
                 # 添加延迟避免API限制