hushscript 1.0.0__py3-none-any.whl
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.
- hushscript/__init__.py +97 -0
- hushscript/_client.py +687 -0
- hushscript/_clock.py +36 -0
- hushscript/_config.py +139 -0
- hushscript/_errors.py +563 -0
- hushscript/_guard.py +61 -0
- hushscript/_http.py +624 -0
- hushscript/_json.py +55 -0
- hushscript/_log.py +155 -0
- hushscript/_models.py +144 -0
- hushscript/_pacing.py +51 -0
- hushscript/_redact.py +140 -0
- hushscript/_response.py +67 -0
- hushscript/_retry.py +205 -0
- hushscript/_shape.py +197 -0
- hushscript/_shapes.py +248 -0
- hushscript/_version.py +1 -0
- hushscript/format.py +224 -0
- hushscript/generated/__init__.py +8 -0
- hushscript/generated/api/__init__.py +1 -0
- hushscript/generated/api/default/__init__.py +1 -0
- hushscript/generated/api/default/buy_minutes.py +248 -0
- hushscript/generated/api/default/claim_agent_account.py +238 -0
- hushscript/generated/api/default/complete_upload.py +238 -0
- hushscript/generated/api/default/create_agent_account_signup.py +261 -0
- hushscript/generated/api/default/create_setup_session.py +244 -0
- hushscript/generated/api/default/create_upload.py +225 -0
- hushscript/generated/api/default/get_account.py +169 -0
- hushscript/generated/api/default/get_job.py +198 -0
- hushscript/generated/api/default/get_org.py +169 -0
- hushscript/generated/api/default/get_transcript.py +226 -0
- hushscript/generated/api/default/get_transcription_context.py +173 -0
- hushscript/generated/api/default/get_upload_part_urls.py +246 -0
- hushscript/generated/api/default/heartbeat_upload.py +197 -0
- hushscript/generated/api/default/lift_transcript_hold.py +206 -0
- hushscript/generated/api/default/list_credit_ledger.py +229 -0
- hushscript/generated/api/default/list_deleted_transcripts.py +237 -0
- hushscript/generated/api/default/list_holds.py +233 -0
- hushscript/generated/api/default/list_jobs.py +249 -0
- hushscript/generated/api/default/list_org_audit.py +221 -0
- hushscript/generated/api/default/list_org_invoices.py +221 -0
- hushscript/generated/api/default/list_org_ledger.py +221 -0
- hushscript/generated/api/default/list_org_matters.py +247 -0
- hushscript/generated/api/default/list_org_members.py +221 -0
- hushscript/generated/api/default/list_org_transcripts.py +233 -0
- hushscript/generated/api/default/list_packs.py +169 -0
- hushscript/generated/api/default/list_saved_cards.py +169 -0
- hushscript/generated/api/default/list_transactions.py +225 -0
- hushscript/generated/api/default/list_transcripts.py +225 -0
- hushscript/generated/api/default/org_audit_csv.py +163 -0
- hushscript/generated/api/default/org_ledger_csv.py +163 -0
- hushscript/generated/api/default/org_usage_report.py +247 -0
- hushscript/generated/api/default/org_usage_report_csv.py +229 -0
- hushscript/generated/api/default/patch_org_member.py +237 -0
- hushscript/generated/api/default/place_transcript_hold.py +206 -0
- hushscript/generated/api/default/rotate_agent_credentials.py +177 -0
- hushscript/generated/api/default/schedule_org_custody.py +215 -0
- hushscript/generated/api/default/set_default_card.py +223 -0
- hushscript/generated/api/default/upload_part.py +249 -0
- hushscript/generated/catalog.py +138 -0
- hushscript/generated/client.py +282 -0
- hushscript/generated/errors.py +16 -0
- hushscript/generated/hints.py +28 -0
- hushscript/generated/models/__init__.py +193 -0
- hushscript/generated/models/account_response.py +114 -0
- hushscript/generated/models/active_hold.py +88 -0
- hushscript/generated/models/active_hold_kind.py +18 -0
- hushscript/generated/models/agent_claim_request.py +61 -0
- hushscript/generated/models/agent_claim_response.py +85 -0
- hushscript/generated/models/agent_credentials_rotate_response.py +101 -0
- hushscript/generated/models/agent_signup_request.py +118 -0
- hushscript/generated/models/agent_signup_request_agent.py +80 -0
- hushscript/generated/models/agent_signup_response.py +111 -0
- hushscript/generated/models/buy_minutes_body.py +89 -0
- hushscript/generated/models/card.py +132 -0
- hushscript/generated/models/cards_response.py +90 -0
- hushscript/generated/models/complete_upload_body.py +107 -0
- hushscript/generated/models/complete_upload_body_parts_type_0_item.py +69 -0
- hushscript/generated/models/context_dictionary.py +143 -0
- hushscript/generated/models/context_prompt_preset.py +118 -0
- hushscript/generated/models/create_setup_session_body.py +62 -0
- hushscript/generated/models/create_upload_body.py +254 -0
- hushscript/generated/models/create_upload_body_transcription_options_type_0.py +178 -0
- hushscript/generated/models/credit_ledger_entry.py +113 -0
- hushscript/generated/models/credit_ledger_response.py +90 -0
- hushscript/generated/models/deleted_transcript.py +148 -0
- hushscript/generated/models/deleted_transcript_cause.py +18 -0
- hushscript/generated/models/deleted_transcript_receipt_type_0.py +107 -0
- hushscript/generated/models/deleted_transcript_receipt_type_0_items_item.py +69 -0
- hushscript/generated/models/deleted_transcripts_response.py +90 -0
- hushscript/generated/models/dictionary_entry.py +123 -0
- hushscript/generated/models/dictionary_entry_category.py +37 -0
- hushscript/generated/models/error.py +155 -0
- hushscript/generated/models/error_details.py +94 -0
- hushscript/generated/models/get_upload_part_urls_response_200_type_0.py +108 -0
- hushscript/generated/models/heartbeat_upload_response_200.py +61 -0
- hushscript/generated/models/holds_response.py +90 -0
- hushscript/generated/models/job.py +309 -0
- hushscript/generated/models/job_failure_kind_type_1.py +16 -0
- hushscript/generated/models/job_failure_kind_type_2_type_1.py +16 -0
- hushscript/generated/models/job_failure_kind_type_3_type_1.py +16 -0
- hushscript/generated/models/job_list.py +90 -0
- hushscript/generated/models/lift_transcript_hold_response_200.py +61 -0
- hushscript/generated/models/list_jobs_active.py +17 -0
- hushscript/generated/models/list_org_matters_status.py +16 -0
- hushscript/generated/models/options_summary.py +135 -0
- hushscript/generated/models/org_audit_entry.py +105 -0
- hushscript/generated/models/org_audit_response.py +90 -0
- hushscript/generated/models/org_invoice.py +175 -0
- hushscript/generated/models/org_invoices_response.py +90 -0
- hushscript/generated/models/org_ledger_entry.py +155 -0
- hushscript/generated/models/org_ledger_response.py +90 -0
- hushscript/generated/models/org_matter.py +79 -0
- hushscript/generated/models/org_matter_status.py +16 -0
- hushscript/generated/models/org_matters_response.py +75 -0
- hushscript/generated/models/org_member.py +123 -0
- hushscript/generated/models/org_members_response.py +90 -0
- hushscript/generated/models/org_summary_response.py +482 -0
- hushscript/generated/models/org_transcript.py +103 -0
- hushscript/generated/models/org_transcripts_response.py +90 -0
- hushscript/generated/models/org_usage_report_csv_group_by.py +17 -0
- hushscript/generated/models/org_usage_report_group_by.py +17 -0
- hushscript/generated/models/org_usage_response.py +112 -0
- hushscript/generated/models/org_usage_response_group_by.py +17 -0
- hushscript/generated/models/org_usage_row.py +86 -0
- hushscript/generated/models/pack.py +107 -0
- hushscript/generated/models/packs_response.py +75 -0
- hushscript/generated/models/patch_org_member_body.py +102 -0
- hushscript/generated/models/patch_org_member_response_200.py +61 -0
- hushscript/generated/models/place_transcript_hold_response_200.py +61 -0
- hushscript/generated/models/presigned_part_url.py +69 -0
- hushscript/generated/models/purchase_response.py +76 -0
- hushscript/generated/models/schedule_org_custody_body.py +66 -0
- hushscript/generated/models/schedule_org_custody_body_custody.py +17 -0
- hushscript/generated/models/schedule_org_custody_response_200.py +69 -0
- hushscript/generated/models/set_default_card_body.py +61 -0
- hushscript/generated/models/set_default_card_response_200.py +61 -0
- hushscript/generated/models/setup_session_response.py +77 -0
- hushscript/generated/models/transaction.py +183 -0
- hushscript/generated/models/transactions_response.py +98 -0
- hushscript/generated/models/transcript_detail.py +194 -0
- hushscript/generated/models/transcript_detail_speaker_names.py +47 -0
- hushscript/generated/models/transcript_envelope.py +89 -0
- hushscript/generated/models/transcript_envelope_translations.py +62 -0
- hushscript/generated/models/transcript_language.py +75 -0
- hushscript/generated/models/transcript_list.py +90 -0
- hushscript/generated/models/transcript_list_row.py +152 -0
- hushscript/generated/models/transcript_list_row_insights_state.py +20 -0
- hushscript/generated/models/transcription_context_response.py +95 -0
- hushscript/generated/models/upload_complete_response.py +100 -0
- hushscript/generated/models/upload_create_response.py +148 -0
- hushscript/generated/models/upload_create_response_funding.py +16 -0
- hushscript/generated/models/upload_create_response_upload_type_0.py +108 -0
- hushscript/generated/models/upload_limits.py +86 -0
- hushscript/generated/models/upload_part_response_200.py +69 -0
- hushscript/generated/models/utterance.py +85 -0
- hushscript/generated/scopes.py +42 -0
- hushscript/generated/types.py +54 -0
- hushscript/money.py +79 -0
- hushscript/paginate.py +78 -0
- hushscript/py.typed +0 -0
- hushscript/resources/__init__.py +1 -0
- hushscript/resources/_params.py +33 -0
- hushscript/resources/account.py +121 -0
- hushscript/resources/agent.py +421 -0
- hushscript/resources/billing.py +567 -0
- hushscript/resources/jobs.py +105 -0
- hushscript/resources/transcripts.py +209 -0
- hushscript/transcribe/__init__.py +1 -0
- hushscript/transcribe/apipeline.py +234 -0
- hushscript/transcribe/aupload.py +197 -0
- hushscript/transcribe/heartbeat.py +78 -0
- hushscript/transcribe/pipeline.py +312 -0
- hushscript/transcribe/preflight.py +272 -0
- hushscript/transcribe/probe.py +185 -0
- hushscript/transcribe/resume.py +115 -0
- hushscript/transcribe/segment.py +23 -0
- hushscript/transcribe/session.py +34 -0
- hushscript/transcribe/sniff.py +30 -0
- hushscript/transcribe/source.py +218 -0
- hushscript/transcribe/upload.py +498 -0
- hushscript/transcribe/wait.py +124 -0
- hushscript/transcript.py +197 -0
- hushscript-1.0.0.dist-info/METADATA +502 -0
- hushscript-1.0.0.dist-info/RECORD +187 -0
- hushscript-1.0.0.dist-info/WHEEL +4 -0
- hushscript-1.0.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import TYPE_CHECKING, Any, TypeVar, cast
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
from ..types import UNSET, Unset
|
|
10
|
+
|
|
11
|
+
if TYPE_CHECKING:
|
|
12
|
+
from ..models.create_upload_body_transcription_options_type_0 import (
|
|
13
|
+
CreateUploadBodyTranscriptionOptionsType0,
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
T = TypeVar("T", bound="CreateUploadBody")
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
@_attrs_define
|
|
21
|
+
class CreateUploadBody:
|
|
22
|
+
"""
|
|
23
|
+
Attributes:
|
|
24
|
+
size_bytes (int): The exact declared byte size of the audio file, up to the 5 GB cap.
|
|
25
|
+
duration_seconds (int): The declared duration in seconds, from 15 seconds up to the 10 hour cap. Rechecked
|
|
26
|
+
against the probed exact duration at complete_upload.
|
|
27
|
+
title (None | str | Unset): An optional display title. A value longer than 300 bytes is truncated on a character
|
|
28
|
+
boundary rather than rejected, and this response does not echo the stored value; read it back from the
|
|
29
|
+
transcript once the job completes. In `private` mode the title is not stored at all.
|
|
30
|
+
mode (None | str | Unset): Optional job mode, e.g. a private-result upload.
|
|
31
|
+
part_size_bytes (int | None | Unset): Optional smaller part size for a flaky connection. Clamped to this API's
|
|
32
|
+
supported range; omit for the 32 MiB default.
|
|
33
|
+
idempotency_key (None | str | Unset): An optional client-minted key, 16 to 128 bytes. Resending the same key
|
|
34
|
+
returns the same job with no second hold.
|
|
35
|
+
matter_code (None | str | Unset): Free text, trimmed, at most 64 characters; blank is valid and clears it.
|
|
36
|
+
Refused with org_matter_code_required when the caller's workspace sets matter_code_policy to required and this
|
|
37
|
+
is absent or blank.
|
|
38
|
+
client_code (None | str | Unset): Free text, trimmed, at most 64 characters; blank is valid. Accepted for
|
|
39
|
+
backward compatibility: for an org caller the client is always resolved from the matter instead, never from this
|
|
40
|
+
field.
|
|
41
|
+
transcription_options (CreateUploadBodyTranscriptionOptionsType0 | None | Unset):
|
|
42
|
+
"""
|
|
43
|
+
|
|
44
|
+
size_bytes: int
|
|
45
|
+
duration_seconds: int
|
|
46
|
+
title: None | str | Unset = UNSET
|
|
47
|
+
mode: None | str | Unset = UNSET
|
|
48
|
+
part_size_bytes: int | None | Unset = UNSET
|
|
49
|
+
idempotency_key: None | str | Unset = UNSET
|
|
50
|
+
matter_code: None | str | Unset = UNSET
|
|
51
|
+
client_code: None | str | Unset = UNSET
|
|
52
|
+
transcription_options: CreateUploadBodyTranscriptionOptionsType0 | None | Unset = (
|
|
53
|
+
UNSET
|
|
54
|
+
)
|
|
55
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
56
|
+
|
|
57
|
+
def to_dict(self) -> dict[str, Any]:
|
|
58
|
+
from ..models.create_upload_body_transcription_options_type_0 import (
|
|
59
|
+
CreateUploadBodyTranscriptionOptionsType0, # noqa: PLC0415
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
size_bytes = self.size_bytes
|
|
63
|
+
|
|
64
|
+
duration_seconds = self.duration_seconds
|
|
65
|
+
|
|
66
|
+
title: None | str | Unset
|
|
67
|
+
if isinstance(self.title, Unset):
|
|
68
|
+
title = UNSET
|
|
69
|
+
else:
|
|
70
|
+
title = self.title
|
|
71
|
+
|
|
72
|
+
mode: None | str | Unset
|
|
73
|
+
if isinstance(self.mode, Unset):
|
|
74
|
+
mode = UNSET
|
|
75
|
+
else:
|
|
76
|
+
mode = self.mode
|
|
77
|
+
|
|
78
|
+
part_size_bytes: int | None | Unset
|
|
79
|
+
if isinstance(self.part_size_bytes, Unset):
|
|
80
|
+
part_size_bytes = UNSET
|
|
81
|
+
else:
|
|
82
|
+
part_size_bytes = self.part_size_bytes
|
|
83
|
+
|
|
84
|
+
idempotency_key: None | str | Unset
|
|
85
|
+
if isinstance(self.idempotency_key, Unset):
|
|
86
|
+
idempotency_key = UNSET
|
|
87
|
+
else:
|
|
88
|
+
idempotency_key = self.idempotency_key
|
|
89
|
+
|
|
90
|
+
matter_code: None | str | Unset
|
|
91
|
+
if isinstance(self.matter_code, Unset):
|
|
92
|
+
matter_code = UNSET
|
|
93
|
+
else:
|
|
94
|
+
matter_code = self.matter_code
|
|
95
|
+
|
|
96
|
+
client_code: None | str | Unset
|
|
97
|
+
if isinstance(self.client_code, Unset):
|
|
98
|
+
client_code = UNSET
|
|
99
|
+
else:
|
|
100
|
+
client_code = self.client_code
|
|
101
|
+
|
|
102
|
+
transcription_options: dict[str, Any] | None | Unset
|
|
103
|
+
if isinstance(self.transcription_options, Unset):
|
|
104
|
+
transcription_options = UNSET
|
|
105
|
+
elif isinstance(
|
|
106
|
+
self.transcription_options, CreateUploadBodyTranscriptionOptionsType0
|
|
107
|
+
):
|
|
108
|
+
transcription_options = self.transcription_options.to_dict()
|
|
109
|
+
else:
|
|
110
|
+
transcription_options = self.transcription_options
|
|
111
|
+
|
|
112
|
+
field_dict: dict[str, Any] = {}
|
|
113
|
+
field_dict.update(self.additional_properties)
|
|
114
|
+
field_dict.update(
|
|
115
|
+
{
|
|
116
|
+
"size_bytes": size_bytes,
|
|
117
|
+
"duration_seconds": duration_seconds,
|
|
118
|
+
}
|
|
119
|
+
)
|
|
120
|
+
if title is not UNSET:
|
|
121
|
+
field_dict["title"] = title
|
|
122
|
+
if mode is not UNSET:
|
|
123
|
+
field_dict["mode"] = mode
|
|
124
|
+
if part_size_bytes is not UNSET:
|
|
125
|
+
field_dict["part_size_bytes"] = part_size_bytes
|
|
126
|
+
if idempotency_key is not UNSET:
|
|
127
|
+
field_dict["idempotency_key"] = idempotency_key
|
|
128
|
+
if matter_code is not UNSET:
|
|
129
|
+
field_dict["matter_code"] = matter_code
|
|
130
|
+
if client_code is not UNSET:
|
|
131
|
+
field_dict["client_code"] = client_code
|
|
132
|
+
if transcription_options is not UNSET:
|
|
133
|
+
field_dict["transcription_options"] = transcription_options
|
|
134
|
+
|
|
135
|
+
return field_dict
|
|
136
|
+
|
|
137
|
+
@classmethod
|
|
138
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
139
|
+
from ..models.create_upload_body_transcription_options_type_0 import (
|
|
140
|
+
CreateUploadBodyTranscriptionOptionsType0, # noqa: PLC0415
|
|
141
|
+
)
|
|
142
|
+
|
|
143
|
+
d = dict(src_dict)
|
|
144
|
+
size_bytes = d.pop("size_bytes")
|
|
145
|
+
|
|
146
|
+
duration_seconds = d.pop("duration_seconds")
|
|
147
|
+
|
|
148
|
+
def _parse_title(data: object) -> None | str | Unset:
|
|
149
|
+
if data is None:
|
|
150
|
+
return data
|
|
151
|
+
if isinstance(data, Unset):
|
|
152
|
+
return data
|
|
153
|
+
return cast(None | str | Unset, data)
|
|
154
|
+
|
|
155
|
+
title = _parse_title(d.pop("title", UNSET))
|
|
156
|
+
|
|
157
|
+
def _parse_mode(data: object) -> None | str | Unset:
|
|
158
|
+
if data is None:
|
|
159
|
+
return data
|
|
160
|
+
if isinstance(data, Unset):
|
|
161
|
+
return data
|
|
162
|
+
return cast(None | str | Unset, data)
|
|
163
|
+
|
|
164
|
+
mode = _parse_mode(d.pop("mode", UNSET))
|
|
165
|
+
|
|
166
|
+
def _parse_part_size_bytes(data: object) -> int | None | Unset:
|
|
167
|
+
if data is None:
|
|
168
|
+
return data
|
|
169
|
+
if isinstance(data, Unset):
|
|
170
|
+
return data
|
|
171
|
+
return cast(int | None | Unset, data)
|
|
172
|
+
|
|
173
|
+
part_size_bytes = _parse_part_size_bytes(d.pop("part_size_bytes", UNSET))
|
|
174
|
+
|
|
175
|
+
def _parse_idempotency_key(data: object) -> None | str | Unset:
|
|
176
|
+
if data is None:
|
|
177
|
+
return data
|
|
178
|
+
if isinstance(data, Unset):
|
|
179
|
+
return data
|
|
180
|
+
return cast(None | str | Unset, data)
|
|
181
|
+
|
|
182
|
+
idempotency_key = _parse_idempotency_key(d.pop("idempotency_key", UNSET))
|
|
183
|
+
|
|
184
|
+
def _parse_matter_code(data: object) -> None | str | Unset:
|
|
185
|
+
if data is None:
|
|
186
|
+
return data
|
|
187
|
+
if isinstance(data, Unset):
|
|
188
|
+
return data
|
|
189
|
+
return cast(None | str | Unset, data)
|
|
190
|
+
|
|
191
|
+
matter_code = _parse_matter_code(d.pop("matter_code", UNSET))
|
|
192
|
+
|
|
193
|
+
def _parse_client_code(data: object) -> None | str | Unset:
|
|
194
|
+
if data is None:
|
|
195
|
+
return data
|
|
196
|
+
if isinstance(data, Unset):
|
|
197
|
+
return data
|
|
198
|
+
return cast(None | str | Unset, data)
|
|
199
|
+
|
|
200
|
+
client_code = _parse_client_code(d.pop("client_code", UNSET))
|
|
201
|
+
|
|
202
|
+
def _parse_transcription_options(
|
|
203
|
+
data: object,
|
|
204
|
+
) -> CreateUploadBodyTranscriptionOptionsType0 | None | Unset:
|
|
205
|
+
if data is None:
|
|
206
|
+
return data
|
|
207
|
+
if isinstance(data, Unset):
|
|
208
|
+
return data
|
|
209
|
+
try:
|
|
210
|
+
if not isinstance(data, dict):
|
|
211
|
+
raise TypeError()
|
|
212
|
+
transcription_options_type_0 = (
|
|
213
|
+
CreateUploadBodyTranscriptionOptionsType0.from_dict(data)
|
|
214
|
+
)
|
|
215
|
+
|
|
216
|
+
return transcription_options_type_0
|
|
217
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
218
|
+
pass
|
|
219
|
+
return cast(CreateUploadBodyTranscriptionOptionsType0 | None | Unset, data)
|
|
220
|
+
|
|
221
|
+
transcription_options = _parse_transcription_options(
|
|
222
|
+
d.pop("transcription_options", UNSET)
|
|
223
|
+
)
|
|
224
|
+
|
|
225
|
+
create_upload_body = cls(
|
|
226
|
+
size_bytes=size_bytes,
|
|
227
|
+
duration_seconds=duration_seconds,
|
|
228
|
+
title=title,
|
|
229
|
+
mode=mode,
|
|
230
|
+
part_size_bytes=part_size_bytes,
|
|
231
|
+
idempotency_key=idempotency_key,
|
|
232
|
+
matter_code=matter_code,
|
|
233
|
+
client_code=client_code,
|
|
234
|
+
transcription_options=transcription_options,
|
|
235
|
+
)
|
|
236
|
+
|
|
237
|
+
create_upload_body.additional_properties = d
|
|
238
|
+
return create_upload_body
|
|
239
|
+
|
|
240
|
+
@property
|
|
241
|
+
def additional_keys(self) -> list[str]:
|
|
242
|
+
return list(self.additional_properties.keys())
|
|
243
|
+
|
|
244
|
+
def __getitem__(self, key: str) -> Any:
|
|
245
|
+
return self.additional_properties[key]
|
|
246
|
+
|
|
247
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
248
|
+
self.additional_properties[key] = value
|
|
249
|
+
|
|
250
|
+
def __delitem__(self, key: str) -> None:
|
|
251
|
+
del self.additional_properties[key]
|
|
252
|
+
|
|
253
|
+
def __contains__(self, key: str) -> bool:
|
|
254
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any, TypeVar, cast
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
from ..types import UNSET, Unset
|
|
10
|
+
|
|
11
|
+
T = TypeVar("T", bound="CreateUploadBodyTranscriptionOptionsType0")
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@_attrs_define
|
|
15
|
+
class CreateUploadBodyTranscriptionOptionsType0:
|
|
16
|
+
"""Transcription options for this job. Every field is optional; omitting the object requests the account's default
|
|
17
|
+
behaviour (language auto-detection and speaker labels on).
|
|
18
|
+
|
|
19
|
+
Attributes:
|
|
20
|
+
language_code (None | str | Unset): Force a specific spoken language instead of auto-detection.
|
|
21
|
+
speaker_detection (bool | Unset): Label distinct speakers in the transcript. Forced on automatically when
|
|
22
|
+
translation_targets is non-empty.
|
|
23
|
+
keyterms_prompt (list[str] | Unset): Domain vocabulary to bias transcription toward, up to 1000 terms of at most
|
|
24
|
+
6 words each.
|
|
25
|
+
prompt (None | str | Unset): Free-text context to bias transcription toward.
|
|
26
|
+
medical_mode (bool | Unset): Bill and transcribe as a medical dictation. Requires language_code to be one of en,
|
|
27
|
+
es, fr, de; billed at a 100 percent surcharge on the duration.
|
|
28
|
+
multichannel (bool | Unset): Transcribe each audio channel independently. Billed per channel: a stereo file
|
|
29
|
+
counts twice, a 3-channel file three times, up to 8 channels, and the medical surcharge applies on top of that;
|
|
30
|
+
translation targets stay on a single duration. The channel count is the most channels any audio track of the
|
|
31
|
+
file carries. A file with more than 8 channels, or one whose channel count cannot be read, falls back to mixed
|
|
32
|
+
audio with speaker labels and is billed once. Without this option the file is transcribed as one mixed channel
|
|
33
|
+
and billed once. The initial hold at upload creation is for a single channel; verification raises it to the per-
|
|
34
|
+
channel amount and fails the job with insufficient_balance if the balance cannot cover it.
|
|
35
|
+
translation_targets (list[str] | Unset): Locales to additionally translate the transcript into. Each target adds
|
|
36
|
+
a 25 percent surcharge on the duration and forces speaker_detection on.
|
|
37
|
+
auto_generate_insights (bool | None | Unset): Override the account's automatic-Insights default for this upload
|
|
38
|
+
alone. Omit to inherit the account default; an explicit false always suppresses automatic generation for this
|
|
39
|
+
upload.
|
|
40
|
+
"""
|
|
41
|
+
|
|
42
|
+
language_code: None | str | Unset = UNSET
|
|
43
|
+
speaker_detection: bool | Unset = UNSET
|
|
44
|
+
keyterms_prompt: list[str] | Unset = UNSET
|
|
45
|
+
prompt: None | str | Unset = UNSET
|
|
46
|
+
medical_mode: bool | Unset = UNSET
|
|
47
|
+
multichannel: bool | Unset = UNSET
|
|
48
|
+
translation_targets: list[str] | Unset = UNSET
|
|
49
|
+
auto_generate_insights: bool | None | Unset = UNSET
|
|
50
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
51
|
+
|
|
52
|
+
def to_dict(self) -> dict[str, Any]:
|
|
53
|
+
language_code: None | str | Unset
|
|
54
|
+
if isinstance(self.language_code, Unset):
|
|
55
|
+
language_code = UNSET
|
|
56
|
+
else:
|
|
57
|
+
language_code = self.language_code
|
|
58
|
+
|
|
59
|
+
speaker_detection = self.speaker_detection
|
|
60
|
+
|
|
61
|
+
keyterms_prompt: list[str] | Unset = UNSET
|
|
62
|
+
if not isinstance(self.keyterms_prompt, Unset):
|
|
63
|
+
keyterms_prompt = self.keyterms_prompt
|
|
64
|
+
|
|
65
|
+
prompt: None | str | Unset
|
|
66
|
+
if isinstance(self.prompt, Unset):
|
|
67
|
+
prompt = UNSET
|
|
68
|
+
else:
|
|
69
|
+
prompt = self.prompt
|
|
70
|
+
|
|
71
|
+
medical_mode = self.medical_mode
|
|
72
|
+
|
|
73
|
+
multichannel = self.multichannel
|
|
74
|
+
|
|
75
|
+
translation_targets: list[str] | Unset = UNSET
|
|
76
|
+
if not isinstance(self.translation_targets, Unset):
|
|
77
|
+
translation_targets = self.translation_targets
|
|
78
|
+
|
|
79
|
+
auto_generate_insights: bool | None | Unset
|
|
80
|
+
if isinstance(self.auto_generate_insights, Unset):
|
|
81
|
+
auto_generate_insights = UNSET
|
|
82
|
+
else:
|
|
83
|
+
auto_generate_insights = self.auto_generate_insights
|
|
84
|
+
|
|
85
|
+
field_dict: dict[str, Any] = {}
|
|
86
|
+
field_dict.update(self.additional_properties)
|
|
87
|
+
field_dict.update({})
|
|
88
|
+
if language_code is not UNSET:
|
|
89
|
+
field_dict["language_code"] = language_code
|
|
90
|
+
if speaker_detection is not UNSET:
|
|
91
|
+
field_dict["speaker_detection"] = speaker_detection
|
|
92
|
+
if keyterms_prompt is not UNSET:
|
|
93
|
+
field_dict["keyterms_prompt"] = keyterms_prompt
|
|
94
|
+
if prompt is not UNSET:
|
|
95
|
+
field_dict["prompt"] = prompt
|
|
96
|
+
if medical_mode is not UNSET:
|
|
97
|
+
field_dict["medical_mode"] = medical_mode
|
|
98
|
+
if multichannel is not UNSET:
|
|
99
|
+
field_dict["multichannel"] = multichannel
|
|
100
|
+
if translation_targets is not UNSET:
|
|
101
|
+
field_dict["translation_targets"] = translation_targets
|
|
102
|
+
if auto_generate_insights is not UNSET:
|
|
103
|
+
field_dict["auto_generate_insights"] = auto_generate_insights
|
|
104
|
+
|
|
105
|
+
return field_dict
|
|
106
|
+
|
|
107
|
+
@classmethod
|
|
108
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
109
|
+
d = dict(src_dict)
|
|
110
|
+
|
|
111
|
+
def _parse_language_code(data: object) -> None | str | Unset:
|
|
112
|
+
if data is None:
|
|
113
|
+
return data
|
|
114
|
+
if isinstance(data, Unset):
|
|
115
|
+
return data
|
|
116
|
+
return cast(None | str | Unset, data)
|
|
117
|
+
|
|
118
|
+
language_code = _parse_language_code(d.pop("language_code", UNSET))
|
|
119
|
+
|
|
120
|
+
speaker_detection = d.pop("speaker_detection", UNSET)
|
|
121
|
+
|
|
122
|
+
keyterms_prompt = cast(list[str], d.pop("keyterms_prompt", UNSET))
|
|
123
|
+
|
|
124
|
+
def _parse_prompt(data: object) -> None | str | Unset:
|
|
125
|
+
if data is None:
|
|
126
|
+
return data
|
|
127
|
+
if isinstance(data, Unset):
|
|
128
|
+
return data
|
|
129
|
+
return cast(None | str | Unset, data)
|
|
130
|
+
|
|
131
|
+
prompt = _parse_prompt(d.pop("prompt", UNSET))
|
|
132
|
+
|
|
133
|
+
medical_mode = d.pop("medical_mode", UNSET)
|
|
134
|
+
|
|
135
|
+
multichannel = d.pop("multichannel", UNSET)
|
|
136
|
+
|
|
137
|
+
translation_targets = cast(list[str], d.pop("translation_targets", UNSET))
|
|
138
|
+
|
|
139
|
+
def _parse_auto_generate_insights(data: object) -> bool | None | Unset:
|
|
140
|
+
if data is None:
|
|
141
|
+
return data
|
|
142
|
+
if isinstance(data, Unset):
|
|
143
|
+
return data
|
|
144
|
+
return cast(bool | None | Unset, data)
|
|
145
|
+
|
|
146
|
+
auto_generate_insights = _parse_auto_generate_insights(
|
|
147
|
+
d.pop("auto_generate_insights", UNSET)
|
|
148
|
+
)
|
|
149
|
+
|
|
150
|
+
create_upload_body_transcription_options_type_0 = cls(
|
|
151
|
+
language_code=language_code,
|
|
152
|
+
speaker_detection=speaker_detection,
|
|
153
|
+
keyterms_prompt=keyterms_prompt,
|
|
154
|
+
prompt=prompt,
|
|
155
|
+
medical_mode=medical_mode,
|
|
156
|
+
multichannel=multichannel,
|
|
157
|
+
translation_targets=translation_targets,
|
|
158
|
+
auto_generate_insights=auto_generate_insights,
|
|
159
|
+
)
|
|
160
|
+
|
|
161
|
+
create_upload_body_transcription_options_type_0.additional_properties = d
|
|
162
|
+
return create_upload_body_transcription_options_type_0
|
|
163
|
+
|
|
164
|
+
@property
|
|
165
|
+
def additional_keys(self) -> list[str]:
|
|
166
|
+
return list(self.additional_properties.keys())
|
|
167
|
+
|
|
168
|
+
def __getitem__(self, key: str) -> Any:
|
|
169
|
+
return self.additional_properties[key]
|
|
170
|
+
|
|
171
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
172
|
+
self.additional_properties[key] = value
|
|
173
|
+
|
|
174
|
+
def __delitem__(self, key: str) -> None:
|
|
175
|
+
del self.additional_properties[key]
|
|
176
|
+
|
|
177
|
+
def __contains__(self, key: str) -> bool:
|
|
178
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any, TypeVar, cast
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
T = TypeVar("T", bound="CreditLedgerEntry")
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@_attrs_define
|
|
13
|
+
class CreditLedgerEntry:
|
|
14
|
+
"""
|
|
15
|
+
Attributes:
|
|
16
|
+
id (int):
|
|
17
|
+
delta_seconds (int):
|
|
18
|
+
kind (str):
|
|
19
|
+
job_id (None | str):
|
|
20
|
+
note (None | str):
|
|
21
|
+
created_at (int):
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
id: int
|
|
25
|
+
delta_seconds: int
|
|
26
|
+
kind: str
|
|
27
|
+
job_id: None | str
|
|
28
|
+
note: None | str
|
|
29
|
+
created_at: int
|
|
30
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
31
|
+
|
|
32
|
+
def to_dict(self) -> dict[str, Any]:
|
|
33
|
+
id = self.id
|
|
34
|
+
|
|
35
|
+
delta_seconds = self.delta_seconds
|
|
36
|
+
|
|
37
|
+
kind = self.kind
|
|
38
|
+
|
|
39
|
+
job_id: None | str
|
|
40
|
+
job_id = self.job_id
|
|
41
|
+
|
|
42
|
+
note: None | str
|
|
43
|
+
note = self.note
|
|
44
|
+
|
|
45
|
+
created_at = self.created_at
|
|
46
|
+
|
|
47
|
+
field_dict: dict[str, Any] = {}
|
|
48
|
+
field_dict.update(self.additional_properties)
|
|
49
|
+
field_dict.update(
|
|
50
|
+
{
|
|
51
|
+
"id": id,
|
|
52
|
+
"delta_seconds": delta_seconds,
|
|
53
|
+
"kind": kind,
|
|
54
|
+
"job_id": job_id,
|
|
55
|
+
"note": note,
|
|
56
|
+
"created_at": created_at,
|
|
57
|
+
}
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
return field_dict
|
|
61
|
+
|
|
62
|
+
@classmethod
|
|
63
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
64
|
+
d = dict(src_dict)
|
|
65
|
+
id = d.pop("id")
|
|
66
|
+
|
|
67
|
+
delta_seconds = d.pop("delta_seconds")
|
|
68
|
+
|
|
69
|
+
kind = d.pop("kind")
|
|
70
|
+
|
|
71
|
+
def _parse_job_id(data: object) -> None | str:
|
|
72
|
+
if data is None:
|
|
73
|
+
return data
|
|
74
|
+
return cast(None | str, data)
|
|
75
|
+
|
|
76
|
+
job_id = _parse_job_id(d.pop("job_id"))
|
|
77
|
+
|
|
78
|
+
def _parse_note(data: object) -> None | str:
|
|
79
|
+
if data is None:
|
|
80
|
+
return data
|
|
81
|
+
return cast(None | str, data)
|
|
82
|
+
|
|
83
|
+
note = _parse_note(d.pop("note"))
|
|
84
|
+
|
|
85
|
+
created_at = d.pop("created_at")
|
|
86
|
+
|
|
87
|
+
credit_ledger_entry = cls(
|
|
88
|
+
id=id,
|
|
89
|
+
delta_seconds=delta_seconds,
|
|
90
|
+
kind=kind,
|
|
91
|
+
job_id=job_id,
|
|
92
|
+
note=note,
|
|
93
|
+
created_at=created_at,
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
credit_ledger_entry.additional_properties = d
|
|
97
|
+
return credit_ledger_entry
|
|
98
|
+
|
|
99
|
+
@property
|
|
100
|
+
def additional_keys(self) -> list[str]:
|
|
101
|
+
return list(self.additional_properties.keys())
|
|
102
|
+
|
|
103
|
+
def __getitem__(self, key: str) -> Any:
|
|
104
|
+
return self.additional_properties[key]
|
|
105
|
+
|
|
106
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
107
|
+
self.additional_properties[key] = value
|
|
108
|
+
|
|
109
|
+
def __delitem__(self, key: str) -> None:
|
|
110
|
+
del self.additional_properties[key]
|
|
111
|
+
|
|
112
|
+
def __contains__(self, key: str) -> bool:
|
|
113
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import TYPE_CHECKING, Any, TypeVar, cast
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
if TYPE_CHECKING:
|
|
10
|
+
from ..models.credit_ledger_entry import CreditLedgerEntry
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
T = TypeVar("T", bound="CreditLedgerResponse")
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@_attrs_define
|
|
17
|
+
class CreditLedgerResponse:
|
|
18
|
+
"""
|
|
19
|
+
Attributes:
|
|
20
|
+
entries (list[CreditLedgerEntry]):
|
|
21
|
+
next_cursor (None | str): An opaque token for the next page's cursor parameter, or null on the last page. This
|
|
22
|
+
API refuses a cursor it did not mint.
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
entries: list[CreditLedgerEntry]
|
|
26
|
+
next_cursor: None | str
|
|
27
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
28
|
+
|
|
29
|
+
def to_dict(self) -> dict[str, Any]:
|
|
30
|
+
entries = []
|
|
31
|
+
for entries_item_data in self.entries:
|
|
32
|
+
entries_item = entries_item_data.to_dict()
|
|
33
|
+
entries.append(entries_item)
|
|
34
|
+
|
|
35
|
+
next_cursor: None | str
|
|
36
|
+
next_cursor = self.next_cursor
|
|
37
|
+
|
|
38
|
+
field_dict: dict[str, Any] = {}
|
|
39
|
+
field_dict.update(self.additional_properties)
|
|
40
|
+
field_dict.update(
|
|
41
|
+
{
|
|
42
|
+
"entries": entries,
|
|
43
|
+
"next_cursor": next_cursor,
|
|
44
|
+
}
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
return field_dict
|
|
48
|
+
|
|
49
|
+
@classmethod
|
|
50
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
51
|
+
from ..models.credit_ledger_entry import CreditLedgerEntry # noqa: PLC0415
|
|
52
|
+
|
|
53
|
+
d = dict(src_dict)
|
|
54
|
+
entries = []
|
|
55
|
+
_entries = d.pop("entries")
|
|
56
|
+
for entries_item_data in _entries:
|
|
57
|
+
entries_item = CreditLedgerEntry.from_dict(entries_item_data)
|
|
58
|
+
|
|
59
|
+
entries.append(entries_item)
|
|
60
|
+
|
|
61
|
+
def _parse_next_cursor(data: object) -> None | str:
|
|
62
|
+
if data is None:
|
|
63
|
+
return data
|
|
64
|
+
return cast(None | str, data)
|
|
65
|
+
|
|
66
|
+
next_cursor = _parse_next_cursor(d.pop("next_cursor"))
|
|
67
|
+
|
|
68
|
+
credit_ledger_response = cls(
|
|
69
|
+
entries=entries,
|
|
70
|
+
next_cursor=next_cursor,
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
credit_ledger_response.additional_properties = d
|
|
74
|
+
return credit_ledger_response
|
|
75
|
+
|
|
76
|
+
@property
|
|
77
|
+
def additional_keys(self) -> list[str]:
|
|
78
|
+
return list(self.additional_properties.keys())
|
|
79
|
+
|
|
80
|
+
def __getitem__(self, key: str) -> Any:
|
|
81
|
+
return self.additional_properties[key]
|
|
82
|
+
|
|
83
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
84
|
+
self.additional_properties[key] = value
|
|
85
|
+
|
|
86
|
+
def __delitem__(self, key: str) -> None:
|
|
87
|
+
del self.additional_properties[key]
|
|
88
|
+
|
|
89
|
+
def __contains__(self, key: str) -> bool:
|
|
90
|
+
return key in self.additional_properties
|