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,169 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
|
|
6
|
+
from ... import errors
|
|
7
|
+
from ...client import AuthenticatedClient, Client
|
|
8
|
+
from ...models.error import Error
|
|
9
|
+
from ...models.org_summary_response import OrgSummaryResponse
|
|
10
|
+
from ...types import Response
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def _get_kwargs() -> dict[str, Any]:
|
|
14
|
+
|
|
15
|
+
_kwargs: dict[str, Any] = {
|
|
16
|
+
"method": "get",
|
|
17
|
+
"url": "/v1/org",
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return _kwargs
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def _parse_response(
|
|
24
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
25
|
+
) -> Error | OrgSummaryResponse | None:
|
|
26
|
+
if response.status_code == 200:
|
|
27
|
+
response_200 = OrgSummaryResponse.from_dict(response.json())
|
|
28
|
+
|
|
29
|
+
return response_200
|
|
30
|
+
|
|
31
|
+
if response.status_code == 401:
|
|
32
|
+
response_401 = Error.from_dict(response.json())
|
|
33
|
+
|
|
34
|
+
return response_401
|
|
35
|
+
|
|
36
|
+
if response.status_code == 403:
|
|
37
|
+
response_403 = Error.from_dict(response.json())
|
|
38
|
+
|
|
39
|
+
return response_403
|
|
40
|
+
|
|
41
|
+
if response.status_code == 429:
|
|
42
|
+
response_429 = Error.from_dict(response.json())
|
|
43
|
+
|
|
44
|
+
return response_429
|
|
45
|
+
|
|
46
|
+
if response.status_code == 500:
|
|
47
|
+
response_500 = Error.from_dict(response.json())
|
|
48
|
+
|
|
49
|
+
return response_500
|
|
50
|
+
|
|
51
|
+
if client.raise_on_unexpected_status:
|
|
52
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
53
|
+
else:
|
|
54
|
+
return None
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def _build_response(
|
|
58
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
59
|
+
) -> Response[Error | OrgSummaryResponse]:
|
|
60
|
+
return Response(
|
|
61
|
+
status_code=HTTPStatus(response.status_code),
|
|
62
|
+
content=response.content,
|
|
63
|
+
headers=response.headers,
|
|
64
|
+
parsed=_parse_response(client=client, response=response),
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
def sync_detailed(
|
|
69
|
+
*,
|
|
70
|
+
client: AuthenticatedClient,
|
|
71
|
+
) -> Response[Error | OrgSummaryResponse]:
|
|
72
|
+
"""Read the caller's organization summary
|
|
73
|
+
|
|
74
|
+
A pure passthrough of GET /api/org's body: plan state and term, pool balance and expiry, retention
|
|
75
|
+
policy, tax id, auto-renewal source and failure count, the workspace-wide default per-member cap,
|
|
76
|
+
and the caller's own effective cap and month-to-date spend against the pool. Membership only, not
|
|
77
|
+
admin -- renewal_user_id is visible to admins only.
|
|
78
|
+
|
|
79
|
+
Raises:
|
|
80
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
81
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
82
|
+
|
|
83
|
+
Returns:
|
|
84
|
+
Response[Error | OrgSummaryResponse]
|
|
85
|
+
"""
|
|
86
|
+
|
|
87
|
+
kwargs = _get_kwargs()
|
|
88
|
+
|
|
89
|
+
response = client.get_httpx_client().request(
|
|
90
|
+
**kwargs,
|
|
91
|
+
)
|
|
92
|
+
|
|
93
|
+
return _build_response(client=client, response=response)
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
def sync(
|
|
97
|
+
*,
|
|
98
|
+
client: AuthenticatedClient,
|
|
99
|
+
) -> Error | OrgSummaryResponse | None:
|
|
100
|
+
"""Read the caller's organization summary
|
|
101
|
+
|
|
102
|
+
A pure passthrough of GET /api/org's body: plan state and term, pool balance and expiry, retention
|
|
103
|
+
policy, tax id, auto-renewal source and failure count, the workspace-wide default per-member cap,
|
|
104
|
+
and the caller's own effective cap and month-to-date spend against the pool. Membership only, not
|
|
105
|
+
admin -- renewal_user_id is visible to admins only.
|
|
106
|
+
|
|
107
|
+
Raises:
|
|
108
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
109
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
110
|
+
|
|
111
|
+
Returns:
|
|
112
|
+
Error | OrgSummaryResponse
|
|
113
|
+
"""
|
|
114
|
+
|
|
115
|
+
return sync_detailed(
|
|
116
|
+
client=client,
|
|
117
|
+
).parsed
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
async def asyncio_detailed(
|
|
121
|
+
*,
|
|
122
|
+
client: AuthenticatedClient,
|
|
123
|
+
) -> Response[Error | OrgSummaryResponse]:
|
|
124
|
+
"""Read the caller's organization summary
|
|
125
|
+
|
|
126
|
+
A pure passthrough of GET /api/org's body: plan state and term, pool balance and expiry, retention
|
|
127
|
+
policy, tax id, auto-renewal source and failure count, the workspace-wide default per-member cap,
|
|
128
|
+
and the caller's own effective cap and month-to-date spend against the pool. Membership only, not
|
|
129
|
+
admin -- renewal_user_id is visible to admins only.
|
|
130
|
+
|
|
131
|
+
Raises:
|
|
132
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
133
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
134
|
+
|
|
135
|
+
Returns:
|
|
136
|
+
Response[Error | OrgSummaryResponse]
|
|
137
|
+
"""
|
|
138
|
+
|
|
139
|
+
kwargs = _get_kwargs()
|
|
140
|
+
|
|
141
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
142
|
+
|
|
143
|
+
return _build_response(client=client, response=response)
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
async def asyncio(
|
|
147
|
+
*,
|
|
148
|
+
client: AuthenticatedClient,
|
|
149
|
+
) -> Error | OrgSummaryResponse | None:
|
|
150
|
+
"""Read the caller's organization summary
|
|
151
|
+
|
|
152
|
+
A pure passthrough of GET /api/org's body: plan state and term, pool balance and expiry, retention
|
|
153
|
+
policy, tax id, auto-renewal source and failure count, the workspace-wide default per-member cap,
|
|
154
|
+
and the caller's own effective cap and month-to-date spend against the pool. Membership only, not
|
|
155
|
+
admin -- renewal_user_id is visible to admins only.
|
|
156
|
+
|
|
157
|
+
Raises:
|
|
158
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
159
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
160
|
+
|
|
161
|
+
Returns:
|
|
162
|
+
Error | OrgSummaryResponse
|
|
163
|
+
"""
|
|
164
|
+
|
|
165
|
+
return (
|
|
166
|
+
await asyncio_detailed(
|
|
167
|
+
client=client,
|
|
168
|
+
)
|
|
169
|
+
).parsed
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any
|
|
3
|
+
from urllib.parse import quote
|
|
4
|
+
|
|
5
|
+
import httpx
|
|
6
|
+
|
|
7
|
+
from ... import errors
|
|
8
|
+
from ...client import AuthenticatedClient, Client
|
|
9
|
+
from ...models.error import Error
|
|
10
|
+
from ...models.transcript_detail import TranscriptDetail
|
|
11
|
+
from ...types import Response
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def _get_kwargs(
|
|
15
|
+
id: str,
|
|
16
|
+
) -> dict[str, Any]:
|
|
17
|
+
|
|
18
|
+
_kwargs: dict[str, Any] = {
|
|
19
|
+
"method": "get",
|
|
20
|
+
"url": "/v1/transcripts/{id}".format(
|
|
21
|
+
id=quote(str(id), safe=""),
|
|
22
|
+
),
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return _kwargs
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def _parse_response(
|
|
29
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
30
|
+
) -> Error | TranscriptDetail | None:
|
|
31
|
+
if response.status_code == 200:
|
|
32
|
+
response_200 = TranscriptDetail.from_dict(response.json())
|
|
33
|
+
|
|
34
|
+
return response_200
|
|
35
|
+
|
|
36
|
+
if response.status_code == 400:
|
|
37
|
+
response_400 = Error.from_dict(response.json())
|
|
38
|
+
|
|
39
|
+
return response_400
|
|
40
|
+
|
|
41
|
+
if response.status_code == 401:
|
|
42
|
+
response_401 = Error.from_dict(response.json())
|
|
43
|
+
|
|
44
|
+
return response_401
|
|
45
|
+
|
|
46
|
+
if response.status_code == 403:
|
|
47
|
+
response_403 = Error.from_dict(response.json())
|
|
48
|
+
|
|
49
|
+
return response_403
|
|
50
|
+
|
|
51
|
+
if response.status_code == 404:
|
|
52
|
+
response_404 = Error.from_dict(response.json())
|
|
53
|
+
|
|
54
|
+
return response_404
|
|
55
|
+
|
|
56
|
+
if response.status_code == 429:
|
|
57
|
+
response_429 = Error.from_dict(response.json())
|
|
58
|
+
|
|
59
|
+
return response_429
|
|
60
|
+
|
|
61
|
+
if response.status_code == 500:
|
|
62
|
+
response_500 = Error.from_dict(response.json())
|
|
63
|
+
|
|
64
|
+
return response_500
|
|
65
|
+
|
|
66
|
+
if client.raise_on_unexpected_status:
|
|
67
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
68
|
+
else:
|
|
69
|
+
return None
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
def _build_response(
|
|
73
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
74
|
+
) -> Response[Error | TranscriptDetail]:
|
|
75
|
+
return Response(
|
|
76
|
+
status_code=HTTPStatus(response.status_code),
|
|
77
|
+
content=response.content,
|
|
78
|
+
headers=response.headers,
|
|
79
|
+
parsed=_parse_response(client=client, response=response),
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
def sync_detailed(
|
|
84
|
+
id: str,
|
|
85
|
+
*,
|
|
86
|
+
client: AuthenticatedClient,
|
|
87
|
+
) -> Response[Error | TranscriptDetail]:
|
|
88
|
+
"""Read one transcript's metadata and full body
|
|
89
|
+
|
|
90
|
+
Returns one transcript's metadata plus its full structured body (the original transcription and any
|
|
91
|
+
translations, keyed by locale). This is the reference way to fetch a transcript body from this API;
|
|
92
|
+
format conversion such as SRT, WebVTT or plain text is the caller's job. This route reads the body
|
|
93
|
+
through the same loader the rest of the backend uses, including its legacy full-envelope path for a
|
|
94
|
+
transcript stored before the chunked-body protocol existed, so a caller can rely on this route
|
|
95
|
+
regardless of which storage path actually served a given transcript. The backend's own code calls
|
|
96
|
+
this whole-body route a rolling-deploy fallback for older clients, alongside the newer manifest and
|
|
97
|
+
chunk endpoints; that label describes the route itself, not the legacy storage path, and this
|
|
98
|
+
remains the frozen /v1 way to fetch any transcript's body.
|
|
99
|
+
|
|
100
|
+
Args:
|
|
101
|
+
id (str):
|
|
102
|
+
|
|
103
|
+
Raises:
|
|
104
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
105
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
106
|
+
|
|
107
|
+
Returns:
|
|
108
|
+
Response[Error | TranscriptDetail]
|
|
109
|
+
"""
|
|
110
|
+
|
|
111
|
+
kwargs = _get_kwargs(
|
|
112
|
+
id=id,
|
|
113
|
+
)
|
|
114
|
+
|
|
115
|
+
response = client.get_httpx_client().request(
|
|
116
|
+
**kwargs,
|
|
117
|
+
)
|
|
118
|
+
|
|
119
|
+
return _build_response(client=client, response=response)
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
def sync(
|
|
123
|
+
id: str,
|
|
124
|
+
*,
|
|
125
|
+
client: AuthenticatedClient,
|
|
126
|
+
) -> Error | TranscriptDetail | None:
|
|
127
|
+
"""Read one transcript's metadata and full body
|
|
128
|
+
|
|
129
|
+
Returns one transcript's metadata plus its full structured body (the original transcription and any
|
|
130
|
+
translations, keyed by locale). This is the reference way to fetch a transcript body from this API;
|
|
131
|
+
format conversion such as SRT, WebVTT or plain text is the caller's job. This route reads the body
|
|
132
|
+
through the same loader the rest of the backend uses, including its legacy full-envelope path for a
|
|
133
|
+
transcript stored before the chunked-body protocol existed, so a caller can rely on this route
|
|
134
|
+
regardless of which storage path actually served a given transcript. The backend's own code calls
|
|
135
|
+
this whole-body route a rolling-deploy fallback for older clients, alongside the newer manifest and
|
|
136
|
+
chunk endpoints; that label describes the route itself, not the legacy storage path, and this
|
|
137
|
+
remains the frozen /v1 way to fetch any transcript's body.
|
|
138
|
+
|
|
139
|
+
Args:
|
|
140
|
+
id (str):
|
|
141
|
+
|
|
142
|
+
Raises:
|
|
143
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
144
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
145
|
+
|
|
146
|
+
Returns:
|
|
147
|
+
Error | TranscriptDetail
|
|
148
|
+
"""
|
|
149
|
+
|
|
150
|
+
return sync_detailed(
|
|
151
|
+
id=id,
|
|
152
|
+
client=client,
|
|
153
|
+
).parsed
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
async def asyncio_detailed(
|
|
157
|
+
id: str,
|
|
158
|
+
*,
|
|
159
|
+
client: AuthenticatedClient,
|
|
160
|
+
) -> Response[Error | TranscriptDetail]:
|
|
161
|
+
"""Read one transcript's metadata and full body
|
|
162
|
+
|
|
163
|
+
Returns one transcript's metadata plus its full structured body (the original transcription and any
|
|
164
|
+
translations, keyed by locale). This is the reference way to fetch a transcript body from this API;
|
|
165
|
+
format conversion such as SRT, WebVTT or plain text is the caller's job. This route reads the body
|
|
166
|
+
through the same loader the rest of the backend uses, including its legacy full-envelope path for a
|
|
167
|
+
transcript stored before the chunked-body protocol existed, so a caller can rely on this route
|
|
168
|
+
regardless of which storage path actually served a given transcript. The backend's own code calls
|
|
169
|
+
this whole-body route a rolling-deploy fallback for older clients, alongside the newer manifest and
|
|
170
|
+
chunk endpoints; that label describes the route itself, not the legacy storage path, and this
|
|
171
|
+
remains the frozen /v1 way to fetch any transcript's body.
|
|
172
|
+
|
|
173
|
+
Args:
|
|
174
|
+
id (str):
|
|
175
|
+
|
|
176
|
+
Raises:
|
|
177
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
178
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
179
|
+
|
|
180
|
+
Returns:
|
|
181
|
+
Response[Error | TranscriptDetail]
|
|
182
|
+
"""
|
|
183
|
+
|
|
184
|
+
kwargs = _get_kwargs(
|
|
185
|
+
id=id,
|
|
186
|
+
)
|
|
187
|
+
|
|
188
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
189
|
+
|
|
190
|
+
return _build_response(client=client, response=response)
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
async def asyncio(
|
|
194
|
+
id: str,
|
|
195
|
+
*,
|
|
196
|
+
client: AuthenticatedClient,
|
|
197
|
+
) -> Error | TranscriptDetail | None:
|
|
198
|
+
"""Read one transcript's metadata and full body
|
|
199
|
+
|
|
200
|
+
Returns one transcript's metadata plus its full structured body (the original transcription and any
|
|
201
|
+
translations, keyed by locale). This is the reference way to fetch a transcript body from this API;
|
|
202
|
+
format conversion such as SRT, WebVTT or plain text is the caller's job. This route reads the body
|
|
203
|
+
through the same loader the rest of the backend uses, including its legacy full-envelope path for a
|
|
204
|
+
transcript stored before the chunked-body protocol existed, so a caller can rely on this route
|
|
205
|
+
regardless of which storage path actually served a given transcript. The backend's own code calls
|
|
206
|
+
this whole-body route a rolling-deploy fallback for older clients, alongside the newer manifest and
|
|
207
|
+
chunk endpoints; that label describes the route itself, not the legacy storage path, and this
|
|
208
|
+
remains the frozen /v1 way to fetch any transcript's body.
|
|
209
|
+
|
|
210
|
+
Args:
|
|
211
|
+
id (str):
|
|
212
|
+
|
|
213
|
+
Raises:
|
|
214
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
215
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
216
|
+
|
|
217
|
+
Returns:
|
|
218
|
+
Error | TranscriptDetail
|
|
219
|
+
"""
|
|
220
|
+
|
|
221
|
+
return (
|
|
222
|
+
await asyncio_detailed(
|
|
223
|
+
id=id,
|
|
224
|
+
client=client,
|
|
225
|
+
)
|
|
226
|
+
).parsed
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
|
|
6
|
+
from ... import errors
|
|
7
|
+
from ...client import AuthenticatedClient, Client
|
|
8
|
+
from ...models.error import Error
|
|
9
|
+
from ...models.transcription_context_response import TranscriptionContextResponse
|
|
10
|
+
from ...types import Response
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def _get_kwargs() -> dict[str, Any]:
|
|
14
|
+
|
|
15
|
+
_kwargs: dict[str, Any] = {
|
|
16
|
+
"method": "get",
|
|
17
|
+
"url": "/v1/transcription-context",
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return _kwargs
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def _parse_response(
|
|
24
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
25
|
+
) -> Error | TranscriptionContextResponse | None:
|
|
26
|
+
if response.status_code == 200:
|
|
27
|
+
response_200 = TranscriptionContextResponse.from_dict(response.json())
|
|
28
|
+
|
|
29
|
+
return response_200
|
|
30
|
+
|
|
31
|
+
if response.status_code == 401:
|
|
32
|
+
response_401 = Error.from_dict(response.json())
|
|
33
|
+
|
|
34
|
+
return response_401
|
|
35
|
+
|
|
36
|
+
if response.status_code == 403:
|
|
37
|
+
response_403 = Error.from_dict(response.json())
|
|
38
|
+
|
|
39
|
+
return response_403
|
|
40
|
+
|
|
41
|
+
if response.status_code == 429:
|
|
42
|
+
response_429 = Error.from_dict(response.json())
|
|
43
|
+
|
|
44
|
+
return response_429
|
|
45
|
+
|
|
46
|
+
if response.status_code == 500:
|
|
47
|
+
response_500 = Error.from_dict(response.json())
|
|
48
|
+
|
|
49
|
+
return response_500
|
|
50
|
+
|
|
51
|
+
if client.raise_on_unexpected_status:
|
|
52
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
53
|
+
else:
|
|
54
|
+
return None
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def _build_response(
|
|
58
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
59
|
+
) -> Response[Error | TranscriptionContextResponse]:
|
|
60
|
+
return Response(
|
|
61
|
+
status_code=HTTPStatus(response.status_code),
|
|
62
|
+
content=response.content,
|
|
63
|
+
headers=response.headers,
|
|
64
|
+
parsed=_parse_response(client=client, response=response),
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
def sync_detailed(
|
|
69
|
+
*,
|
|
70
|
+
client: AuthenticatedClient,
|
|
71
|
+
) -> Response[Error | TranscriptionContextResponse]:
|
|
72
|
+
"""Read the account's saved transcription context
|
|
73
|
+
|
|
74
|
+
Returns every saved dictionary and prompt preset on the account. A dictionary teaches the
|
|
75
|
+
transcriber names and terms it would otherwise mishear; a prompt preset is standing free-text
|
|
76
|
+
guidance. Both can be selected by id on an upload. This response is not paginated and carries no
|
|
77
|
+
cursor: an account may hold at most 50 dictionaries and 20 prompt presets, both enforced when they
|
|
78
|
+
are created, so a single response is always the complete set.
|
|
79
|
+
|
|
80
|
+
Raises:
|
|
81
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
82
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
83
|
+
|
|
84
|
+
Returns:
|
|
85
|
+
Response[Error | TranscriptionContextResponse]
|
|
86
|
+
"""
|
|
87
|
+
|
|
88
|
+
kwargs = _get_kwargs()
|
|
89
|
+
|
|
90
|
+
response = client.get_httpx_client().request(
|
|
91
|
+
**kwargs,
|
|
92
|
+
)
|
|
93
|
+
|
|
94
|
+
return _build_response(client=client, response=response)
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
def sync(
|
|
98
|
+
*,
|
|
99
|
+
client: AuthenticatedClient,
|
|
100
|
+
) -> Error | TranscriptionContextResponse | None:
|
|
101
|
+
"""Read the account's saved transcription context
|
|
102
|
+
|
|
103
|
+
Returns every saved dictionary and prompt preset on the account. A dictionary teaches the
|
|
104
|
+
transcriber names and terms it would otherwise mishear; a prompt preset is standing free-text
|
|
105
|
+
guidance. Both can be selected by id on an upload. This response is not paginated and carries no
|
|
106
|
+
cursor: an account may hold at most 50 dictionaries and 20 prompt presets, both enforced when they
|
|
107
|
+
are created, so a single response is always the complete set.
|
|
108
|
+
|
|
109
|
+
Raises:
|
|
110
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
111
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
112
|
+
|
|
113
|
+
Returns:
|
|
114
|
+
Error | TranscriptionContextResponse
|
|
115
|
+
"""
|
|
116
|
+
|
|
117
|
+
return sync_detailed(
|
|
118
|
+
client=client,
|
|
119
|
+
).parsed
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
async def asyncio_detailed(
|
|
123
|
+
*,
|
|
124
|
+
client: AuthenticatedClient,
|
|
125
|
+
) -> Response[Error | TranscriptionContextResponse]:
|
|
126
|
+
"""Read the account's saved transcription context
|
|
127
|
+
|
|
128
|
+
Returns every saved dictionary and prompt preset on the account. A dictionary teaches the
|
|
129
|
+
transcriber names and terms it would otherwise mishear; a prompt preset is standing free-text
|
|
130
|
+
guidance. Both can be selected by id on an upload. This response is not paginated and carries no
|
|
131
|
+
cursor: an account may hold at most 50 dictionaries and 20 prompt presets, both enforced when they
|
|
132
|
+
are created, so a single response is always the complete set.
|
|
133
|
+
|
|
134
|
+
Raises:
|
|
135
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
136
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
137
|
+
|
|
138
|
+
Returns:
|
|
139
|
+
Response[Error | TranscriptionContextResponse]
|
|
140
|
+
"""
|
|
141
|
+
|
|
142
|
+
kwargs = _get_kwargs()
|
|
143
|
+
|
|
144
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
145
|
+
|
|
146
|
+
return _build_response(client=client, response=response)
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
async def asyncio(
|
|
150
|
+
*,
|
|
151
|
+
client: AuthenticatedClient,
|
|
152
|
+
) -> Error | TranscriptionContextResponse | None:
|
|
153
|
+
"""Read the account's saved transcription context
|
|
154
|
+
|
|
155
|
+
Returns every saved dictionary and prompt preset on the account. A dictionary teaches the
|
|
156
|
+
transcriber names and terms it would otherwise mishear; a prompt preset is standing free-text
|
|
157
|
+
guidance. Both can be selected by id on an upload. This response is not paginated and carries no
|
|
158
|
+
cursor: an account may hold at most 50 dictionaries and 20 prompt presets, both enforced when they
|
|
159
|
+
are created, so a single response is always the complete set.
|
|
160
|
+
|
|
161
|
+
Raises:
|
|
162
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
163
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
164
|
+
|
|
165
|
+
Returns:
|
|
166
|
+
Error | TranscriptionContextResponse
|
|
167
|
+
"""
|
|
168
|
+
|
|
169
|
+
return (
|
|
170
|
+
await asyncio_detailed(
|
|
171
|
+
client=client,
|
|
172
|
+
)
|
|
173
|
+
).parsed
|