한신대 피드백 개선팩 반영

This commit is contained in:
Yun Chan 2026-07-03 19:53:14 +09:00
parent 5a9c110c11
commit 6b6241f468
25 changed files with 1247 additions and 94 deletions

View file

@ -131,6 +131,7 @@ class TurnResponse(BaseModel):
crisis_kind: str = "none"
crisis_resource: Optional[CrisisResourceResponse] = None
conversation_stopped: bool = False
output_error: Optional[str] = None
class SessionEndResponse(BaseModel):
@ -678,11 +679,12 @@ def _stream_result_from_done(
evaluation: Optional[dict],
) -> orchestrator.TurnResult:
assert ctx.state_after is not None
output_error = str(data.get("output_error") or "") or None
return orchestrator.TurnResult(
turn_seq=ctx.state_after.turn_seq,
stage=_stage_label(ctx.state_after.stage),
effective_openness=ctx.state_after.effective_openness,
client_reply=final_reply or None,
client_reply=None if output_error else final_reply or None,
safety_flagged=bool(data.get("safety_flagged")),
state_after=ctx.state_after,
evaluation=evaluation,
@ -694,6 +696,7 @@ def _stream_result_from_done(
tokens_in=int(data.get("tokens_in") or 0),
tokens_out=int(data.get("tokens_out") or 0),
cost_usd=float(data.get("cost_usd") or 0.0),
output_error=output_error,
)
@ -1330,6 +1333,7 @@ async def submit_turn(
crisis_kind=result.crisis_kind,
crisis_resource=result.crisis_resource,
conversation_stopped=result.conversation_stopped,
output_error=result.output_error,
)