langchain-ai / langserve

LangServe 🦜️🏓
Other
1.75k stars 184 forks source link

No playground message for paths added with ApiRouter #673

Open lukasugar opened 2 weeks ago

lukasugar commented 2 weeks ago

If routes are added with ApiRouter:

# some/folder/custom.py
from fastapi import APIRouter
router = APIRouter()

# Create some chain
chain = ...

add_routes(router, chain, ...)

# server.py
from some.folder.custom import router

app = FastAPI()

app.include_router(router)

then the build output won't print playground routes and the cool LANGSERVE ascii logo.

Routes added with ApiRouter should have playground link described as well.

Adding ApiRouters is a good practice in bigger FastApi projects.