串接 AI 洞察向量化與漏通知入口
All checks were successful
CD Pipeline / deploy (push) Successful in 1m13s

This commit is contained in:
OoO
2026-04-29 23:05:46 +08:00
parent f0e044aa48
commit 0c2e9bbced
10 changed files with 166 additions and 8 deletions

View File

@@ -53,6 +53,15 @@ def _enqueue_embedding(target_table: str, target_id: int, text_content: str,
session.close()
def enqueue_insight_embedding(insight_id: int, insight_type: str, content: str,
period: str = None) -> bool:
"""Public bridge for legacy raw ai_insights inserts to join ADR-007 embedding queue."""
if not insight_id or not content:
return False
embed_target_text = f"{insight_type} ({period or ''}): {content}"
return _enqueue_embedding("ai_insights", int(insight_id), embed_target_text)
def _process_one_embedding(row_id: int, target_table: str, target_id: int,
text_content: str, model: str) -> bool:
"""處理單筆 embedding成功寫回目標表失敗累加 attempts"""