diff --git a/app/summary/service.py b/app/summary/service.py index c222598..601fa75 100644 --- a/app/summary/service.py +++ b/app/summary/service.py @@ -1,5 +1,6 @@ import asyncio import time +from datetime import datetime, timedelta from typing import List from langchain_core.prompts import PromptTemplate @@ -159,7 +160,8 @@ class SummaryService: return result -async def build(): +async def build(day:str): + logger.info(f"执行日期:{day}") db_assistant_mysql_client_manager.init() embedding_client.init() milvus_client.init() @@ -168,7 +170,7 @@ async def build(): archive_messages_repository = ArchiveMessagesRepository(db_assistant) summary_repository = SummaryRepository() service = SummaryService(archive_messages_repository, embedding_client, summary_repository) - await service.get_message_summary("2026-6-11") + await service.get_message_summary(day) finally: await embedding_client.close() await db_assistant_mysql_client_manager.close() @@ -176,5 +178,18 @@ async def build(): if __name__ == '__main__': - asyncio.run(build()) + # + start = datetime(2026, 5, 22) + end = datetime(2026, 6, 14) + + result = [] + temp = start + while temp <= end: + # 按 年-月-日 无补零格式输出 + date_format = f"{temp.year}-{temp.month}-{temp.day}" + result.append(date_format) + temp += timedelta(days=1) + for date in result: + asyncio.run(build(date)) + diff --git a/conf/app_config.yaml b/conf/app_config.yaml index beef847..3fe8535 100644 --- a/conf/app_config.yaml +++ b/conf/app_config.yaml @@ -17,13 +17,13 @@ db_assistant: database: ai_assistant embedding: - host: localhost + host: 8.159.132.53 port: 8081 model: BAAI/bge-large-zh-v1.5 milvus: - host: localhost + host: 8.159.132.53 port: 19530 user: root password: Milvus