feat(api): nest chat endpoints under projects and refactor dependencies

- Change chat router prefix from `/chat` to `/projects/{project_id}/chat`
- Add `dep_project` dependency to inject Project instance into endpoints
- Remove manual project validation in `stream_chat` and use dependency instead
- Add placeholder `list_sessions` endpoint for future session listing
- Update `get_history` endpoint to use project dependency and adjust path
- Improve code organization and error handling for project retrieval
This commit is contained in:
YueGuobin committed 2026-03-04 12:43:36 +08:00
1 parent 479afc01b0
commit 2df05dff6e
3 files changed
+47 -65

No files matched your search

+1 -1
View File
@@ -156,6 +156,6 @@ router.include_router(
router.include_router(
chat.router,
prefix="/chat",
prefix="/projects/{project_id}/chat",
tags=["Chat"]
)