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,107 @@
|
|
|
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.complete_upload_body_parts_type_0_item import (
|
|
13
|
+
CompleteUploadBodyPartsType0Item,
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
T = TypeVar("T", bound="CompleteUploadBody")
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
@_attrs_define
|
|
21
|
+
class CompleteUploadBody:
|
|
22
|
+
"""
|
|
23
|
+
Attributes:
|
|
24
|
+
parts (list[CompleteUploadBodyPartsType0Item] | None | Unset): The part number and ETag of every part a direct-
|
|
25
|
+
to-R2 client uploaded. Omit entirely for a worker-uploaded job.
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
parts: list[CompleteUploadBodyPartsType0Item] | None | Unset = UNSET
|
|
29
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
30
|
+
|
|
31
|
+
def to_dict(self) -> dict[str, Any]:
|
|
32
|
+
parts: list[dict[str, Any]] | None | Unset
|
|
33
|
+
if isinstance(self.parts, Unset):
|
|
34
|
+
parts = UNSET
|
|
35
|
+
elif isinstance(self.parts, list):
|
|
36
|
+
parts = []
|
|
37
|
+
for parts_type_0_item_data in self.parts:
|
|
38
|
+
parts_type_0_item = parts_type_0_item_data.to_dict()
|
|
39
|
+
parts.append(parts_type_0_item)
|
|
40
|
+
|
|
41
|
+
else:
|
|
42
|
+
parts = self.parts
|
|
43
|
+
|
|
44
|
+
field_dict: dict[str, Any] = {}
|
|
45
|
+
field_dict.update(self.additional_properties)
|
|
46
|
+
field_dict.update({})
|
|
47
|
+
if parts is not UNSET:
|
|
48
|
+
field_dict["parts"] = parts
|
|
49
|
+
|
|
50
|
+
return field_dict
|
|
51
|
+
|
|
52
|
+
@classmethod
|
|
53
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
54
|
+
from ..models.complete_upload_body_parts_type_0_item import (
|
|
55
|
+
CompleteUploadBodyPartsType0Item, # noqa: PLC0415
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
d = dict(src_dict)
|
|
59
|
+
|
|
60
|
+
def _parse_parts(
|
|
61
|
+
data: object,
|
|
62
|
+
) -> list[CompleteUploadBodyPartsType0Item] | None | Unset:
|
|
63
|
+
if data is None:
|
|
64
|
+
return data
|
|
65
|
+
if isinstance(data, Unset):
|
|
66
|
+
return data
|
|
67
|
+
try:
|
|
68
|
+
if not isinstance(data, list):
|
|
69
|
+
raise TypeError()
|
|
70
|
+
parts_type_0 = []
|
|
71
|
+
_parts_type_0 = data
|
|
72
|
+
for parts_type_0_item_data in _parts_type_0:
|
|
73
|
+
parts_type_0_item = CompleteUploadBodyPartsType0Item.from_dict(
|
|
74
|
+
parts_type_0_item_data
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
parts_type_0.append(parts_type_0_item)
|
|
78
|
+
|
|
79
|
+
return parts_type_0
|
|
80
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
81
|
+
pass
|
|
82
|
+
return cast(list[CompleteUploadBodyPartsType0Item] | None | Unset, data)
|
|
83
|
+
|
|
84
|
+
parts = _parse_parts(d.pop("parts", UNSET))
|
|
85
|
+
|
|
86
|
+
complete_upload_body = cls(
|
|
87
|
+
parts=parts,
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
complete_upload_body.additional_properties = d
|
|
91
|
+
return complete_upload_body
|
|
92
|
+
|
|
93
|
+
@property
|
|
94
|
+
def additional_keys(self) -> list[str]:
|
|
95
|
+
return list(self.additional_properties.keys())
|
|
96
|
+
|
|
97
|
+
def __getitem__(self, key: str) -> Any:
|
|
98
|
+
return self.additional_properties[key]
|
|
99
|
+
|
|
100
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
101
|
+
self.additional_properties[key] = value
|
|
102
|
+
|
|
103
|
+
def __delitem__(self, key: str) -> None:
|
|
104
|
+
del self.additional_properties[key]
|
|
105
|
+
|
|
106
|
+
def __contains__(self, key: str) -> bool:
|
|
107
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any, TypeVar
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
T = TypeVar("T", bound="CompleteUploadBodyPartsType0Item")
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@_attrs_define
|
|
13
|
+
class CompleteUploadBodyPartsType0Item:
|
|
14
|
+
"""
|
|
15
|
+
Attributes:
|
|
16
|
+
n (int):
|
|
17
|
+
etag (str):
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
n: int
|
|
21
|
+
etag: str
|
|
22
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
23
|
+
|
|
24
|
+
def to_dict(self) -> dict[str, Any]:
|
|
25
|
+
n = self.n
|
|
26
|
+
|
|
27
|
+
etag = self.etag
|
|
28
|
+
|
|
29
|
+
field_dict: dict[str, Any] = {}
|
|
30
|
+
field_dict.update(self.additional_properties)
|
|
31
|
+
field_dict.update(
|
|
32
|
+
{
|
|
33
|
+
"n": n,
|
|
34
|
+
"etag": etag,
|
|
35
|
+
}
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
return field_dict
|
|
39
|
+
|
|
40
|
+
@classmethod
|
|
41
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
42
|
+
d = dict(src_dict)
|
|
43
|
+
n = d.pop("n")
|
|
44
|
+
|
|
45
|
+
etag = d.pop("etag")
|
|
46
|
+
|
|
47
|
+
complete_upload_body_parts_type_0_item = cls(
|
|
48
|
+
n=n,
|
|
49
|
+
etag=etag,
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
complete_upload_body_parts_type_0_item.additional_properties = d
|
|
53
|
+
return complete_upload_body_parts_type_0_item
|
|
54
|
+
|
|
55
|
+
@property
|
|
56
|
+
def additional_keys(self) -> list[str]:
|
|
57
|
+
return list(self.additional_properties.keys())
|
|
58
|
+
|
|
59
|
+
def __getitem__(self, key: str) -> Any:
|
|
60
|
+
return self.additional_properties[key]
|
|
61
|
+
|
|
62
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
63
|
+
self.additional_properties[key] = value
|
|
64
|
+
|
|
65
|
+
def __delitem__(self, key: str) -> None:
|
|
66
|
+
del self.additional_properties[key]
|
|
67
|
+
|
|
68
|
+
def __contains__(self, key: str) -> bool:
|
|
69
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,143 @@
|
|
|
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.dictionary_entry import DictionaryEntry
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
T = TypeVar("T", bound="ContextDictionary")
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@_attrs_define
|
|
17
|
+
class ContextDictionary:
|
|
18
|
+
"""
|
|
19
|
+
Attributes:
|
|
20
|
+
id (str):
|
|
21
|
+
name (str):
|
|
22
|
+
description (str): Free-text description. Empty when unset; never null.
|
|
23
|
+
language_code (str): The language this applies to: all, or one of the supported source language codes. Never
|
|
24
|
+
empty and never null: unset is stored as all.
|
|
25
|
+
entries (list[DictionaryEntry]):
|
|
26
|
+
terms (list[str]): The flat recognition terms this dictionary compiles into. Derived from entries when entries
|
|
27
|
+
exist (every canonical spelling and its variants, deduplicated); otherwise the legacy flat list stored before
|
|
28
|
+
entries existed.
|
|
29
|
+
is_default (bool): Whether this dictionary is applied to an upload that selects none explicitly. At most one
|
|
30
|
+
dictionary is the default.
|
|
31
|
+
created_at (int):
|
|
32
|
+
updated_at (int):
|
|
33
|
+
"""
|
|
34
|
+
|
|
35
|
+
id: str
|
|
36
|
+
name: str
|
|
37
|
+
description: str
|
|
38
|
+
language_code: str
|
|
39
|
+
entries: list[DictionaryEntry]
|
|
40
|
+
terms: list[str]
|
|
41
|
+
is_default: bool
|
|
42
|
+
created_at: int
|
|
43
|
+
updated_at: int
|
|
44
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
45
|
+
|
|
46
|
+
def to_dict(self) -> dict[str, Any]:
|
|
47
|
+
id = self.id
|
|
48
|
+
|
|
49
|
+
name = self.name
|
|
50
|
+
|
|
51
|
+
description = self.description
|
|
52
|
+
|
|
53
|
+
language_code = self.language_code
|
|
54
|
+
|
|
55
|
+
entries = []
|
|
56
|
+
for entries_item_data in self.entries:
|
|
57
|
+
entries_item = entries_item_data.to_dict()
|
|
58
|
+
entries.append(entries_item)
|
|
59
|
+
|
|
60
|
+
terms = self.terms
|
|
61
|
+
|
|
62
|
+
is_default = self.is_default
|
|
63
|
+
|
|
64
|
+
created_at = self.created_at
|
|
65
|
+
|
|
66
|
+
updated_at = self.updated_at
|
|
67
|
+
|
|
68
|
+
field_dict: dict[str, Any] = {}
|
|
69
|
+
field_dict.update(self.additional_properties)
|
|
70
|
+
field_dict.update(
|
|
71
|
+
{
|
|
72
|
+
"id": id,
|
|
73
|
+
"name": name,
|
|
74
|
+
"description": description,
|
|
75
|
+
"language_code": language_code,
|
|
76
|
+
"entries": entries,
|
|
77
|
+
"terms": terms,
|
|
78
|
+
"is_default": is_default,
|
|
79
|
+
"created_at": created_at,
|
|
80
|
+
"updated_at": updated_at,
|
|
81
|
+
}
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
return field_dict
|
|
85
|
+
|
|
86
|
+
@classmethod
|
|
87
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
88
|
+
from ..models.dictionary_entry import DictionaryEntry # noqa: PLC0415
|
|
89
|
+
|
|
90
|
+
d = dict(src_dict)
|
|
91
|
+
id = d.pop("id")
|
|
92
|
+
|
|
93
|
+
name = d.pop("name")
|
|
94
|
+
|
|
95
|
+
description = d.pop("description")
|
|
96
|
+
|
|
97
|
+
language_code = d.pop("language_code")
|
|
98
|
+
|
|
99
|
+
entries = []
|
|
100
|
+
_entries = d.pop("entries")
|
|
101
|
+
for entries_item_data in _entries:
|
|
102
|
+
entries_item = DictionaryEntry.from_dict(entries_item_data)
|
|
103
|
+
|
|
104
|
+
entries.append(entries_item)
|
|
105
|
+
|
|
106
|
+
terms = cast(list[str], d.pop("terms"))
|
|
107
|
+
|
|
108
|
+
is_default = d.pop("is_default")
|
|
109
|
+
|
|
110
|
+
created_at = d.pop("created_at")
|
|
111
|
+
|
|
112
|
+
updated_at = d.pop("updated_at")
|
|
113
|
+
|
|
114
|
+
context_dictionary = cls(
|
|
115
|
+
id=id,
|
|
116
|
+
name=name,
|
|
117
|
+
description=description,
|
|
118
|
+
language_code=language_code,
|
|
119
|
+
entries=entries,
|
|
120
|
+
terms=terms,
|
|
121
|
+
is_default=is_default,
|
|
122
|
+
created_at=created_at,
|
|
123
|
+
updated_at=updated_at,
|
|
124
|
+
)
|
|
125
|
+
|
|
126
|
+
context_dictionary.additional_properties = d
|
|
127
|
+
return context_dictionary
|
|
128
|
+
|
|
129
|
+
@property
|
|
130
|
+
def additional_keys(self) -> list[str]:
|
|
131
|
+
return list(self.additional_properties.keys())
|
|
132
|
+
|
|
133
|
+
def __getitem__(self, key: str) -> Any:
|
|
134
|
+
return self.additional_properties[key]
|
|
135
|
+
|
|
136
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
137
|
+
self.additional_properties[key] = value
|
|
138
|
+
|
|
139
|
+
def __delitem__(self, key: str) -> None:
|
|
140
|
+
del self.additional_properties[key]
|
|
141
|
+
|
|
142
|
+
def __contains__(self, key: str) -> bool:
|
|
143
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any, TypeVar
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
T = TypeVar("T", bound="ContextPromptPreset")
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@_attrs_define
|
|
13
|
+
class ContextPromptPreset:
|
|
14
|
+
"""
|
|
15
|
+
Attributes:
|
|
16
|
+
id (str):
|
|
17
|
+
name (str):
|
|
18
|
+
description (str): Free-text description. Empty when unset; never null.
|
|
19
|
+
language_code (str): The language this applies to: all, or one of the supported source language codes. Never
|
|
20
|
+
empty and never null: unset is stored as all.
|
|
21
|
+
body (str):
|
|
22
|
+
is_default (bool):
|
|
23
|
+
created_at (int):
|
|
24
|
+
updated_at (int):
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
id: str
|
|
28
|
+
name: str
|
|
29
|
+
description: str
|
|
30
|
+
language_code: str
|
|
31
|
+
body: str
|
|
32
|
+
is_default: bool
|
|
33
|
+
created_at: int
|
|
34
|
+
updated_at: int
|
|
35
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
36
|
+
|
|
37
|
+
def to_dict(self) -> dict[str, Any]:
|
|
38
|
+
id = self.id
|
|
39
|
+
|
|
40
|
+
name = self.name
|
|
41
|
+
|
|
42
|
+
description = self.description
|
|
43
|
+
|
|
44
|
+
language_code = self.language_code
|
|
45
|
+
|
|
46
|
+
body = self.body
|
|
47
|
+
|
|
48
|
+
is_default = self.is_default
|
|
49
|
+
|
|
50
|
+
created_at = self.created_at
|
|
51
|
+
|
|
52
|
+
updated_at = self.updated_at
|
|
53
|
+
|
|
54
|
+
field_dict: dict[str, Any] = {}
|
|
55
|
+
field_dict.update(self.additional_properties)
|
|
56
|
+
field_dict.update(
|
|
57
|
+
{
|
|
58
|
+
"id": id,
|
|
59
|
+
"name": name,
|
|
60
|
+
"description": description,
|
|
61
|
+
"language_code": language_code,
|
|
62
|
+
"body": body,
|
|
63
|
+
"is_default": is_default,
|
|
64
|
+
"created_at": created_at,
|
|
65
|
+
"updated_at": updated_at,
|
|
66
|
+
}
|
|
67
|
+
)
|
|
68
|
+
|
|
69
|
+
return field_dict
|
|
70
|
+
|
|
71
|
+
@classmethod
|
|
72
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
73
|
+
d = dict(src_dict)
|
|
74
|
+
id = d.pop("id")
|
|
75
|
+
|
|
76
|
+
name = d.pop("name")
|
|
77
|
+
|
|
78
|
+
description = d.pop("description")
|
|
79
|
+
|
|
80
|
+
language_code = d.pop("language_code")
|
|
81
|
+
|
|
82
|
+
body = d.pop("body")
|
|
83
|
+
|
|
84
|
+
is_default = d.pop("is_default")
|
|
85
|
+
|
|
86
|
+
created_at = d.pop("created_at")
|
|
87
|
+
|
|
88
|
+
updated_at = d.pop("updated_at")
|
|
89
|
+
|
|
90
|
+
context_prompt_preset = cls(
|
|
91
|
+
id=id,
|
|
92
|
+
name=name,
|
|
93
|
+
description=description,
|
|
94
|
+
language_code=language_code,
|
|
95
|
+
body=body,
|
|
96
|
+
is_default=is_default,
|
|
97
|
+
created_at=created_at,
|
|
98
|
+
updated_at=updated_at,
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
context_prompt_preset.additional_properties = d
|
|
102
|
+
return context_prompt_preset
|
|
103
|
+
|
|
104
|
+
@property
|
|
105
|
+
def additional_keys(self) -> list[str]:
|
|
106
|
+
return list(self.additional_properties.keys())
|
|
107
|
+
|
|
108
|
+
def __getitem__(self, key: str) -> Any:
|
|
109
|
+
return self.additional_properties[key]
|
|
110
|
+
|
|
111
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
112
|
+
self.additional_properties[key] = value
|
|
113
|
+
|
|
114
|
+
def __delitem__(self, key: str) -> None:
|
|
115
|
+
del self.additional_properties[key]
|
|
116
|
+
|
|
117
|
+
def __contains__(self, key: str) -> bool:
|
|
118
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any, TypeVar
|
|
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="CreateSetupSessionBody")
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@_attrs_define
|
|
15
|
+
class CreateSetupSessionBody:
|
|
16
|
+
"""
|
|
17
|
+
Attributes:
|
|
18
|
+
idempotency_key (str | Unset): Optional client-minted key so a retried request reuses one Session instead of
|
|
19
|
+
opening a new one. Omit it for a fresh Session on every call.
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
idempotency_key: str | Unset = UNSET
|
|
23
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
24
|
+
|
|
25
|
+
def to_dict(self) -> dict[str, Any]:
|
|
26
|
+
idempotency_key = self.idempotency_key
|
|
27
|
+
|
|
28
|
+
field_dict: dict[str, Any] = {}
|
|
29
|
+
field_dict.update(self.additional_properties)
|
|
30
|
+
field_dict.update({})
|
|
31
|
+
if idempotency_key is not UNSET:
|
|
32
|
+
field_dict["idempotency_key"] = idempotency_key
|
|
33
|
+
|
|
34
|
+
return field_dict
|
|
35
|
+
|
|
36
|
+
@classmethod
|
|
37
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
38
|
+
d = dict(src_dict)
|
|
39
|
+
idempotency_key = d.pop("idempotency_key", UNSET)
|
|
40
|
+
|
|
41
|
+
create_setup_session_body = cls(
|
|
42
|
+
idempotency_key=idempotency_key,
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
create_setup_session_body.additional_properties = d
|
|
46
|
+
return create_setup_session_body
|
|
47
|
+
|
|
48
|
+
@property
|
|
49
|
+
def additional_keys(self) -> list[str]:
|
|
50
|
+
return list(self.additional_properties.keys())
|
|
51
|
+
|
|
52
|
+
def __getitem__(self, key: str) -> Any:
|
|
53
|
+
return self.additional_properties[key]
|
|
54
|
+
|
|
55
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
56
|
+
self.additional_properties[key] = value
|
|
57
|
+
|
|
58
|
+
def __delitem__(self, key: str) -> None:
|
|
59
|
+
del self.additional_properties[key]
|
|
60
|
+
|
|
61
|
+
def __contains__(self, key: str) -> bool:
|
|
62
|
+
return key in self.additional_properties
|