Skip to content

Commit 51f70a9

Browse files
committed
fix mypy
1 parent 11ae75d commit 51f70a9

File tree

1 file changed

+4
-2
lines changed
  • python/llama-index-server/llama_index/server

1 file changed

+4
-2
lines changed

python/llama-index-server/llama_index/server/server.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@
77
from fastapi.middleware.cors import CORSMiddleware
88
from fastapi.routing import Mount
99
from fastapi.staticfiles import StaticFiles
10+
from pydantic import BaseModel, Field
11+
1012
from llama_index.core.workflow import Workflow
1113
from llama_index.server.api.routers import chat_router, custom_components_router
1214
from llama_index.server.chat_ui import download_chat_ui
1315
from llama_index.server.settings import server_settings
14-
from pydantic import BaseModel, Field
1516

1617

1718
class UIConfig(BaseModel):
@@ -250,4 +251,5 @@ def add_api_route(self, *args: Any, **kwargs: Any) -> None:
250251
ui_route = route
251252
self.routes.remove(route)
252253
super().add_api_route(*args, **kwargs)
253-
self.mount(ui_route.path, ui_route.app, name=ui_route.name)
254+
if ui_route:
255+
self.mount(ui_route.path, ui_route.app, name=ui_route.name)

0 commit comments

Comments
 (0)