mirror of
https://github.com/langchain-ai/lcel-teacher.git
synced 2026-07-18 18:34:30 -04:00
20 lines
420 B
Python
20 lines
420 B
Python
from fastapi import FastAPI
|
|
from fastapi.responses import RedirectResponse
|
|
from langserve import add_routes
|
|
from app.deploy_chain import chain as chain_to_deploy
|
|
|
|
app = FastAPI()
|
|
|
|
|
|
@app.get("/")
|
|
async def redirect_root_to_docs():
|
|
return RedirectResponse("/docs")
|
|
|
|
|
|
add_routes(app, chain_to_deploy, path="/lcel-teacher")
|
|
|
|
if __name__ == "__main__":
|
|
import uvicorn
|
|
|
|
uvicorn.run(app, host="0.0.0.0", port=8000)
|