feat: milvus0.1s延迟初始化,添加langgraph/setup接口

This commit is contained in:
martsforever
2025-12-08 20:40:48 +08:00
parent 4400df6b51
commit c2c485ee17
3 changed files with 26 additions and 19 deletions
+6
View File
@@ -11,6 +11,12 @@ from app.utils.postgres_checkpointer import AsyncPostgresSaverDep
def add_langgraph_route(app: FastAPI):
# @app.get("/langgraph/setup")
# async def langgraph_invoke(checkpointer: AsyncPostgresSaverDep):
# print("checkpointer", checkpointer)
# await checkpointer.setup()
# return {"result": "LangGraph: Postgres初始化完毕"}
@app.get("/langgraph/invoke")
async def langgraph_invoke(thread_id: str, checkpointer: AsyncPostgresSaverDep):
print("checkpointer", checkpointer)
+1
View File
@@ -63,6 +63,7 @@ class MilvusService:
# 检查Milvus连接是否正常
async def check_milvus_connection(self):
await asyncio.sleep(0.1)
await self.async_search(KnowledgeQueryParam(question="hello", kb_code=""))
print("✅ Milvus connection successful:", f"Milvus://{env.milvus_username}:{env.milvus_password}@{env.milvus_uri}/{env.llama_index_database}/{env.llama_index_collection}")