File tree Expand file tree Collapse file tree 4 files changed +16
-11
lines changed
python/src/cairo_coder/server Expand file tree Collapse file tree 4 files changed +16
-11
lines changed Original file line number Diff line number Diff line change 5757
5858 - name : Test
5959 run : turbo test
60+
61+ - name : Install uv
62+ uses : astral-sh/setup-uv@v6
63+
64+ - name : Run python tests
65+ run : uv run pytest
66+ working-directory : python
Original file line number Diff line number Diff line change 2929
3030 - name : Trunk Code Quality
3131 uses : trunk-io/trunk-action@v1
32-
33- - name : Ty Check
34- run : uv run ty check
Original file line number Diff line number Diff line change 55the Cairo Coder RAG pipeline via HTTP and WebSocket endpoints.
66"""
77
8- from .app import CairoCoderServer , app , create_app
8+ from .app import CairoCoderServer , create_app
99
10- __all__ = ["CairoCoderServer" , "create_app" , "app" ]
10+ __all__ = ["CairoCoderServer" , "create_app" ]
Original file line number Diff line number Diff line change @@ -630,10 +630,10 @@ async def lifespan(app: FastAPI):
630630
631631 _vector_db = None
632632
633-
634- # Create FastAPI app instance
635- app = create_app ( get_vector_store_config () )
636-
633+ def create_app_factory ():
634+ """Factory function for creating the app, used by uvicorn in reload mode."""
635+ ConfigManager . load_config ( )
636+ return create_app ( get_vector_store_config ())
637637
638638def main ():
639639 import argparse
@@ -650,14 +650,15 @@ def main():
650650 # TODO: Find a proper pattern for it?
651651 # TODO: multi-model management?
652652 uvicorn .run (
653- "cairo_coder.server.app:app " ,
653+ "cairo_coder.server.app:create_app_factory " ,
654654 host = "0.0.0.0" ,
655655 port = 3001 ,
656656 reload = args .dev ,
657657 log_level = "info" ,
658658 workers = args .workers ,
659+ factory = True ,
659660 )
660661
661-
662662if __name__ == "__main__" :
663+ # Create FastAPI app instance
663664 main ()
You can’t perform that action at this time.
0 commit comments