feat: milvus0.1s延迟初始化,添加langgraph/setup接口
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user