vocalstack 1.0.0a15__tar.gz → 1.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {vocalstack-1.0.0a15 → vocalstack-1.1.0}/PKG-INFO +1 -1
- {vocalstack-1.0.0a15 → vocalstack-1.1.0}/SKILL.md +3 -2
- {vocalstack-1.0.0a15 → vocalstack-1.1.0}/pyproject.toml +1 -1
- {vocalstack-1.0.0a15 → vocalstack-1.1.0}/skills/vocalstack/SKILL.md +3 -2
- {vocalstack-1.0.0a15 → vocalstack-1.1.0}/src/vocalstack/__init__.py +1 -1
- {vocalstack-1.0.0a15 → vocalstack-1.1.0}/src/vocalstack/_models.py +87 -47
- {vocalstack-1.0.0a15 → vocalstack-1.1.0}/src/vocalstack/resources.py +15 -5
- {vocalstack-1.0.0a15 → vocalstack-1.1.0}/.gitignore +0 -0
- {vocalstack-1.0.0a15 → vocalstack-1.1.0}/LICENSE +0 -0
- {vocalstack-1.0.0a15 → vocalstack-1.1.0}/README.md +0 -0
- {vocalstack-1.0.0a15 → vocalstack-1.1.0}/src/vocalstack/_http.py +0 -0
- {vocalstack-1.0.0a15 → vocalstack-1.1.0}/src/vocalstack/client.py +0 -0
- {vocalstack-1.0.0a15 → vocalstack-1.1.0}/src/vocalstack/errors.py +0 -0
- {vocalstack-1.0.0a15 → vocalstack-1.1.0}/src/vocalstack/realtime.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: vocalstack
|
|
3
|
-
Version: 1.0
|
|
3
|
+
Version: 1.1.0
|
|
4
4
|
Summary: VocalStack speech API SDK (asyncio): one client grouped by resource, typed models from the API contract, realtime WebSocket streaming.
|
|
5
5
|
Project-URL: Homepage, https://vocalstack.com
|
|
6
6
|
License-Expression: MIT
|
|
@@ -45,8 +45,9 @@ for that transcription, so print the text without a speaker.
|
|
|
45
45
|
real usage on the account's tier and quotas.
|
|
46
46
|
- Keys are for servers. Never put a key in browser code or in a URL. The API
|
|
47
47
|
refuses a key sent from a web page (`Origin` header) or in a query string.
|
|
48
|
-
- Scopes: `read` (read transcripts, search, export), `write`
|
|
49
|
-
|
|
48
|
+
- Scopes: `read` (read transcripts, search, export), `write` (transcribe
|
|
49
|
+
files and links, open realtime sessions, change things), `recordings:publish`
|
|
50
|
+
(start, pause and stop a stored live transcription and send it audio), or `*`.
|
|
50
51
|
- Base URL: `https://api.vocalstack.com` (the default). Override it with
|
|
51
52
|
`VOCALSTACK_BASE_URL` (for example, a local or staging server).
|
|
52
53
|
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "vocalstack"
|
|
7
|
-
version = "1.0
|
|
7
|
+
version = "1.1.0"
|
|
8
8
|
description = "VocalStack speech API SDK (asyncio): one client grouped by resource, typed models from the API contract, realtime WebSocket streaming."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = "MIT"
|
|
@@ -45,8 +45,9 @@ for that transcription, so print the text without a speaker.
|
|
|
45
45
|
real usage on the account's tier and quotas.
|
|
46
46
|
- Keys are for servers. Never put a key in browser code or in a URL. The API
|
|
47
47
|
refuses a key sent from a web page (`Origin` header) or in a query string.
|
|
48
|
-
- Scopes: `read` (read transcripts, search, export), `write`
|
|
49
|
-
|
|
48
|
+
- Scopes: `read` (read transcripts, search, export), `write` (transcribe
|
|
49
|
+
files and links, open realtime sessions, change things), `recordings:publish`
|
|
50
|
+
(start, pause and stop a stored live transcription and send it audio), or `*`.
|
|
50
51
|
- Base URL: `https://api.vocalstack.com` (the default). Override it with
|
|
51
52
|
`VOCALSTACK_BASE_URL` (for example, a local or staging server).
|
|
52
53
|
|
|
@@ -2,9 +2,12 @@
|
|
|
2
2
|
from __future__ import annotations
|
|
3
3
|
|
|
4
4
|
import json
|
|
5
|
+
import logging
|
|
5
6
|
from typing import Annotated, Any, Dict, List, Literal, Optional, Union
|
|
6
7
|
|
|
7
|
-
from pydantic import BaseModel, ConfigDict, Field, TypeAdapter
|
|
8
|
+
from pydantic import BaseModel, ConfigDict, Field, TypeAdapter, ValidationError
|
|
9
|
+
|
|
10
|
+
_log = logging.getLogger("vocalstack")
|
|
8
11
|
|
|
9
12
|
|
|
10
13
|
class _Base(BaseModel):
|
|
@@ -12,75 +15,75 @@ class _Base(BaseModel):
|
|
|
12
15
|
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
13
16
|
|
|
14
17
|
|
|
15
|
-
Access = Literal["public", "private"]
|
|
18
|
+
Access = Union[Literal["public", "private"], str]
|
|
16
19
|
|
|
17
|
-
ErrorCode = Literal["invalid_audio", "invalid_options", "invalid_token", "capacity_exceeded", "slow_consumer", "engine_unavailable", "internal", "session_expired", "engine_lost", "forbidden", "broadcast_archived", "not_found", "conflict", "invalid_state", "password_required", "rate_limited", "preview_pending", "language_unavailable", "suspended", "key_expired", "key_revoked", "key_from_browser", "insufficient_credit", "usage_cap_reached", "payment_method_required", "terms_acceptance_required", "payment_method_in_use", "billing_details_required", "promo_code_invalid", "auto_top_up_off", "range_too_long", "quota_exceeded", "idempotency_key_reused", "method_not_allowed", "payload_too_large", "unsupported_media_type", "invalid_body", "timeout", "language_limit_reached", "unavailable"]
|
|
20
|
+
ErrorCode = Union[Literal["invalid_audio", "invalid_options", "invalid_token", "capacity_exceeded", "slow_consumer", "engine_unavailable", "internal", "session_expired", "engine_lost", "forbidden", "broadcast_archived", "not_found", "conflict", "invalid_state", "password_required", "rate_limited", "preview_pending", "language_unavailable", "suspended", "key_expired", "key_revoked", "key_from_browser", "insufficient_credit", "usage_cap_reached", "payment_method_required", "terms_acceptance_required", "payment_method_in_use", "billing_details_required", "promo_code_invalid", "auto_top_up_off", "range_too_long", "quota_exceeded", "idempotency_key_reused", "method_not_allowed", "payload_too_large", "unsupported_media_type", "invalid_body", "timeout", "language_limit_reached", "unavailable"], str]
|
|
18
21
|
|
|
19
|
-
SampleWarning = Literal["overlaps", "noisy", "weak_voice", "unclear", "cut_off"]
|
|
22
|
+
SampleWarning = Union[Literal["overlaps", "noisy", "weak_voice", "unclear", "cut_off"], str]
|
|
20
23
|
|
|
21
|
-
AudioEncoding = Literal["pcm_f32le"]
|
|
24
|
+
AudioEncoding = Union[Literal["pcm_f32le"], str]
|
|
22
25
|
|
|
23
|
-
FixKind = Literal["extension", "scheme", "page_stream"]
|
|
26
|
+
FixKind = Union[Literal["extension", "scheme", "page_stream"], str]
|
|
24
27
|
|
|
25
|
-
SourceProblem = Literal["not_found", "refused", "server_error", "unknown_host", "unreachable", "private_address", "timeout", "web_page", "bad_playlist", "not_audio", "unsupported", "youtube_upcoming", "youtube_not_live", "youtube_unavailable", "youtube_busy"]
|
|
28
|
+
SourceProblem = Union[Literal["not_found", "refused", "server_error", "unknown_host", "unreachable", "private_address", "timeout", "web_page", "bad_playlist", "not_audio", "unsupported", "youtube_upcoming", "youtube_not_live", "youtube_unavailable", "youtube_busy"], str]
|
|
26
29
|
|
|
27
|
-
AudioSourceState = Literal["ready", "error"]
|
|
30
|
+
AudioSourceState = Union[Literal["ready", "error"], str]
|
|
28
31
|
|
|
29
|
-
TranscriptionState = Literal["idle", "pending", "live", "paused", "processing", "ended", "finalized"]
|
|
32
|
+
TranscriptionState = Union[Literal["idle", "pending", "live", "paused", "processing", "ended", "finalized"], str]
|
|
30
33
|
|
|
31
|
-
Lifecycle = Literal["active", "archived", "purged"]
|
|
34
|
+
Lifecycle = Union[Literal["active", "archived", "purged"], str]
|
|
32
35
|
|
|
33
|
-
LatencyMode = Literal["auto", "fast", "accuracy"]
|
|
36
|
+
LatencyMode = Union[Literal["auto", "fast", "accuracy"], str]
|
|
34
37
|
|
|
35
|
-
SpeakerLabels = Literal["auto", "on", "off"]
|
|
38
|
+
SpeakerLabels = Union[Literal["auto", "on", "off"], str]
|
|
36
39
|
|
|
37
|
-
ClientApp = Literal["mac_app"]
|
|
40
|
+
ClientApp = Union[Literal["mac_app"], str]
|
|
38
41
|
|
|
39
|
-
ClientKind = Literal["dashboard", "chrome_extension", "mac_app", "obs_plugin", "sdk", "other"]
|
|
42
|
+
ClientKind = Union[Literal["dashboard", "chrome_extension", "mac_app", "obs_plugin", "sdk", "other"], str]
|
|
40
43
|
|
|
41
|
-
Decoder = Literal["fast", "accuracy"]
|
|
44
|
+
Decoder = Union[Literal["fast", "accuracy"], str]
|
|
42
45
|
|
|
43
|
-
Consent = Literal["pending", "granted", "refused"]
|
|
46
|
+
Consent = Union[Literal["pending", "granted", "refused"], str]
|
|
44
47
|
|
|
45
|
-
NotVoicedReason = Literal["rewrite"]
|
|
48
|
+
NotVoicedReason = Union[Literal["rewrite"], str]
|
|
46
49
|
|
|
47
|
-
DoneReason = Literal["eof", "max_duration", "cancelled"]
|
|
50
|
+
DoneReason = Union[Literal["eof", "max_duration", "cancelled"], str]
|
|
48
51
|
|
|
49
|
-
ExportFormat = Literal["json", "srt", "vtt", "txt", "md", "xlsx", "pdf"]
|
|
52
|
+
ExportFormat = Union[Literal["json", "srt", "vtt", "txt", "md", "xlsx", "pdf"], str]
|
|
50
53
|
|
|
51
|
-
ExportTimestamps = Literal["off", "paragraph", "line"]
|
|
54
|
+
ExportTimestamps = Union[Literal["off", "paragraph", "line"], str]
|
|
52
55
|
|
|
53
|
-
FileUploadState = Literal["uploading", "complete"]
|
|
56
|
+
FileUploadState = Union[Literal["uploading", "complete"], str]
|
|
54
57
|
|
|
55
|
-
HealthStatus = Literal["ok"]
|
|
58
|
+
HealthStatus = Union[Literal["ok"], str]
|
|
56
59
|
|
|
57
|
-
IngestState = Literal["connecting", "streaming", "reconnecting", "stopped", "failed"]
|
|
60
|
+
IngestState = Union[Literal["connecting", "streaming", "reconnecting", "stopped", "failed"], str]
|
|
58
61
|
|
|
59
|
-
InputKind = Literal["live", "file", "url", "stream"]
|
|
62
|
+
InputKind = Union[Literal["live", "file", "url", "stream"], str]
|
|
60
63
|
|
|
61
|
-
InviteState = Literal["pending", "expired"]
|
|
64
|
+
InviteState = Union[Literal["pending", "expired"], str]
|
|
62
65
|
|
|
63
|
-
QueueReason = Literal["concurrency"]
|
|
66
|
+
QueueReason = Union[Literal["concurrency"], str]
|
|
64
67
|
|
|
65
|
-
JobState = Literal["queued", "fetching", "transcribing", "done", "failed", "cropping", "stopped"]
|
|
68
|
+
JobState = Union[Literal["queued", "fetching", "transcribing", "done", "failed", "cropping", "stopped"], str]
|
|
66
69
|
|
|
67
|
-
LanguageStatusState = Literal["matches", "mismatch", "unknown", "change_unsupported"]
|
|
70
|
+
LanguageStatusState = Union[Literal["matches", "mismatch", "unknown", "change_unsupported"], str]
|
|
68
71
|
|
|
69
|
-
LinkKind = Literal["live", "file", "unknown"]
|
|
72
|
+
LinkKind = Union[Literal["live", "file", "unknown"], str]
|
|
70
73
|
|
|
71
|
-
ProbeReason = Literal["web_page", "site_not_fetched", "meeting", "not_found", "unreachable", "forbidden", "not_media", "copy_protected", "too_long", "unknown"]
|
|
74
|
+
ProbeReason = Union[Literal["web_page", "site_not_fetched", "meeting", "not_found", "unreachable", "forbidden", "not_media", "copy_protected", "too_long", "empty", "unknown"], str]
|
|
72
75
|
|
|
73
|
-
LoadingStage = Literal["download", "model"]
|
|
76
|
+
LoadingStage = Union[Literal["download", "model"], str]
|
|
74
77
|
|
|
75
|
-
SourceKind = Literal["file", "url"]
|
|
78
|
+
SourceKind = Union[Literal["file", "url"], str]
|
|
76
79
|
|
|
77
|
-
PullState = Literal["connecting", "streaming", "reconnecting", "failed"]
|
|
80
|
+
PullState = Union[Literal["connecting", "streaming", "reconnecting", "failed"], str]
|
|
78
81
|
|
|
79
|
-
RecordingState = Literal["pending", "live", "paused", "processing", "ended", "finalized"]
|
|
82
|
+
RecordingState = Union[Literal["pending", "live", "paused", "processing", "ended", "finalized"], str]
|
|
80
83
|
|
|
81
|
-
SentenceStatus = Literal["open", "closed", "dropped"]
|
|
84
|
+
SentenceStatus = Union[Literal["open", "closed", "dropped"], str]
|
|
82
85
|
|
|
83
|
-
VoiceStatusState = Literal["preparing", "unavailable"]
|
|
86
|
+
VoiceStatusState = Union[Literal["preparing", "unavailable"], str]
|
|
84
87
|
|
|
85
88
|
|
|
86
89
|
class AccountClosing(_Base):
|
|
@@ -124,7 +127,7 @@ class AmendTail(_Base):
|
|
|
124
127
|
|
|
125
128
|
|
|
126
129
|
class ErrorData(_Base):
|
|
127
|
-
details: Optional[Any] = None
|
|
130
|
+
details: Optional[Dict[str, Any]] = None
|
|
128
131
|
retryable: bool
|
|
129
132
|
|
|
130
133
|
|
|
@@ -411,6 +414,22 @@ class PlanRef(_Base):
|
|
|
411
414
|
name: str
|
|
412
415
|
|
|
413
416
|
|
|
417
|
+
class StorePrice(_Base):
|
|
418
|
+
"""A price paid at an app store."""
|
|
419
|
+
|
|
420
|
+
amount: float
|
|
421
|
+
currency: str
|
|
422
|
+
|
|
423
|
+
|
|
424
|
+
class StorePurchases(_Base):
|
|
425
|
+
"""Credit packs bought in an app store."""
|
|
426
|
+
|
|
427
|
+
count: int
|
|
428
|
+
credit: float
|
|
429
|
+
paid: List["StorePrice"]
|
|
430
|
+
store: str
|
|
431
|
+
|
|
432
|
+
|
|
414
433
|
class NextPayment(_Base):
|
|
415
434
|
amount: float
|
|
416
435
|
at: str
|
|
@@ -447,6 +466,7 @@ class SubscriptionView(_Base):
|
|
|
447
466
|
return_plan: Optional[str] = Field(default=None, alias="returnPlan")
|
|
448
467
|
scheduled_end: Optional["ScheduledEnd"] = Field(default=None, alias="scheduledEnd")
|
|
449
468
|
status: str
|
|
469
|
+
store: str
|
|
450
470
|
switch_prices: "SwitchPrices" = Field(alias="switchPrices")
|
|
451
471
|
yearly_opt_in: bool = Field(alias="yearlyOptIn")
|
|
452
472
|
|
|
@@ -482,6 +502,7 @@ running transcriptions go on below zero, never how far."""
|
|
|
482
502
|
retention_deadline: Optional[str] = Field(default=None, alias="retentionDeadline")
|
|
483
503
|
start_block: Optional[str] = Field(default=None, alias="startBlock")
|
|
484
504
|
start_block_live: Optional[str] = Field(default=None, alias="startBlockLive")
|
|
505
|
+
store_purchases: Optional["StorePurchases"] = Field(default=None, alias="storePurchases")
|
|
485
506
|
subscription: Optional["SubscriptionView"] = None
|
|
486
507
|
top_up_url: str = Field(alias="topUpUrl")
|
|
487
508
|
|
|
@@ -518,6 +539,7 @@ class ConfidencePolicy(_Base):
|
|
|
518
539
|
|
|
519
540
|
hide_below: Optional[float] = Field(default=None, alias="hideBelow")
|
|
520
541
|
low_threshold: Optional[float] = Field(default=None, alias="lowThreshold")
|
|
542
|
+
# This many low-confidence words suppress a line for listeners.
|
|
521
543
|
suppress_count: Optional[int] = Field(default=None, alias="suppressCount")
|
|
522
544
|
|
|
523
545
|
|
|
@@ -536,6 +558,7 @@ design's settings sheet): what a recording made in it starts with."""
|
|
|
536
558
|
summary_translations: Optional[bool] = Field(default=None, alias="summaryTranslations")
|
|
537
559
|
title: Optional[bool] = None
|
|
538
560
|
translation_tts: Optional[bool] = Field(default=None, alias="translationTts")
|
|
561
|
+
# Accepted for compatibility and ignored: VocalStack picks the voice that reads each speaker, and the only choice is whether cloned voices are used (`voiceCloning`).
|
|
539
562
|
voice_by_lang: Optional[Dict[str, str]] = Field(default=None, alias="voiceByLang")
|
|
540
563
|
voice_cloning: Optional[bool] = Field(default=None, alias="voiceCloning")
|
|
541
564
|
voice_cloning_consent: Optional[bool] = Field(default=None, alias="voiceCloningConsent")
|
|
@@ -714,6 +737,7 @@ Its id is the speaker's, so `clone:<id>` names it as a voice."""
|
|
|
714
737
|
|
|
715
738
|
|
|
716
739
|
class CommittedSegment(_Base):
|
|
740
|
+
# `true` when the segment was decoded by the fast model: the `auto` transcription method catching up after falling behind real time, or the `fast` method.
|
|
717
741
|
catchup: Optional[bool] = None
|
|
718
742
|
confidence: Optional[float] = None
|
|
719
743
|
decoder: Optional[Decoder] = None
|
|
@@ -887,7 +911,7 @@ class CreateSpeakerInvite(_Base):
|
|
|
887
911
|
|
|
888
912
|
|
|
889
913
|
class CreateTag(_Base):
|
|
890
|
-
color: Optional[Literal["coral", "amber", "lime", "green", "teal", "blue", "violet", "pink"]] = None
|
|
914
|
+
color: Optional[Union[Literal["coral", "amber", "lime", "green", "teal", "blue", "violet", "pink"], str]] = None
|
|
891
915
|
name: str
|
|
892
916
|
|
|
893
917
|
|
|
@@ -906,6 +930,7 @@ class SettingsPatch(_Base):
|
|
|
906
930
|
summary_translations: Optional[bool] = Field(default=None, alias="summaryTranslations")
|
|
907
931
|
title: Optional[bool] = None
|
|
908
932
|
translation_tts: Optional[bool] = Field(default=None, alias="translationTts")
|
|
933
|
+
# Accepted for compatibility and ignored: VocalStack picks the voice (see `Settings.voiceByLang`).
|
|
909
934
|
voice_by_lang: Optional[Dict[str, str]] = Field(default=None, alias="voiceByLang")
|
|
910
935
|
voice_cloning: Optional[bool] = Field(default=None, alias="voiceCloning")
|
|
911
936
|
voice_cloning_consent: Optional[bool] = Field(default=None, alias="voiceCloningConsent")
|
|
@@ -1115,6 +1140,7 @@ class LinkProbe(_Base):
|
|
|
1115
1140
|
source: str
|
|
1116
1141
|
thumbnail_url: Optional[str] = Field(default=None, alias="thumbnailUrl")
|
|
1117
1142
|
title: Optional[str] = None
|
|
1143
|
+
viewer_only: Optional[bool] = Field(default=None, alias="viewerOnly")
|
|
1118
1144
|
|
|
1119
1145
|
|
|
1120
1146
|
class LowBalanceAlertChoices(_Base):
|
|
@@ -1199,6 +1225,8 @@ class Payment(_Base):
|
|
|
1199
1225
|
id: str
|
|
1200
1226
|
kind: str
|
|
1201
1227
|
status: str
|
|
1228
|
+
store: Optional[str] = None
|
|
1229
|
+
store_price: Optional["StorePrice"] = Field(default=None, alias="storePrice")
|
|
1202
1230
|
tax_id: Optional[str] = Field(default=None, alias="taxId")
|
|
1203
1231
|
|
|
1204
1232
|
|
|
@@ -1355,7 +1383,7 @@ class PublisherInfo(_Base):
|
|
|
1355
1383
|
class TagRef(_Base):
|
|
1356
1384
|
"""A tag as a transcription lists it."""
|
|
1357
1385
|
|
|
1358
|
-
color: Literal["coral", "amber", "lime", "green", "teal", "blue", "violet", "pink"]
|
|
1386
|
+
color: Union[Literal["coral", "amber", "lime", "green", "teal", "blue", "violet", "pink"], str]
|
|
1359
1387
|
id: str
|
|
1360
1388
|
name: str
|
|
1361
1389
|
|
|
@@ -1389,7 +1417,7 @@ stream, an RTMP encoder), which may feed broadcasts (`broadcasts`)."""
|
|
|
1389
1417
|
media: Optional[List["MediaSummary"]] = None
|
|
1390
1418
|
metrics: Optional["TranscriptionMetrics"] = None
|
|
1391
1419
|
name: str
|
|
1392
|
-
origin: Literal["dashboard", "api", "extension", "desktop_app", "obs", "wordpress", "payload", "strapi", "sanity", "contentful", "mcp", "broadcast", "unknown"]
|
|
1420
|
+
origin: Union[Literal["dashboard", "api", "extension", "desktop_app", "ios_app", "obs", "wordpress", "payload", "strapi", "sanity", "contentful", "mcp", "broadcast", "unknown"], str]
|
|
1393
1421
|
owner_principal_id: str = Field(alias="ownerPrincipalId")
|
|
1394
1422
|
peak_latency_s: Optional[float] = Field(default=None, alias="peakLatencyS")
|
|
1395
1423
|
peak_listeners: Optional[int] = Field(default=None, alias="peakListeners")
|
|
@@ -1486,6 +1514,7 @@ class SearchResults(_Base):
|
|
|
1486
1514
|
|
|
1487
1515
|
|
|
1488
1516
|
class SegmentView(_Base):
|
|
1517
|
+
# Deprecated: read `decoder` (`fast`), which says the same.
|
|
1489
1518
|
catchup: bool
|
|
1490
1519
|
confidence: Optional[float] = None
|
|
1491
1520
|
corrected: bool
|
|
@@ -1574,6 +1603,7 @@ class SessionOptions(_Base):
|
|
|
1574
1603
|
spoken_language: Optional[str] = Field(default=None, alias="spokenLanguage")
|
|
1575
1604
|
translate: Optional[List[str]] = None
|
|
1576
1605
|
voice: Optional[List[str]] = None
|
|
1606
|
+
# Accepted for compatibility and ignored: VocalStack picks the voice (see `voice`).
|
|
1577
1607
|
voice_by_lang: Optional[Dict[str, str]] = Field(default=None, alias="voiceByLang")
|
|
1578
1608
|
voice_cloning: Optional[bool] = Field(default=None, alias="voiceCloning")
|
|
1579
1609
|
|
|
@@ -1707,13 +1737,14 @@ class SummaryStatus(_Base):
|
|
|
1707
1737
|
|
|
1708
1738
|
|
|
1709
1739
|
class Tag(_Base):
|
|
1710
|
-
color: Literal["coral", "amber", "lime", "green", "teal", "blue", "violet", "pink"]
|
|
1740
|
+
color: Union[Literal["coral", "amber", "lime", "green", "teal", "blue", "violet", "pink"], str]
|
|
1711
1741
|
created_at: str = Field(alias="createdAt")
|
|
1712
1742
|
id: str
|
|
1713
1743
|
name: str
|
|
1714
1744
|
|
|
1715
1745
|
|
|
1716
1746
|
class TagList(_Base):
|
|
1747
|
+
next_cursor: Optional[str] = Field(default=None, alias="nextCursor")
|
|
1717
1748
|
tags: List["Tag"]
|
|
1718
1749
|
|
|
1719
1750
|
|
|
@@ -1774,7 +1805,7 @@ class UpdateShareLink(_Base):
|
|
|
1774
1805
|
|
|
1775
1806
|
|
|
1776
1807
|
class UpdateTag(_Base):
|
|
1777
|
-
color: Optional[Literal["coral", "amber", "lime", "green", "teal", "blue", "violet", "pink"]] = None
|
|
1808
|
+
color: Optional[Union[Literal["coral", "amber", "lime", "green", "teal", "blue", "violet", "pink"], str]] = None
|
|
1778
1809
|
name: Optional[str] = None
|
|
1779
1810
|
|
|
1780
1811
|
|
|
@@ -1938,7 +1969,7 @@ class CaptureSourceStream(_Base):
|
|
|
1938
1969
|
url: str
|
|
1939
1970
|
|
|
1940
1971
|
|
|
1941
|
-
CaptureSource = Annotated[Union[CaptureSourceMic, CaptureSourceStream], Field(discriminator="kind")]
|
|
1972
|
+
CaptureSource = Annotated[Union[Annotated[Union[CaptureSourceMic, CaptureSourceStream], Field(discriminator="kind")], Dict[str, Any]], Field(union_mode="left_to_right")]
|
|
1942
1973
|
|
|
1943
1974
|
class Eof(_Base):
|
|
1944
1975
|
type: Literal["eof"] = "eof"
|
|
@@ -1955,6 +1986,7 @@ class SessionUpdate(_Base):
|
|
|
1955
1986
|
translate: Optional[List[str]] = None
|
|
1956
1987
|
type: Literal["session.update"] = "session.update"
|
|
1957
1988
|
voice: Optional[List[str]] = None
|
|
1989
|
+
# Accepted for compatibility and ignored: VocalStack picks the voice.
|
|
1958
1990
|
voice_by_lang: Optional[Dict[str, str]] = Field(default=None, alias="voiceByLang")
|
|
1959
1991
|
|
|
1960
1992
|
|
|
@@ -2125,8 +2157,8 @@ class StreamPull(_Base):
|
|
|
2125
2157
|
error: Optional[str] = None
|
|
2126
2158
|
failures: int
|
|
2127
2159
|
media_s: float = Field(alias="mediaS")
|
|
2128
|
-
|
|
2129
|
-
|
|
2160
|
+
program_at: Optional[str] = Field(default=None, alias="programAt")
|
|
2161
|
+
sequence_offset_s: Optional[float] = Field(default=None, alias="sequenceOffsetS")
|
|
2130
2162
|
state: PullState
|
|
2131
2163
|
type: Literal["stream.pull"] = "stream.pull"
|
|
2132
2164
|
|
|
@@ -2315,14 +2347,22 @@ SERVER_FRAME_TYPES = frozenset(["session.loading", "session.queued", "session.re
|
|
|
2315
2347
|
|
|
2316
2348
|
_server_frame_adapter: TypeAdapter[ServerFrame] = TypeAdapter(ServerFrame)
|
|
2317
2349
|
|
|
2350
|
+
_SERVER_FRAME_CLASSES: Dict[str, Any] = {"session.loading": SessionLoading, "session.queued": SessionQueued, "session.ready": SessionReady, "transcript.committed": TranscriptCommitted, "transcript.draft": TranscriptDraft, "transcript.words": TranscriptWords, "transcript.amended": TranscriptAmended, "transcript.latency": TranscriptLatency, "transcript.speaker": TranscriptSpeaker, "transcript.speakerGender": TranscriptSpeakerGender, "transcript.speakerIdentified": TranscriptSpeakerIdentified, "transcript.speakerNumbers": TranscriptSpeakerNumbers, "transcript.sentence": TranscriptSentence, "transcript.translated": TranscriptTranslated, "transcript.voice": TranscriptVoice, "transcript.voiceStatus": TranscriptVoiceStatus, "transcript.languageStatus": TranscriptLanguageStatus, "transcript.retracted": TranscriptRetracted, "transcript.held": TranscriptHeld, "transcript.progress": TranscriptProgress, "stream.pull": StreamPull, "source.progress": SourceProgress, "source.prepared": SourcePrepared, "session.done": SessionDone, "error": ErrorFrame}
|
|
2351
|
+
|
|
2318
2352
|
|
|
2319
2353
|
TranscriptEvent = Union[TranscriptCommitted, TranscriptDraft, TranscriptWords, TranscriptAmended, TranscriptLatency, TranscriptSpeaker, TranscriptSpeakerGender, TranscriptSpeakerIdentified, TranscriptSpeakerNumbers, TranscriptSentence, TranscriptTranslated, TranscriptVoice, TranscriptVoiceStatus, TranscriptLanguageStatus, TranscriptRetracted, TranscriptHeld, TranscriptProgress]
|
|
2320
2354
|
|
|
2321
2355
|
|
|
2322
2356
|
def parse_server_frame(text: str) -> Optional[ServerFrame]:
|
|
2323
2357
|
"""Parse one WS text frame. Returns None for unknown frame types
|
|
2324
|
-
(forward compatibility)
|
|
2358
|
+
(forward compatibility); a known frame that does not match its model
|
|
2359
|
+
is still returned, built from its fields unchecked."""
|
|
2325
2360
|
raw = json.loads(text)
|
|
2326
2361
|
if not isinstance(raw, dict) or raw.get("type") not in SERVER_FRAME_TYPES:
|
|
2362
|
+
_log.debug("ignoring server frame of unknown type %r", raw.get("type") if isinstance(raw, dict) else None)
|
|
2327
2363
|
return None
|
|
2328
|
-
|
|
2364
|
+
try:
|
|
2365
|
+
return _server_frame_adapter.validate_python(raw)
|
|
2366
|
+
except ValidationError as e:
|
|
2367
|
+
_log.debug("server frame %r does not match the contract: %s", raw["type"], e)
|
|
2368
|
+
return _SERVER_FRAME_CLASSES[raw["type"]].model_construct(**raw)
|
|
@@ -122,7 +122,8 @@ class _ParentResource(_Group):
|
|
|
122
122
|
return _one(m.ManyResult, await self._t.json("POST", f"{self._base}/purge", json_body={"ids": ids}))
|
|
123
123
|
|
|
124
124
|
async def list_share_links(self, id: str) -> List[m.ShareLink]:
|
|
125
|
-
|
|
125
|
+
items = await _all_pages(lambda c: self._t.json("GET", self._path(id, "/share-links"), query={"cursor": c}), "links")
|
|
126
|
+
return [m.ShareLink.model_validate(x) for x in items]
|
|
126
127
|
|
|
127
128
|
async def list_scripts(self, id: str) -> List[m.Script]:
|
|
128
129
|
return _many(m.Script, await self._t.json("GET", self._path(id, "/scripts")), "scripts")
|
|
@@ -680,7 +681,8 @@ class Tags(_Group):
|
|
|
680
681
|
transcription lists its own in ``tags``."""
|
|
681
682
|
|
|
682
683
|
async def list(self) -> List[m.Tag]:
|
|
683
|
-
|
|
684
|
+
items = await _all_pages(lambda c: self._t.json("GET", "/v1/tags", query={"cursor": c}), "tags")
|
|
685
|
+
return [m.Tag.model_validate(x) for x in items]
|
|
684
686
|
|
|
685
687
|
async def create(self, name: str, **fields: Any) -> m.Tag:
|
|
686
688
|
body = _body(m.CreateTag, {"name": name, **fields})
|
|
@@ -806,7 +808,8 @@ class Speakers(_Group):
|
|
|
806
808
|
cloned voice (``voice``) built from their sample."""
|
|
807
809
|
|
|
808
810
|
async def list(self, *, lifecycle: Optional[str] = None) -> List[m.Speaker]:
|
|
809
|
-
|
|
811
|
+
items = await _all_pages(lambda c: self._t.json("GET", "/v1/speakers", query={"lifecycle": lifecycle, "cursor": c}), "speakers")
|
|
812
|
+
return [m.Speaker.model_validate(x) for x in items]
|
|
810
813
|
|
|
811
814
|
async def get(self, id: str) -> m.Speaker:
|
|
812
815
|
return _one(m.Speaker, await self._t.json("GET", f"/v1/speakers/{_p(id)}"))
|
|
@@ -898,7 +901,7 @@ class Speakers(_Group):
|
|
|
898
901
|
data = await self._t.json(
|
|
899
902
|
"GET",
|
|
900
903
|
"/v1/speakers/from-appearance/samples",
|
|
901
|
-
query={"
|
|
904
|
+
query={"transcription": transcription_id, "appearance": appearance, "spans": picked},
|
|
902
905
|
)
|
|
903
906
|
return _one(m.AppearanceSamples, data)
|
|
904
907
|
|
|
@@ -1091,6 +1094,12 @@ class Connect(_Group):
|
|
|
1091
1094
|
"POST", "/v1/connect/token", data=form, anonymous=True, no_retry=True, oauth_errors=True
|
|
1092
1095
|
)
|
|
1093
1096
|
|
|
1097
|
+
async def revoke(self) -> None:
|
|
1098
|
+
"""Revoke the API key this client is using, and only that one: sign
|
|
1099
|
+
out of the app or switch workspace. Every later call with the key
|
|
1100
|
+
raises ``invalid_token``. Never retried."""
|
|
1101
|
+
await self._t.json("POST", "/v1/connect/revoke", no_retry=True)
|
|
1102
|
+
|
|
1094
1103
|
|
|
1095
1104
|
class Billing(_Group):
|
|
1096
1105
|
"""``vs.billing``: the account's plan, credit balance and limits, the
|
|
@@ -1240,7 +1249,8 @@ class Rtmp(_Group):
|
|
|
1240
1249
|
|
|
1241
1250
|
async def list_keys(self) -> List[m.AppStreamKey]:
|
|
1242
1251
|
"""The account's app stream keys, oldest first: masked, each with whether an encoder is sending on it (``live``, ``audio``)."""
|
|
1243
|
-
|
|
1252
|
+
items = await _all_pages(lambda c: self._t.json("GET", "/v1/rtmp/keys", query={"cursor": c}), "keys")
|
|
1253
|
+
return [m.AppStreamKey.model_validate(x) for x in items]
|
|
1244
1254
|
|
|
1245
1255
|
async def delete_key(self, id: str) -> None:
|
|
1246
1256
|
"""Delete an app stream key: an encoder publishing on it is dropped within seconds."""
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|