chore: update gitignore; feat: 新增customer_agent业务模块与api路由

This commit is contained in:
2026-09-11 11:02:15 +08:00
parent 5915319f9f
commit 2004b8fcf4
59 changed files with 3527 additions and 18 deletions
+19
View File
@@ -0,0 +1,19 @@
"""Milvus knowledge-document deletion helpers."""
from __future__ import annotations
from rag.milvus_collections import KNOWLEDGE_COLLECTIONS
from config.database.milvus import client as configured_milvus_client
def _escape_filter_value(value: str) -> str:
return value.replace("\\", "\\\\").replace('"', '\\"')
async def delete_document_vectors(doc_id: str, *, milvus_client=None) -> None:
"""Delete every knowledge chunk with ``doc_id`` from project collections."""
if not doc_id or not doc_id.strip():
raise ValueError("doc_id must not be empty")
client = milvus_client or configured_milvus_client()
expression = f'doc_id == "{_escape_filter_value(doc_id)}"'
for collection_name in KNOWLEDGE_COLLECTIONS:
await client.delete(collection_name=collection_name, filter=expression)