|
1 | 1 | from __future__ import annotations |
| 2 | + |
| 3 | +import concurrent.futures |
2 | 4 | import os |
3 | 5 | import time |
| 6 | +from typing import Dict, Iterator, List, Optional, Union |
4 | 7 | from urllib.parse import urlparse |
5 | | -import concurrent.futures |
6 | | -from typing import Dict, Iterator, Optional, List, Union |
| 8 | + |
7 | 9 | from typing_extensions import Self |
8 | 10 |
|
9 | | -from . import lemur, types, api |
| 11 | +from . import api |
10 | 12 | from . import client as _client |
| 13 | +from . import lemur, types |
11 | 14 |
|
12 | 15 |
|
13 | 16 | class _TranscriptImpl: |
@@ -213,6 +216,45 @@ def error(self) -> Optional[str]: |
213 | 216 |
|
214 | 217 | return self._impl.transcript.error |
215 | 218 |
|
| 219 | + @property |
| 220 | + def words(self) -> Optional[List[types.Word]]: |
| 221 | + "The list of words in the transcript" |
| 222 | + |
| 223 | + return self._impl.transcript.words |
| 224 | + |
| 225 | + @property |
| 226 | + def utterances(self) -> Optional[List[types.Utterance]]: |
| 227 | + """ |
| 228 | + When `dual_channel` or `speaker_labels` is enabled, |
| 229 | + a list of utterances in the transcript. |
| 230 | + """ |
| 231 | + |
| 232 | + return self._impl.transcript.utterances |
| 233 | + |
| 234 | + @property |
| 235 | + def confidence(self) -> Optional[float]: |
| 236 | + "The confidence our model has in the transcribed text, between 0 and 1" |
| 237 | + |
| 238 | + return self._impl.transcript.confidence |
| 239 | + |
| 240 | + @property |
| 241 | + def audio_duration(self) -> Optional[float]: |
| 242 | + "The duration of the audio in seconds" |
| 243 | + |
| 244 | + return self._impl.transcript.audio_duration |
| 245 | + |
| 246 | + @property |
| 247 | + def webhook_status_code(self) -> Optional[int]: |
| 248 | + "The status code we received from your server when delivering your webhook" |
| 249 | + |
| 250 | + return self._impl.transcript.webhook_status_code |
| 251 | + |
| 252 | + @property |
| 253 | + def webhook_auth(self) -> Optional[bool]: |
| 254 | + "Whether the webhook was sent with an HTTP authentication header" |
| 255 | + |
| 256 | + return self._impl.transcript.webhook_auth |
| 257 | + |
216 | 258 | @property |
217 | 259 | def lemur(self) -> lemur.Lemur: |
218 | 260 | """ |
|
0 commit comments