feat(core): initial commit unified architecture (scud_ai v2.5 with modular web_api)
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import os
|
||||
from core.database import get_all_rules_from_db, add_rule_to_db
|
||||
|
||||
|
||||
def load_knowledge_base():
|
||||
"""
|
||||
Загружает актуальные правила Базы Знаний компании напрямую из базы данных SQLite.
|
||||
"""
|
||||
rules = get_all_rules_from_db()
|
||||
return {
|
||||
"rules": rules if rules else [],
|
||||
"fio_corrections": {}
|
||||
}
|
||||
|
||||
|
||||
def add_rule_to_kb(new_rule):
|
||||
"""
|
||||
Добавляет новое принятое человеком правило в SQLite таблицу ai_knowledge_base.
|
||||
"""
|
||||
if not new_rule or not new_rule.strip():
|
||||
return
|
||||
add_rule_to_db(new_rule.strip(), added_by="Human")
|
||||
print(f"[✓] База знаний SQLite успешно обновлена! Новое правило: {new_rule.strip()}")
|
||||
Reference in New Issue
Block a user