2c42ebe01c
- Removed deprecated user_info files and paths from configuration. - Added user soil data integration in chat context to improve response accuracy. - Updated build_rag_context and chat_rag_stream functions to include sensor_uuid for user-specific data retrieval. - Enhanced load_sources function to load user data from the database. - Implemented filtering in search_with_query and QdrantVectorStore to isolate user data based on sensor_uuid. - Introduced Celery Beat schedule for periodic user data ingestion.
18 lines
489 B
Python
18 lines
489 B
Python
"""
|
|
تسکهای Celery برای RAG
|
|
"""
|
|
from config.celery import app
|
|
|
|
from .ingest import ingest
|
|
|
|
|
|
@app.task
|
|
def rag_ingest_task(recreate: bool = True):
|
|
"""
|
|
embed و ذخیره دیتای همه کاربران در Qdrant.
|
|
هر چند ساعت یکبار اجرا شود (از طریق Celery Beat).
|
|
recreate=True: collection از نو ساخته میشود تا دیتای قدیمی حذف شود.
|
|
"""
|
|
result = ingest(recreate=recreate)
|
|
return result
|