Browse Source

Merge branch 'main' of https://git.yishihui.com/ai/knowledge

jihuaqiang 4 hours ago
parent
commit
cb8d942887
5 changed files with 9 additions and 7 deletions
  1. 2 2
      .gitignore
  2. 2 2
      config.py
  3. 2 1
      evaluate/evaluate.py
  4. 2 2
      evaluate/start_evaluate.sh
  5. 1 0
      structure/structure_scheduler.pid

+ 2 - 2
.gitignore

@@ -288,7 +288,7 @@ pyrightconfig.json
 
 # custom
 myenv/
+*.pid
 
 
-
-# End of https://www.toptal.com/developers/gitignore/api/python,pycharm
+# End of https://www.toptal.com/developers/gitignore/api/python,pycharm

+ 2 - 2
config.py

@@ -5,5 +5,5 @@ FEISHU_APP_ID="cli_a76c35b8fa7d500c"
 FEISHU_APP_SECRET="xHpF7H9nBwXeCH2Z1YRDScWSXzyktq36"
 
 
-# Gemini 配置
-GEMINI_API_KEY = "AIzaSyC0J8gtl5I6-nu6fgvQrfnWkw0QIzfXEWE"
+# Gemini 配置  (付费账号)
+GEMINI_API_KEY = "AIzaSyAkt1l9Kw1CQgHFzTpla0vgt0OE53fr-BI"

+ 2 - 1
evaluate/evaluate.py

@@ -45,7 +45,7 @@ class EvaluateProcessor:
                              source_type: Optional[str], 
                              source_channel: Optional[str]) -> Tuple[str, Tuple]:
         """构建查询条件和参数"""
-        conditions = ["a.structured_data is not null", "b.score is null"]
+        conditions = ["a.structured_data is not null", "b.score is null", "c.category_id = 0"]
         params = []
         
         if query_word is not None:
@@ -75,6 +75,7 @@ class EvaluateProcessor:
                     SELECT a.id, a.query_word, a.structured_data 
                     FROM knowledge_search_content a
                     left join knowledge_content_evaluate b on a.id = b.search_content_id
+                    LEFT JOIN knowledge_content_query c ON a.query_word = c.query_word
                     WHERE {where_clause}
                     LIMIT 1
                 """

+ 2 - 2
evaluate/start_evaluate.sh

@@ -18,8 +18,8 @@ if ! command -v python3 &> /dev/null; then
 fi
 
 # 检查依赖文件
-if [ ! -f "evaluate_processor.py" ]; then
-    echo "错误: 未找到evaluate_processor.py文件"
+if [ ! -f "evaluate.py" ]; then
+    echo "错误: 未找到evaluate.py文件"
     exit 1
 fi
 

+ 1 - 0
structure/structure_scheduler.pid

@@ -0,0 +1 @@
+93916