casedev 0.1.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.
Files changed (185) hide show
  1. casedev/__init__.py +104 -0
  2. casedev/_base_client.py +1995 -0
  3. casedev/_client.py +560 -0
  4. casedev/_compat.py +219 -0
  5. casedev/_constants.py +14 -0
  6. casedev/_exceptions.py +108 -0
  7. casedev/_files.py +123 -0
  8. casedev/_models.py +857 -0
  9. casedev/_qs.py +150 -0
  10. casedev/_resource.py +43 -0
  11. casedev/_response.py +830 -0
  12. casedev/_streaming.py +333 -0
  13. casedev/_types.py +260 -0
  14. casedev/_utils/__init__.py +64 -0
  15. casedev/_utils/_compat.py +45 -0
  16. casedev/_utils/_datetime_parse.py +136 -0
  17. casedev/_utils/_logs.py +25 -0
  18. casedev/_utils/_proxy.py +65 -0
  19. casedev/_utils/_reflection.py +42 -0
  20. casedev/_utils/_resources_proxy.py +24 -0
  21. casedev/_utils/_streams.py +12 -0
  22. casedev/_utils/_sync.py +58 -0
  23. casedev/_utils/_transform.py +457 -0
  24. casedev/_utils/_typing.py +156 -0
  25. casedev/_utils/_utils.py +421 -0
  26. casedev/_version.py +4 -0
  27. casedev/lib/.keep +4 -0
  28. casedev/py.typed +0 -0
  29. casedev/resources/__init__.py +173 -0
  30. casedev/resources/actions/__init__.py +33 -0
  31. casedev/resources/actions/actions.py +102 -0
  32. casedev/resources/actions/v1.py +640 -0
  33. casedev/resources/compute/__init__.py +33 -0
  34. casedev/resources/compute/compute.py +102 -0
  35. casedev/resources/compute/v1/__init__.py +89 -0
  36. casedev/resources/compute/v1/environments.py +492 -0
  37. casedev/resources/compute/v1/functions.py +278 -0
  38. casedev/resources/compute/v1/invoke.py +216 -0
  39. casedev/resources/compute/v1/runs.py +290 -0
  40. casedev/resources/compute/v1/secrets.py +655 -0
  41. casedev/resources/compute/v1/v1.py +583 -0
  42. casedev/resources/convert/__init__.py +33 -0
  43. casedev/resources/convert/convert.py +102 -0
  44. casedev/resources/convert/v1/__init__.py +33 -0
  45. casedev/resources/convert/v1/jobs.py +254 -0
  46. casedev/resources/convert/v1/v1.py +450 -0
  47. casedev/resources/format/__init__.py +33 -0
  48. casedev/resources/format/format.py +102 -0
  49. casedev/resources/format/v1/__init__.py +33 -0
  50. casedev/resources/format/v1/templates.py +419 -0
  51. casedev/resources/format/v1/v1.py +244 -0
  52. casedev/resources/llm/__init__.py +33 -0
  53. casedev/resources/llm/llm.py +192 -0
  54. casedev/resources/llm/v1/__init__.py +33 -0
  55. casedev/resources/llm/v1/chat.py +243 -0
  56. casedev/resources/llm/v1/v1.py +317 -0
  57. casedev/resources/ocr/__init__.py +33 -0
  58. casedev/resources/ocr/ocr.py +102 -0
  59. casedev/resources/ocr/v1.py +407 -0
  60. casedev/resources/search/__init__.py +33 -0
  61. casedev/resources/search/search.py +102 -0
  62. casedev/resources/search/v1.py +1052 -0
  63. casedev/resources/templates/__init__.py +33 -0
  64. casedev/resources/templates/templates.py +102 -0
  65. casedev/resources/templates/v1.py +633 -0
  66. casedev/resources/vault/__init__.py +47 -0
  67. casedev/resources/vault/graphrag.py +256 -0
  68. casedev/resources/vault/objects.py +571 -0
  69. casedev/resources/vault/vault.py +764 -0
  70. casedev/resources/voice/__init__.py +61 -0
  71. casedev/resources/voice/streaming.py +160 -0
  72. casedev/resources/voice/transcription.py +327 -0
  73. casedev/resources/voice/v1/__init__.py +33 -0
  74. casedev/resources/voice/v1/speak.py +478 -0
  75. casedev/resources/voice/v1/v1.py +290 -0
  76. casedev/resources/voice/voice.py +166 -0
  77. casedev/resources/webhooks/__init__.py +33 -0
  78. casedev/resources/webhooks/v1.py +447 -0
  79. casedev/resources/webhooks/webhooks.py +102 -0
  80. casedev/resources/workflows/__init__.py +33 -0
  81. casedev/resources/workflows/v1.py +1053 -0
  82. casedev/resources/workflows/workflows.py +102 -0
  83. casedev/types/__init__.py +12 -0
  84. casedev/types/actions/__init__.py +8 -0
  85. casedev/types/actions/v1_create_params.py +22 -0
  86. casedev/types/actions/v1_create_response.py +33 -0
  87. casedev/types/actions/v1_execute_params.py +16 -0
  88. casedev/types/actions/v1_execute_response.py +31 -0
  89. casedev/types/compute/__init__.py +7 -0
  90. casedev/types/compute/v1/__init__.py +18 -0
  91. casedev/types/compute/v1/environment_create_params.py +12 -0
  92. casedev/types/compute/v1/environment_create_response.py +34 -0
  93. casedev/types/compute/v1/environment_delete_response.py +11 -0
  94. casedev/types/compute/v1/function_get_logs_params.py +12 -0
  95. casedev/types/compute/v1/function_list_params.py +12 -0
  96. casedev/types/compute/v1/invoke_run_params.py +21 -0
  97. casedev/types/compute/v1/invoke_run_response.py +39 -0
  98. casedev/types/compute/v1/run_list_params.py +18 -0
  99. casedev/types/compute/v1/secret_create_params.py +24 -0
  100. casedev/types/compute/v1/secret_create_response.py +24 -0
  101. casedev/types/compute/v1/secret_delete_group_params.py +18 -0
  102. casedev/types/compute/v1/secret_list_params.py +15 -0
  103. casedev/types/compute/v1/secret_retrieve_group_params.py +12 -0
  104. casedev/types/compute/v1/secret_update_group_params.py +16 -0
  105. casedev/types/compute/v1_deploy_params.py +114 -0
  106. casedev/types/compute/v1_deploy_response.py +30 -0
  107. casedev/types/compute/v1_get_usage_params.py +15 -0
  108. casedev/types/convert/__init__.py +8 -0
  109. casedev/types/convert/v1/__init__.py +3 -0
  110. casedev/types/convert/v1_process_params.py +15 -0
  111. casedev/types/convert/v1_process_response.py +19 -0
  112. casedev/types/convert/v1_webhook_params.py +32 -0
  113. casedev/types/convert/v1_webhook_response.py +13 -0
  114. casedev/types/format/__init__.py +5 -0
  115. casedev/types/format/v1/__init__.py +7 -0
  116. casedev/types/format/v1/template_create_params.py +32 -0
  117. casedev/types/format/v1/template_create_response.py +27 -0
  118. casedev/types/format/v1/template_list_params.py +12 -0
  119. casedev/types/format/v1_create_document_params.py +42 -0
  120. casedev/types/llm/__init__.py +5 -0
  121. casedev/types/llm/v1/__init__.py +6 -0
  122. casedev/types/llm/v1/chat_create_completion_params.py +42 -0
  123. casedev/types/llm/v1/chat_create_completion_response.py +49 -0
  124. casedev/types/llm/v1_create_embedding_params.py +27 -0
  125. casedev/types/ocr/__init__.py +6 -0
  126. casedev/types/ocr/v1_process_params.py +44 -0
  127. casedev/types/ocr/v1_process_response.py +32 -0
  128. casedev/types/search/__init__.py +15 -0
  129. casedev/types/search/v1_answer_params.py +45 -0
  130. casedev/types/search/v1_answer_response.py +35 -0
  131. casedev/types/search/v1_contents_params.py +42 -0
  132. casedev/types/search/v1_contents_response.py +31 -0
  133. casedev/types/search/v1_research_params.py +23 -0
  134. casedev/types/search/v1_research_response.py +20 -0
  135. casedev/types/search/v1_retrieve_research_params.py +15 -0
  136. casedev/types/search/v1_search_params.py +56 -0
  137. casedev/types/search/v1_search_response.py +38 -0
  138. casedev/types/search/v1_similar_params.py +44 -0
  139. casedev/types/search/v1_similar_response.py +33 -0
  140. casedev/types/templates/__init__.py +8 -0
  141. casedev/types/templates/v1_execute_params.py +22 -0
  142. casedev/types/templates/v1_execute_response.py +31 -0
  143. casedev/types/templates/v1_list_params.py +32 -0
  144. casedev/types/templates/v1_search_params.py +18 -0
  145. casedev/types/vault/__init__.py +6 -0
  146. casedev/types/vault/object_create_presigned_url_params.py +22 -0
  147. casedev/types/vault/object_create_presigned_url_response.py +51 -0
  148. casedev/types/vault_create_params.py +20 -0
  149. casedev/types/vault_create_response.py +36 -0
  150. casedev/types/vault_ingest_response.py +26 -0
  151. casedev/types/vault_list_response.py +40 -0
  152. casedev/types/vault_search_params.py +27 -0
  153. casedev/types/vault_search_response.py +53 -0
  154. casedev/types/vault_upload_params.py +26 -0
  155. casedev/types/vault_upload_response.py +39 -0
  156. casedev/types/voice/__init__.py +7 -0
  157. casedev/types/voice/transcription_create_params.py +36 -0
  158. casedev/types/voice/transcription_retrieve_response.py +41 -0
  159. casedev/types/voice/v1/__init__.py +6 -0
  160. casedev/types/voice/v1/speak_create_params.py +59 -0
  161. casedev/types/voice/v1/speak_stream_params.py +58 -0
  162. casedev/types/voice/v1_list_voices_params.py +36 -0
  163. casedev/types/webhooks/__init__.py +6 -0
  164. casedev/types/webhooks/v1_create_params.py +20 -0
  165. casedev/types/webhooks/v1_create_response.py +33 -0
  166. casedev/types/workflows/__init__.py +19 -0
  167. casedev/types/workflows/v1_create_params.py +32 -0
  168. casedev/types/workflows/v1_create_response.py +29 -0
  169. casedev/types/workflows/v1_delete_response.py +13 -0
  170. casedev/types/workflows/v1_deploy_response.py +20 -0
  171. casedev/types/workflows/v1_execute_params.py +12 -0
  172. casedev/types/workflows/v1_execute_response.py +22 -0
  173. casedev/types/workflows/v1_list_executions_params.py +13 -0
  174. casedev/types/workflows/v1_list_executions_response.py +27 -0
  175. casedev/types/workflows/v1_list_params.py +18 -0
  176. casedev/types/workflows/v1_list_response.py +37 -0
  177. casedev/types/workflows/v1_retrieve_execution_response.py +31 -0
  178. casedev/types/workflows/v1_retrieve_response.py +35 -0
  179. casedev/types/workflows/v1_undeploy_response.py +13 -0
  180. casedev/types/workflows/v1_update_params.py +26 -0
  181. casedev/types/workflows/v1_update_response.py +17 -0
  182. casedev-0.1.0.dist-info/METADATA +454 -0
  183. casedev-0.1.0.dist-info/RECORD +185 -0
  184. casedev-0.1.0.dist-info/WHEEL +4 -0
  185. casedev-0.1.0.dist-info/licenses/LICENSE +201 -0
