[feat] 세션 step desync 동기화
This commit is contained in:
1 parent
5d9eedf2f6
commit
fd2e5c1cc2
4 files changed
+69
-7
No files matched your search
@@ -13,6 +13,10 @@ class Req_Chat(Req_WebPacketProtocol):
|
||||
session_id: Optional[str] = Field(None, description="없으면 새 세션 생성")
|
||||
rq_type: str = Field("재협상", description="재협상 | 재견적")
|
||||
user_input: Optional[str] = Field(None, description="버튼 선택 텍스트 또는 가격(price 모드)")
|
||||
# ① desync 감지: backend 가 보는 직전 봇 step(내부 step 또는 표시 step). 없으면 검사 생략.
|
||||
# agent 는 자기 세션 step 을 정답으로 보고 진행하되, 불일치 시 경고 로깅하고 응답에 desynced 를 실어
|
||||
# backend/front 가 agent 응답의 step/client_step 으로 리싱크하게 한다.
|
||||
client_step: Optional[str] = Field(None, description="backend 가 본 직전 봇 step (desync 감지용)")
|
||||
# 새 세션 시작 시 협상 컨텍스트 (옵션, 기본값 제공)
|
||||
revenue_amount: float = 20_000_000
|
||||
distribution_code: str = "A"
|
||||
@@ -32,6 +36,8 @@ class Res_Chat(Res_WebPacketProtocol):
|
||||
input_options: Optional[List[str]] = None
|
||||
chat_end: bool = False
|
||||
outcome: Optional[str] = None
|
||||
# ① step desync 신호: 요청 client_step 이 agent 세션 step 과 달랐음을 알린다(agent step 이 정답).
|
||||
desynced: bool = False
|
||||
# 가격협상 턴에서 선택된 협상 카드 + 학습 메타
|
||||
card_id: Optional[str] = None
|
||||
policy: Optional[str] = None
|
||||
@@ -39,3 +45,14 @@ class Res_Chat(Res_WebPacketProtocol):
|
||||
updated_q: Optional[float] = None
|
||||
visit_count: Optional[int] = None
|
||||
reward_total: Optional[float] = None
|
||||
|
||||
|
||||
class Res_ChatSession(Res_WebPacketProtocol):
|
||||
"""① 세션 상태 조회 응답. backend 가 타임아웃/재진입 시 정합을 맞출 때 사용."""
|
||||
|
||||
session_id: Optional[str] = None
|
||||
step: Optional[str] = None
|
||||
client_step: Optional[str] = None
|
||||
rq_type: Optional[str] = None
|
||||
ended: bool = False
|
||||
found: bool = False
|
||||
Reference in new issue
Block a user