调整rag_snippet表字段格式
This commit is contained in:
@ -435,6 +435,8 @@ def merge_snippet_records_from_db(
|
||||
for alias_id, alias_info in alias_map.items():
|
||||
if alias_id in seen_ids:
|
||||
continue
|
||||
if alias_action_id is None and snippet_action_id is None:
|
||||
continue
|
||||
merged.append(
|
||||
{
|
||||
"id": alias_id,
|
||||
@ -520,11 +522,14 @@ def _prepare_rag_payloads(
|
||||
else:
|
||||
updated_at = updated_at_raw if isinstance(updated_at_raw, datetime) else now
|
||||
|
||||
created_at = updated_at
|
||||
|
||||
row = {
|
||||
"rag_item_id": rag_item_id,
|
||||
"workspace_id": workspace_id,
|
||||
"table_id": table_id,
|
||||
"version_ts": version_ts,
|
||||
"created_at": created_at,
|
||||
"action_result_id": action_result_id,
|
||||
"snippet_id": snippet_id,
|
||||
"rag_text": rag_text,
|
||||
@ -557,6 +562,7 @@ def _upsert_rag_snippet_rows(engine: Engine, rows: Sequence[Dict[str, Any]]) ->
|
||||
workspace_id,
|
||||
table_id,
|
||||
version_ts,
|
||||
created_at,
|
||||
action_result_id,
|
||||
snippet_id,
|
||||
rag_text,
|
||||
@ -567,6 +573,7 @@ def _upsert_rag_snippet_rows(engine: Engine, rows: Sequence[Dict[str, Any]]) ->
|
||||
:workspace_id,
|
||||
:table_id,
|
||||
:version_ts,
|
||||
:created_at,
|
||||
:action_result_id,
|
||||
:snippet_id,
|
||||
:rag_text,
|
||||
|
||||
Reference in New Issue
Block a user