@@ -0,0 +1,61 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from .v1 import (
4
+ V1Resource,
5
+ AsyncV1Resource,
6
+ V1ResourceWithRawResponse,
7
+ AsyncV1ResourceWithRawResponse,
8
+ V1ResourceWithStreamingResponse,
9
+ AsyncV1ResourceWithStreamingResponse,
10
+ )
11
+ from .voice import (
12
+ VoiceResource,
13
+ AsyncVoiceResource,
14
+ VoiceResourceWithRawResponse,
15
+ AsyncVoiceResourceWithRawResponse,
16
+ VoiceResourceWithStreamingResponse,
17
+ AsyncVoiceResourceWithStreamingResponse,
18
+ )
19
+ from .streaming import (
20
+ StreamingResource,
21
+ AsyncStreamingResource,
22
+ StreamingResourceWithRawResponse,
23
+ AsyncStreamingResourceWithRawResponse,
24
+ StreamingResourceWithStreamingResponse,
25
+ AsyncStreamingResourceWithStreamingResponse,
26
+ )
27
+ from .transcription import (
28
+ TranscriptionResource,
29
+ AsyncTranscriptionResource,
30
+ TranscriptionResourceWithRawResponse,
31
+ AsyncTranscriptionResourceWithRawResponse,
32
+ TranscriptionResourceWithStreamingResponse,
33
+ AsyncTranscriptionResourceWithStreamingResponse,
34
+ )
35
+
36
+ __all__ = [
37
+ "StreamingResource",
38
+ "AsyncStreamingResource",
39
+ "StreamingResourceWithRawResponse",
40
+ "AsyncStreamingResourceWithRawResponse",
41
+ "StreamingResourceWithStreamingResponse",
42
+ "AsyncStreamingResourceWithStreamingResponse",
43
+ "TranscriptionResource",
44
+ "AsyncTranscriptionResource",
45
+ "TranscriptionResourceWithRawResponse",
46
+ "AsyncTranscriptionResourceWithRawResponse",
47
+ "TranscriptionResourceWithStreamingResponse",
48
+ "AsyncTranscriptionResourceWithStreamingResponse",
49
+ "V1Resource",
50
+ "AsyncV1Resource",
51
+ "V1ResourceWithRawResponse",
52
+ "AsyncV1ResourceWithRawResponse",
53
+ "V1ResourceWithStreamingResponse",
54
+ "AsyncV1ResourceWithStreamingResponse",
55
+ "VoiceResource",
56
+ "AsyncVoiceResource",
57
+ "VoiceResourceWithRawResponse",
58
+ "AsyncVoiceResourceWithRawResponse",
59
+ "VoiceResourceWithStreamingResponse",
60
+ "AsyncVoiceResourceWithStreamingResponse",
61
+ ]
@@ -0,0 +1,160 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ import httpx
6
+
7
+ from ..._types import Body, Query, Headers, NoneType, NotGiven, not_given
8
+ from ..._compat import cached_property
9
+ from ..._resource import SyncAPIResource, AsyncAPIResource
10
+ from ..._response import (
11
+ to_raw_response_wrapper,
12
+ to_streamed_response_wrapper,
13
+ async_to_raw_response_wrapper,
14
+ async_to_streamed_response_wrapper,
15
+ )
16
+ from ..._base_client import make_request_options
17
+
18
+ __all__ = ["StreamingResource", "AsyncStreamingResource"]
19
+
20
+
21
+ class StreamingResource(SyncAPIResource):
22
+ @cached_property
23
+ def with_raw_response(self) -> StreamingResourceWithRawResponse:
24
+ """
25
+ This property can be used as a prefix for any HTTP method call to return
26
+ the raw response object instead of the parsed content.
27
+
28
+ For more information, see https://www.github.com/CaseMark/casedev-python#accessing-raw-response-data-eg-headers
29
+ """
30
+ return StreamingResourceWithRawResponse(self)
31
+
32
+ @cached_property
33
+ def with_streaming_response(self) -> StreamingResourceWithStreamingResponse:
34
+ """
35
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
36
+
37
+ For more information, see https://www.github.com/CaseMark/casedev-python#with_streaming_response
38
+ """
39
+ return StreamingResourceWithStreamingResponse(self)
40
+
41
+ def get_url(
42
+ self,
43
+ *,
44
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
45
+ # The extra values given here take precedence over values defined on the client or passed to this method.
46
+ extra_headers: Headers | None = None,
47
+ extra_query: Query | None = None,
48
+ extra_body: Body | None = None,
49
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
50
+ ) -> None:
51
+ """
52
+ Returns the WebSocket URL and connection details for real-time audio
53
+ transcription. The returned URL can be used to establish a WebSocket connection
54
+ for streaming audio data and receiving transcribed text in real-time.
55
+
56
+ **Audio Requirements:**
57
+
58
+ - Sample Rate: 16kHz
59
+ - Encoding: PCM 16-bit little-endian
60
+ - Channels: Mono (1 channel)
61
+
62
+ **Pricing:** $0.30 per minute ($18.00 per hour)
63
+ """
64
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
65
+ return self._get(
66
+ "/voice/streaming/url",
67
+ options=make_request_options(
68
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
69
+ ),
70
+ cast_to=NoneType,
71
+ )
72
+
73
+
74
+ class AsyncStreamingResource(AsyncAPIResource):
75
+ @cached_property
76
+ def with_raw_response(self) -> AsyncStreamingResourceWithRawResponse:
77
+ """
78
+ This property can be used as a prefix for any HTTP method call to return
79
+ the raw response object instead of the parsed content.
80
+
81
+ For more information, see https://www.github.com/CaseMark/casedev-python#accessing-raw-response-data-eg-headers
82
+ """
83
+ return AsyncStreamingResourceWithRawResponse(self)
84
+
85
+ @cached_property
86
+ def with_streaming_response(self) -> AsyncStreamingResourceWithStreamingResponse:
87
+ """
88
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
89
+
90
+ For more information, see https://www.github.com/CaseMark/casedev-python#with_streaming_response
91
+ """
92
+ return AsyncStreamingResourceWithStreamingResponse(self)
93
+
94
+ async def get_url(
95
+ self,
96
+ *,
97
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
98
+ # The extra values given here take precedence over values defined on the client or passed to this method.
99
+ extra_headers: Headers | None = None,
100
+ extra_query: Query | None = None,
101
+ extra_body: Body | None = None,
102
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
103
+ ) -> None:
104
+ """
105
+ Returns the WebSocket URL and connection details for real-time audio
106
+ transcription. The returned URL can be used to establish a WebSocket connection
107
+ for streaming audio data and receiving transcribed text in real-time.
108
+
109
+ **Audio Requirements:**
110
+
111
+ - Sample Rate: 16kHz
112
+ - Encoding: PCM 16-bit little-endian
113
+ - Channels: Mono (1 channel)
114
+
115
+ **Pricing:** $0.30 per minute ($18.00 per hour)
116
+ """
117
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
118
+ return await self._get(
119
+ "/voice/streaming/url",
120
+ options=make_request_options(
121
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
122
+ ),
123
+ cast_to=NoneType,
124
+ )
125
+
126
+
127
+ class StreamingResourceWithRawResponse:
128
+ def __init__(self, streaming: StreamingResource) -> None:
129
+ self._streaming = streaming
130
+
131
+ self.get_url = to_raw_response_wrapper(
132
+ streaming.get_url,
133
+ )
134
+
135
+
136
+ class AsyncStreamingResourceWithRawResponse:
137
+ def __init__(self, streaming: AsyncStreamingResource) -> None:
138
+ self._streaming = streaming
139
+
140
+ self.get_url = async_to_raw_response_wrapper(
141
+ streaming.get_url,
142
+ )
143
+
144
+
145
+ class StreamingResourceWithStreamingResponse:
146
+ def __init__(self, streaming: StreamingResource) -> None:
147
+ self._streaming = streaming
148
+
149
+ self.get_url = to_streamed_response_wrapper(
150
+ streaming.get_url,
151
+ )
152
+
153
+
154
+ class AsyncStreamingResourceWithStreamingResponse:
155
+ def __init__(self, streaming: AsyncStreamingResource) -> None:
156
+ self._streaming = streaming
157
+
158
+ self.get_url = async_to_streamed_response_wrapper(
159
+ streaming.get_url,
160
+ )
@@ -0,0 +1,327 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ import httpx
6
+
7
+ from ..._types import Body, Omit, Query, Headers, NoneType, NotGiven, omit, not_given
8
+ from ..._utils import maybe_transform, async_maybe_transform
9
+ from ..._compat import cached_property
10
+ from ..._resource import SyncAPIResource, AsyncAPIResource
11
+ from ..._response import (
12
+ to_raw_response_wrapper,
13
+ to_streamed_response_wrapper,
14
+ async_to_raw_response_wrapper,
15
+ async_to_streamed_response_wrapper,
16
+ )
17
+ from ...types.voice import transcription_create_params
18
+ from ..._base_client import make_request_options
19
+ from ...types.voice.transcription_retrieve_response import TranscriptionRetrieveResponse
20
+
21
+ __all__ = ["TranscriptionResource", "AsyncTranscriptionResource"]
22
+
23
+
24
+ class TranscriptionResource(SyncAPIResource):
25
+ @cached_property
26
+ def with_raw_response(self) -> TranscriptionResourceWithRawResponse:
27
+ """
28
+ This property can be used as a prefix for any HTTP method call to return
29
+ the raw response object instead of the parsed content.
30
+
31
+ For more information, see https://www.github.com/CaseMark/casedev-python#accessing-raw-response-data-eg-headers
32
+ """
33
+ return TranscriptionResourceWithRawResponse(self)
34
+
35
+ @cached_property
36
+ def with_streaming_response(self) -> TranscriptionResourceWithStreamingResponse:
37
+ """
38
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
39
+
40
+ For more information, see https://www.github.com/CaseMark/casedev-python#with_streaming_response
41
+ """
42
+ return TranscriptionResourceWithStreamingResponse(self)
43
+
44
+ def create(
45
+ self,
46
+ *,
47
+ audio_url: str,
48
+ auto_highlights: bool | Omit = omit,
49
+ content_safety_labels: bool | Omit = omit,
50
+ format_text: bool | Omit = omit,
51
+ language_code: str | Omit = omit,
52
+ language_detection: bool | Omit = omit,
53
+ punctuate: bool | Omit = omit,
54
+ speaker_labels: bool | Omit = omit,
55
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
56
+ # The extra values given here take precedence over values defined on the client or passed to this method.
57
+ extra_headers: Headers | None = None,
58
+ extra_query: Query | None = None,
59
+ extra_body: Body | None = None,
60
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
61
+ ) -> None:
62
+ """Creates an asynchronous transcription job for audio files.
63
+
64
+ Supports various
65
+ audio formats and advanced features like speaker identification, content
66
+ moderation, and automatic highlights. Returns a job ID for checking
67
+ transcription status and retrieving results.
68
+
69
+ Args:
70
+ audio_url: URL of the audio file to transcribe
71
+
72
+ auto_highlights: Automatically extract key phrases and topics
73
+
74
+ content_safety_labels: Enable content moderation and safety labeling
75
+
76
+ format_text: Format text with proper capitalization
77
+
78
+ language_code: Language code (e.g., 'en_us', 'es', 'fr'). If not specified, language will be
79
+ auto-detected
80
+
81
+ language_detection: Enable automatic language detection
82
+
83
+ punctuate: Add punctuation to the transcript
84
+
85
+ speaker_labels: Enable speaker identification and labeling
86
+
87
+ extra_headers: Send extra headers
88
+
89
+ extra_query: Add additional query parameters to the request
90
+
91
+ extra_body: Add additional JSON properties to the request
92
+
93
+ timeout: Override the client-level default timeout for this request, in seconds
94
+ """
95
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
96
+ return self._post(
97
+ "/voice/transcription",
98
+ body=maybe_transform(
99
+ {
100
+ "audio_url": audio_url,
101
+ "auto_highlights": auto_highlights,
102
+ "content_safety_labels": content_safety_labels,
103
+ "format_text": format_text,
104
+ "language_code": language_code,
105
+ "language_detection": language_detection,
106
+ "punctuate": punctuate,
107
+ "speaker_labels": speaker_labels,
108
+ },
109
+ transcription_create_params.TranscriptionCreateParams,
110
+ ),
111
+ options=make_request_options(
112
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
113
+ ),
114
+ cast_to=NoneType,
115
+ )
116
+
117
+ def retrieve(
118
+ self,
119
+ id: str,
120
+ *,
121
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
122
+ # The extra values given here take precedence over values defined on the client or passed to this method.
123
+ extra_headers: Headers | None = None,
124
+ extra_query: Query | None = None,
125
+ extra_body: Body | None = None,
126
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
127
+ ) -> TranscriptionRetrieveResponse:
128
+ """Retrieve the status and result of an audio transcription job.
129
+
130
+ Returns the
131
+ transcription text when complete, or status information for pending jobs.
132
+
133
+ Args:
134
+ extra_headers: Send extra headers
135
+
136
+ extra_query: Add additional query parameters to the request
137
+
138
+ extra_body: Add additional JSON properties to the request
139
+
140
+ timeout: Override the client-level default timeout for this request, in seconds
141
+ """
142
+ if not id:
143
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
144
+ return self._get(
145
+ f"/voice/transcription/{id}",
146
+ options=make_request_options(
147
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
148
+ ),
149
+ cast_to=TranscriptionRetrieveResponse,
150
+ )
151
+
152
+
153
+ class AsyncTranscriptionResource(AsyncAPIResource):
154
+ @cached_property
155
+ def with_raw_response(self) -> AsyncTranscriptionResourceWithRawResponse:
156
+ """
157
+ This property can be used as a prefix for any HTTP method call to return
158
+ the raw response object instead of the parsed content.
159
+
160
+ For more information, see https://www.github.com/CaseMark/casedev-python#accessing-raw-response-data-eg-headers
161
+ """
162
+ return AsyncTranscriptionResourceWithRawResponse(self)
163
+
164
+ @cached_property
165
+ def with_streaming_response(self) -> AsyncTranscriptionResourceWithStreamingResponse:
166
+ """
167
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
168
+
169
+ For more information, see https://www.github.com/CaseMark/casedev-python#with_streaming_response
170
+ """
171
+ return AsyncTranscriptionResourceWithStreamingResponse(self)
172
+
173
+ async def create(
174
+ self,
175
+ *,
176
+ audio_url: str,
177
+ auto_highlights: bool | Omit = omit,
178
+ content_safety_labels: bool | Omit = omit,
179
+ format_text: bool | Omit = omit,
180
+ language_code: str | Omit = omit,
181
+ language_detection: bool | Omit = omit,
182
+ punctuate: bool | Omit = omit,
183
+ speaker_labels: bool | Omit = omit,
184
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
185
+ # The extra values given here take precedence over values defined on the client or passed to this method.
186
+ extra_headers: Headers | None = None,
187
+ extra_query: Query | None = None,
188
+ extra_body: Body | None = None,
189
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
190
+ ) -> None:
191
+ """Creates an asynchronous transcription job for audio files.
192
+
193
+ Supports various
194
+ audio formats and advanced features like speaker identification, content
195
+ moderation, and automatic highlights. Returns a job ID for checking
196
+ transcription status and retrieving results.
197
+
198
+ Args:
199
+ audio_url: URL of the audio file to transcribe
200
+
201
+ auto_highlights: Automatically extract key phrases and topics
202
+
203
+ content_safety_labels: Enable content moderation and safety labeling
204
+
205
+ format_text: Format text with proper capitalization
206
+
207
+ language_code: Language code (e.g., 'en_us', 'es', 'fr'). If not specified, language will be
208
+ auto-detected
209
+
210
+ language_detection: Enable automatic language detection
211
+
212
+ punctuate: Add punctuation to the transcript
213
+
214
+ speaker_labels: Enable speaker identification and labeling
215
+
216
+ extra_headers: Send extra headers
217
+
218
+ extra_query: Add additional query parameters to the request
219
+
220
+ extra_body: Add additional JSON properties to the request
221
+
222
+ timeout: Override the client-level default timeout for this request, in seconds
223
+ """
224
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
225
+ return await self._post(
226
+ "/voice/transcription",
227
+ body=await async_maybe_transform(
228
+ {
229
+ "audio_url": audio_url,
230
+ "auto_highlights": auto_highlights,
231
+ "content_safety_labels": content_safety_labels,
232
+ "format_text": format_text,
233
+ "language_code": language_code,
234
+ "language_detection": language_detection,
235
+ "punctuate": punctuate,
236
+ "speaker_labels": speaker_labels,
237
+ },
238
+ transcription_create_params.TranscriptionCreateParams,
239
+ ),
240
+ options=make_request_options(
241
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
242
+ ),
243
+ cast_to=NoneType,
244
+ )
245
+
246
+ async def retrieve(
247
+ self,
248
+ id: str,
249
+ *,
250
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
251
+ # The extra values given here take precedence over values defined on the client or passed to this method.
252
+ extra_headers: Headers | None = None,
253
+ extra_query: Query | None = None,
254
+ extra_body: Body | None = None,
255
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
256
+ ) -> TranscriptionRetrieveResponse:
257
+ """Retrieve the status and result of an audio transcription job.
258
+
259
+ Returns the
260
+ transcription text when complete, or status information for pending jobs.
261
+
262
+ Args:
263
+ extra_headers: Send extra headers
264
+
265
+ extra_query: Add additional query parameters to the request
266
+
267
+ extra_body: Add additional JSON properties to the request
268
+
269
+ timeout: Override the client-level default timeout for this request, in seconds
270
+ """
271
+ if not id:
272
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
273
+ return await self._get(
274
+ f"/voice/transcription/{id}",
275
+ options=make_request_options(
276
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
277
+ ),
278
+ cast_to=TranscriptionRetrieveResponse,
279
+ )
280
+
281
+
282
+ class TranscriptionResourceWithRawResponse:
283
+ def __init__(self, transcription: TranscriptionResource) -> None:
284
+ self._transcription = transcription
285
+
286
+ self.create = to_raw_response_wrapper(
287
+ transcription.create,
288
+ )
289
+ self.retrieve = to_raw_response_wrapper(
290
+ transcription.retrieve,
291
+ )
292
+
293
+
294
+ class AsyncTranscriptionResourceWithRawResponse:
295
+ def __init__(self, transcription: AsyncTranscriptionResource) -> None:
296
+ self._transcription = transcription
297
+
298
+ self.create = async_to_raw_response_wrapper(
299
+ transcription.create,
300
+ )
301
+ self.retrieve = async_to_raw_response_wrapper(
302
+ transcription.retrieve,
303
+ )
304
+
305
+
306
+ class TranscriptionResourceWithStreamingResponse:
307
+ def __init__(self, transcription: TranscriptionResource) -> None:
308
+ self._transcription = transcription
309
+
310
+ self.create = to_streamed_response_wrapper(
311
+ transcription.create,
312
+ )
313
+ self.retrieve = to_streamed_response_wrapper(
314
+ transcription.retrieve,
315
+ )
316
+
317
+
318
+ class AsyncTranscriptionResourceWithStreamingResponse:
319
+ def __init__(self, transcription: AsyncTranscriptionResource) -> None:
320
+ self._transcription = transcription
321
+
322
+ self.create = async_to_streamed_response_wrapper(
323
+ transcription.create,
324
+ )
325
+ self.retrieve = async_to_streamed_response_wrapper(
326
+ transcription.retrieve,
327
+ )
@@ -0,0 +1,33 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from .v1 import (
4
+ V1Resource,
5
+ AsyncV1Resource,
6
+ V1ResourceWithRawResponse,
7
+ AsyncV1ResourceWithRawResponse,
8
+ V1ResourceWithStreamingResponse,
9
+ AsyncV1ResourceWithStreamingResponse,
10
+ )
11
+ from .speak import (
12
+ SpeakResource,
13
+ AsyncSpeakResource,
14
+ SpeakResourceWithRawResponse,
15
+ AsyncSpeakResourceWithRawResponse,
16
+ SpeakResourceWithStreamingResponse,
17
+ AsyncSpeakResourceWithStreamingResponse,
18
+ )
19
+
20
+ __all__ = [
21
+ "SpeakResource",
22
+ "AsyncSpeakResource",
23
+ "SpeakResourceWithRawResponse",
24
+ "AsyncSpeakResourceWithRawResponse",
25
+ "SpeakResourceWithStreamingResponse",
26
+ "AsyncSpeakResourceWithStreamingResponse",
27
+ "V1Resource",
28
+ "AsyncV1Resource",
29
+ "V1ResourceWithRawResponse",
30
+ "AsyncV1ResourceWithRawResponse",
31
+ "V1ResourceWithStreamingResponse",
32
+ "AsyncV1ResourceWithStreamingResponse",
33
+ ]