-
-
Save works-tabei/19c5bd7a0b2bc307dacebe6a027e11e2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from typing import List, Optional | |
| from pydantic import BaseModel, Field | |
| # --- 共通基底クラス --- | |
| class GnoxBaseMessage(BaseModel): | |
| msgId: int = Field(..., alias="msgId") | |
| siteCd: str = Field(..., alias="siteCd") | |
| siteKey: str = Field(..., alias="siteKey") | |
| eventSeq: Optional[int] = Field(None, alias="eventSeq") | |
| eventTime: str = Field(..., alias="eventTime") | |
| crn: Optional[str] = Field(None, alias="crn") | |
| refNo: Optional[str] = Field(None, alias="refNo") | |
| # --- 通話関連イベント --- | |
| class CallEvent(GnoxBaseMessage): | |
| callDirection: str = Field(..., alias="callDirection") | |
| callTp: str = Field(..., alias="callTp") | |
| userTel: str = Field(..., alias="userTel") | |
| centerTel: Optional[str] = Field(None, alias="centerTel") | |
| centerTelNm: Optional[str] = Field(None, alias="centerTelNm") | |
| agentId: Optional[str] = Field(None, alias="agentId") | |
| extNo: Optional[str] = Field(None, alias="extNo") | |
| skillCd: Optional[str] = Field(None, alias="skillCd") | |
| # 3003(終了)用 | |
| callEndTime: Optional[str] = Field(None, alias="callEndTime") | |
| callDuration: Optional[int] = Field(None, alias="callDuration") | |
| holdCount: Optional[int] = Field(None, alias="holdCount") | |
| callResult: Optional[str] = Field(None, alias="callResult") | |
| # --- 録音・要約イベント --- | |
| class TranscriptItem(BaseModel): | |
| channel: int | |
| start: float | |
| end: float | |
| token: str | |
| class RecordingEvent(GnoxBaseMessage): | |
| recordingUrl: List[str] = Field(..., alias="recordingUrl") | |
| callSummary: Optional[List[str]] = Field(None, alias="callSummary") | |
| callTranscript: Optional[List[TranscriptItem]] = Field(None, alias="callTranscript") | |
| # --- エージェント状態イベント --- | |
| class AgentStatusEvent(GnoxBaseMessage): | |
| agentId: str = Field(..., alias="agentId") | |
| presenceState: str = Field(..., alias="presenceState") | |
| lineState: str = Field(..., alias="lineState") | |
| reason: Optional[str] = Field(None, alias="reason") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment