fix: save_tags.dspy uuid→getID(16),DSPY禁止import,改用预置getID

This commit is contained in:
ymq 2026-08-07 16:31:57 +08:00
parent 417ea70a34
commit 608be82e68

View File

@ -1,5 +1,3 @@
import uuid
ns = params_kw.copy() ns = params_kw.copy()
kb_id = ns.get('kb_id', '') kb_id = ns.get('kb_id', '')
doc_id = ns.get('media_id', '') doc_id = ns.get('media_id', '')
@ -33,7 +31,7 @@ else:
removed += 1 removed += 1
for tid in wanted_ids: for tid in wanted_ids:
if tid not in current: if tid not in current:
mt_id = uuid.uuid4().hex[:16] mt_id = getID(16)
await sor.sqlExe( await sor.sqlExe(
"INSERT INTO media_tags (id, kb_id, media_type, media_id, tag_id, created_at) " "INSERT INTO media_tags (id, kb_id, media_type, media_id, tag_id, created_at) "
"VALUES (${id}$, ${kb_id}$, 'document', ${mid}$, ${tid}$, NOW())", "VALUES (${id}$, ${kb_id}$, 'document', ${mid}$, ${tid}$, NOW())",