Spaces:
Sleeping
Sleeping
colab-user commited on
Commit ·
f5d7ab1
1
Parent(s): 21c3226
fix schema syntax
Browse files- app/schemas/models.py +4 -5
app/schemas/models.py
CHANGED
|
@@ -2,9 +2,8 @@
|
|
| 2 |
Pydantic models for API requests and responses.
|
| 3 |
"""
|
| 4 |
from pydantic import BaseModel, Field
|
| 5 |
-
from typing import Optional
|
| 6 |
from enum import Enum
|
| 7 |
-
from typing import List, Optional
|
| 8 |
|
| 9 |
|
| 10 |
class ProcessingStatus(str, Enum):
|
|
@@ -111,16 +110,16 @@ class TranscriptionResponse(BaseModel):
|
|
| 111 |
"""Response containing the transcription results."""
|
| 112 |
success: bool = Field(..., description="Whether transcription succeeded")
|
| 113 |
message: str = Field(default="", description="Status message")
|
| 114 |
-
segments:
|
| 115 |
default_factory=list,
|
| 116 |
description="Transcript segments with speaker and role")
|
| 117 |
|
| 118 |
duration: float = Field(default=0.0, description="Audio duration in seconds")
|
| 119 |
speaker_count: int = Field(default=0, description="Number of detected speakers")
|
| 120 |
processing_time: float = Field(default=0.0, description="Processing time in seconds")
|
| 121 |
-
speakers: Optional[
|
| 122 |
|
| 123 |
-
roles: Optional[
|
| 124 |
default=None,
|
| 125 |
description="Internal mapping speaker_id → role (debug / audit only)"
|
| 126 |
)
|
|
|
|
| 2 |
Pydantic models for API requests and responses.
|
| 3 |
"""
|
| 4 |
from pydantic import BaseModel, Field
|
|
|
|
| 5 |
from enum import Enum
|
| 6 |
+
from typing import List, Optional, Dict
|
| 7 |
|
| 8 |
|
| 9 |
class ProcessingStatus(str, Enum):
|
|
|
|
| 110 |
"""Response containing the transcription results."""
|
| 111 |
success: bool = Field(..., description="Whether transcription succeeded")
|
| 112 |
message: str = Field(default="", description="Status message")
|
| 113 |
+
segments: List[TranscriptSegment] = Field(
|
| 114 |
default_factory=list,
|
| 115 |
description="Transcript segments with speaker and role")
|
| 116 |
|
| 117 |
duration: float = Field(default=0.0, description="Audio duration in seconds")
|
| 118 |
speaker_count: int = Field(default=0, description="Number of detected speakers")
|
| 119 |
processing_time: float = Field(default=0.0, description="Processing time in seconds")
|
| 120 |
+
speakers: Optional[List[str]] = None
|
| 121 |
|
| 122 |
+
roles: Optional[Dict[str, str]] = Field(
|
| 123 |
default=None,
|
| 124 |
description="Internal mapping speaker_id → role (debug / audit only)"
|
| 125 |
)
|