优化
This commit is contained in:
parent
586b529933
commit
addbde2e26
@ -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))
|
||||
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user