관리자 감정 관측 기록과 조회 API 추가
This commit is contained in:
parent
d22cd9883d
commit
acb0d26338
16 changed files with 1445 additions and 18 deletions
58
apps/api/app/contracts/admin_affect.py
Normal file
58
apps/api/app/contracts/admin_affect.py
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
"""관리자 감정 관측 조회 API 계약."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from datetime import datetime
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field
|
||||
|
||||
from .client_affect import ClientAffectTraceV1
|
||||
|
||||
|
||||
class AdminAffectRuntimeResponse(BaseModel):
|
||||
model_config = ConfigDict(extra="forbid", protected_namespaces=())
|
||||
|
||||
enabled: bool
|
||||
provider: str
|
||||
model: str
|
||||
configured: bool
|
||||
|
||||
|
||||
class AdminAffectSessionSummary(BaseModel):
|
||||
model_config = ConfigDict(extra="forbid", protected_namespaces=())
|
||||
|
||||
session_id: str
|
||||
persona_code: str
|
||||
started_at: datetime
|
||||
ended: bool
|
||||
trace_count: int = Field(ge=0)
|
||||
|
||||
|
||||
class AdminAffectSessionListResponse(BaseModel):
|
||||
model_config = ConfigDict(extra="forbid", protected_namespaces=())
|
||||
|
||||
runtime: AdminAffectRuntimeResponse
|
||||
sessions: list[AdminAffectSessionSummary]
|
||||
total: int = Field(ge=0)
|
||||
limit: int = Field(ge=1, le=100)
|
||||
offset: int = Field(ge=0)
|
||||
|
||||
|
||||
class AdminAffectTraceRecord(BaseModel):
|
||||
model_config = ConfigDict(extra="forbid", protected_namespaces=())
|
||||
|
||||
turn_id: str
|
||||
seq: int = Field(ge=1)
|
||||
created_at: datetime
|
||||
trace: ClientAffectTraceV1
|
||||
|
||||
|
||||
class AdminAffectSessionDetailResponse(BaseModel):
|
||||
model_config = ConfigDict(extra="forbid", protected_namespaces=())
|
||||
|
||||
session_id: str
|
||||
persona_code: str
|
||||
current_emotions: dict[str, float | None]
|
||||
traces: list[AdminAffectTraceRecord]
|
||||
total_traces: int = Field(ge=0)
|
||||
has_more: bool
|
||||
Loading…
Add table
Add a link
Reference in a new issue