mirror of
https://github.com/hwchase17/langchain.git
synced 2025-07-03 19:57:51 +00:00
IMPROVEMENT redirect root to docs in langserve app template (#13303)
This commit is contained in:
parent
a591cdb67d
commit
280ecfd8eb
@ -1,8 +1,15 @@
|
|||||||
from fastapi import FastAPI
|
from fastapi import FastAPI
|
||||||
|
from fastapi.responses import RedirectResponse
|
||||||
from langserve import add_routes
|
from langserve import add_routes
|
||||||
|
|
||||||
app = FastAPI()
|
app = FastAPI()
|
||||||
|
|
||||||
|
|
||||||
|
@app.get("/")
|
||||||
|
async def redirect_root_to_docs():
|
||||||
|
return RedirectResponse("/docs")
|
||||||
|
|
||||||
|
|
||||||
# Edit this to add the chain you want to add
|
# Edit this to add the chain you want to add
|
||||||
add_routes(app, NotImplemented)
|
add_routes(app, NotImplemented)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user