[feat] 세션 step desync 동기화
This commit is contained in:
1 parent
5d9eedf2f6
commit
fd2e5c1cc2
4 files changed
+69
-7
No files matched your search
@@ -3,7 +3,7 @@
|
||||
from fastapi import APIRouter, Depends
|
||||
|
||||
from router.deps import get_tenant_engine
|
||||
from router.v1.chat.protocol import Req_Chat, Res_Chat
|
||||
from router.v1.chat.protocol import Req_Chat, Res_Chat, Res_ChatSession
|
||||
from services.chat_service import ChatService
|
||||
from tenancy.registry import TenantEngine
|
||||
|
||||
@@ -22,3 +22,17 @@ async def chat(
|
||||
service: ChatService = Depends(),
|
||||
):
|
||||
return await service.chat(engine, req)
|
||||
|
||||
|
||||
@router.get(
|
||||
path="/sessions/{session_id}",
|
||||
response_model=Res_ChatSession,
|
||||
summary="세션 상태 조회 (desync 리싱크)",
|
||||
description="agent 세션의 현재 step/ended 를 반환한다. backend 가 타임아웃·재진입 시 정합을 맞출 때 사용. X-Tenant-ID 헤더 필수.",
|
||||
)
|
||||
async def get_session(
|
||||
session_id: str,
|
||||
engine: TenantEngine = Depends(get_tenant_engine),
|
||||
service: ChatService = Depends(),
|
||||
):
|
||||
return await service.get_session_state(engine, session_id)
|
||||
Reference in new issue
Block a user