From 280ecfd8ebf4a7d026bb3a87c648ff006df69660 Mon Sep 17 00:00:00 2001 From: Erick Friis Date: Mon, 13 Nov 2023 15:51:41 -0800 Subject: [PATCH] IMPROVEMENT redirect root to docs in langserve app template (#13303) --- libs/cli/langchain_cli/project_template/app/server.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libs/cli/langchain_cli/project_template/app/server.py b/libs/cli/langchain_cli/project_template/app/server.py index 7347b804585..7ee36a91449 100644 --- a/libs/cli/langchain_cli/project_template/app/server.py +++ b/libs/cli/langchain_cli/project_template/app/server.py @@ -1,8 +1,15 @@ from fastapi import FastAPI +from fastapi.responses import RedirectResponse from langserve import add_routes app = FastAPI() + +@app.get("/") +async def redirect_root_to_docs(): + return RedirectResponse("/docs") + + # Edit this to add the chain you want to add add_routes(app, NotImplemented)