Files
langchain/libs/cli/langchain_cli/project_template/app/server.py
Christophe Bornet e3c4aeaea1 chore(cli): add mypy strict checking (#32386)
Co-authored-by: Mason Daugherty <mason@langchain.dev>
2025-08-30 13:02:45 -05:00

20 lines
408 B
Python

from fastapi import FastAPI
from fastapi.responses import RedirectResponse
from langserve import add_routes
app = FastAPI()
@app.get("/")
async def redirect_root_to_docs() -> RedirectResponse:
return RedirectResponse("/docs")
# Edit this to add the chain you want to add
add_routes(app, NotImplemented)
if __name__ == "__main__":
import uvicorn
uvicorn.run(app, host="0.0.0.0", port=8000)