This commit is contained in:
@@ -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"""
|
||||
|
||||
Reference in New Issue
Block a user