feat(chat): persona decides to buy/walk — auto-finish + tolerance (temper) + resume
The conversation now ENDS when the persona makes a decision (option C), not when the
trainee clicks a button:
- persona_id replies carry {reply, decision(none/buy/walk), mood}; when decision is
buy/walk the session auto-finishes (won/lost) with a debrief that reveals latent
details + per-turn 'turning points'.
- personas have a tolerance (1-5, 'temper'): impatient personas walk away fast after
poor answers (fed via internal.misses on mood<=-1); tough 'wrong text' cases can
still be won by a strong, gentle response (judge realism).
- trainee 'Finish' button removed; if they leave mid-chat an active session is resumed
via /chat/resume (continue, not restart). One-shot lock still enforced once decided.
- mock/tests updated: persona deciding buy -> send auto-finishes won.
Rebuilt dist.
This commit is contained in:
@@ -107,5 +107,10 @@ class MockLLM:
|
||||
return {}
|
||||
|
||||
def complete_conversation(self, messages, **kw) -> str:
|
||||
# persona chat: echo a short in-character reply
|
||||
return json.dumps({"reply": "I see. Tell me more about the price then."}, ensure_ascii=False)
|
||||
# persona chat: echo a short in-character reply with a decision.
|
||||
# On the first send, the persona decides to buy (so E2E auto-finishes as won).
|
||||
return json.dumps({
|
||||
"reply": "I see. Tell me more about the price then.",
|
||||
"decision": "buy",
|
||||
"mood": 1,
|
||||
}, ensure_ascii=False)
|
||||
|
||||
Reference in New Issue
Block a user