casedev 0.1.0__py3-none-any.whl → 0.2.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 (135) hide show
  1. casedev/_base_client.py +140 -11
  2. casedev/_client.py +290 -119
  3. casedev/_models.py +16 -1
  4. casedev/_types.py +12 -2
  5. casedev/_version.py +1 -1
  6. casedev/resources/__init__.py +0 -70
  7. casedev/resources/compute/v1/__init__.py +0 -42
  8. casedev/resources/compute/v1/environments.py +16 -19
  9. casedev/resources/compute/v1/secrets.py +35 -41
  10. casedev/resources/compute/v1/v1.py +14 -276
  11. casedev/resources/format/v1/templates.py +11 -13
  12. casedev/resources/llm/llm.py +6 -7
  13. casedev/resources/llm/v1/v1.py +11 -13
  14. casedev/resources/ocr/v1.py +10 -13
  15. casedev/resources/search/v1.py +6 -7
  16. casedev/resources/vault/graphrag.py +11 -13
  17. casedev/resources/vault/objects.py +20 -25
  18. casedev/resources/vault/vault.py +64 -28
  19. casedev/resources/voice/streaming.py +6 -7
  20. casedev/resources/voice/transcription.py +82 -23
  21. casedev/resources/voice/v1/speak.py +1 -195
  22. casedev/resources/voice/v1/v1.py +6 -7
  23. casedev/types/__init__.py +2 -0
  24. casedev/types/compute/__init__.py +1 -2
  25. casedev/types/compute/v1/__init__.py +7 -5
  26. casedev/types/compute/v1/environment_list_response.py +40 -0
  27. casedev/types/compute/v1/environment_retrieve_response.py +36 -0
  28. casedev/types/compute/v1/environment_set_default_response.py +36 -0
  29. casedev/types/{convert/v1_webhook_response.py → compute/v1/secret_delete_group_response.py} +3 -3
  30. casedev/types/compute/v1/secret_list_response.py +31 -0
  31. casedev/types/compute/v1/secret_retrieve_group_response.py +38 -0
  32. casedev/types/compute/v1/secret_update_group_response.py +22 -0
  33. casedev/types/compute/v1_get_usage_response.py +51 -0
  34. casedev/types/format/v1/__init__.py +2 -0
  35. casedev/types/format/v1/template_list_response.py +40 -0
  36. casedev/types/format/v1/template_retrieve_response.py +33 -0
  37. casedev/types/llm/__init__.py +2 -0
  38. casedev/types/llm/v1_create_embedding_response.py +31 -0
  39. casedev/types/llm/v1_list_models_response.py +41 -0
  40. casedev/types/llm_get_config_response.py +33 -0
  41. casedev/types/ocr/__init__.py +2 -0
  42. casedev/types/ocr/v1_download_response.py +7 -0
  43. casedev/types/ocr/v1_process_params.py +2 -0
  44. casedev/types/ocr/v1_retrieve_response.py +32 -0
  45. casedev/types/search/__init__.py +1 -0
  46. casedev/types/search/v1_retrieve_research_response.py +74 -0
  47. casedev/types/vault/__init__.py +6 -0
  48. casedev/types/vault/graphrag_get_stats_response.py +31 -0
  49. casedev/types/{workflows/v1_delete_response.py → vault/graphrag_init_response.py} +6 -2
  50. casedev/types/vault/object_download_response.py +7 -0
  51. casedev/types/vault/object_get_text_response.py +35 -0
  52. casedev/types/vault/object_list_response.py +64 -0
  53. casedev/types/vault/object_retrieve_response.py +57 -0
  54. casedev/types/vault_create_params.py +16 -1
  55. casedev/types/vault_create_response.py +5 -2
  56. casedev/types/vault_ingest_response.py +15 -5
  57. casedev/types/vault_retrieve_response.py +76 -0
  58. casedev/types/vault_search_params.py +19 -5
  59. casedev/types/vault_search_response.py +25 -1
  60. casedev/types/vault_upload_params.py +7 -0
  61. casedev/types/vault_upload_response.py +6 -0
  62. casedev/types/voice/__init__.py +3 -0
  63. casedev/types/voice/streaming_get_url_response.py +44 -0
  64. casedev/types/voice/transcription_create_params.py +23 -3
  65. casedev/types/voice/transcription_create_response.py +22 -0
  66. casedev/types/voice/transcription_retrieve_response.py +19 -17
  67. casedev/types/voice/v1/__init__.py +0 -1
  68. casedev/types/voice/v1/speak_create_params.py +2 -0
  69. casedev/types/voice/v1_list_voices_response.py +40 -0
  70. casedev/types/webhooks/__init__.py +0 -3
  71. {casedev-0.1.0.dist-info → casedev-0.2.0.dist-info}/METADATA +10 -13
  72. casedev-0.2.0.dist-info/RECORD +149 -0
  73. {casedev-0.1.0.dist-info → casedev-0.2.0.dist-info}/licenses/LICENSE +1 -1
  74. casedev/resources/actions/__init__.py +0 -33
  75. casedev/resources/actions/actions.py +0 -102
  76. casedev/resources/actions/v1.py +0 -640
  77. casedev/resources/compute/v1/functions.py +0 -278
  78. casedev/resources/compute/v1/invoke.py +0 -216
  79. casedev/resources/compute/v1/runs.py +0 -290
  80. casedev/resources/convert/__init__.py +0 -33
  81. casedev/resources/convert/convert.py +0 -102
  82. casedev/resources/convert/v1/__init__.py +0 -33
  83. casedev/resources/convert/v1/jobs.py +0 -254
  84. casedev/resources/convert/v1/v1.py +0 -450
  85. casedev/resources/templates/__init__.py +0 -33
  86. casedev/resources/templates/templates.py +0 -102
  87. casedev/resources/templates/v1.py +0 -633
  88. casedev/resources/webhooks/__init__.py +0 -33
  89. casedev/resources/webhooks/v1.py +0 -447
  90. casedev/resources/webhooks/webhooks.py +0 -102
  91. casedev/resources/workflows/__init__.py +0 -33
  92. casedev/resources/workflows/v1.py +0 -1053
  93. casedev/resources/workflows/workflows.py +0 -102
  94. casedev/types/actions/__init__.py +0 -8
  95. casedev/types/actions/v1_create_params.py +0 -22
  96. casedev/types/actions/v1_create_response.py +0 -33
  97. casedev/types/actions/v1_execute_params.py +0 -16
  98. casedev/types/actions/v1_execute_response.py +0 -31
  99. casedev/types/compute/v1/function_get_logs_params.py +0 -12
  100. casedev/types/compute/v1/function_list_params.py +0 -12
  101. casedev/types/compute/v1/invoke_run_params.py +0 -21
  102. casedev/types/compute/v1/invoke_run_response.py +0 -39
  103. casedev/types/compute/v1/run_list_params.py +0 -18
  104. casedev/types/compute/v1_deploy_params.py +0 -114
  105. casedev/types/compute/v1_deploy_response.py +0 -30
  106. casedev/types/convert/__init__.py +0 -8
  107. casedev/types/convert/v1/__init__.py +0 -3
  108. casedev/types/convert/v1_process_params.py +0 -15
  109. casedev/types/convert/v1_process_response.py +0 -19
  110. casedev/types/convert/v1_webhook_params.py +0 -32
  111. casedev/types/templates/__init__.py +0 -8
  112. casedev/types/templates/v1_execute_params.py +0 -22
  113. casedev/types/templates/v1_execute_response.py +0 -31
  114. casedev/types/templates/v1_list_params.py +0 -32
  115. casedev/types/templates/v1_search_params.py +0 -18
  116. casedev/types/voice/v1/speak_stream_params.py +0 -58
  117. casedev/types/webhooks/v1_create_params.py +0 -20
  118. casedev/types/webhooks/v1_create_response.py +0 -33
  119. casedev/types/workflows/__init__.py +0 -19
  120. casedev/types/workflows/v1_create_params.py +0 -32
  121. casedev/types/workflows/v1_create_response.py +0 -29
  122. casedev/types/workflows/v1_deploy_response.py +0 -20
  123. casedev/types/workflows/v1_execute_params.py +0 -12
  124. casedev/types/workflows/v1_execute_response.py +0 -22
  125. casedev/types/workflows/v1_list_executions_params.py +0 -13
  126. casedev/types/workflows/v1_list_executions_response.py +0 -27
  127. casedev/types/workflows/v1_list_params.py +0 -18
  128. casedev/types/workflows/v1_list_response.py +0 -37
  129. casedev/types/workflows/v1_retrieve_execution_response.py +0 -31
  130. casedev/types/workflows/v1_retrieve_response.py +0 -35
  131. casedev/types/workflows/v1_undeploy_response.py +0 -13
  132. casedev/types/workflows/v1_update_params.py +0 -26
  133. casedev/types/workflows/v1_update_response.py +0 -17
  134. casedev-0.1.0.dist-info/RECORD +0 -185
  135. {casedev-0.1.0.dist-info → casedev-0.2.0.dist-info}/WHEEL +0 -0
@@ -1,278 +0,0 @@
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 ...._base_client import make_request_options
18
- from ....types.compute.v1 import function_list_params, function_get_logs_params
19
-
20
- __all__ = ["FunctionsResource", "AsyncFunctionsResource"]
21
-
22
-
23
- class FunctionsResource(SyncAPIResource):
24
- @cached_property
25
- def with_raw_response(self) -> FunctionsResourceWithRawResponse:
26
- """
27
- This property can be used as a prefix for any HTTP method call to return
28
- the raw response object instead of the parsed content.
29
-
30
- For more information, see https://www.github.com/CaseMark/casedev-python#accessing-raw-response-data-eg-headers
31
- """
32
- return FunctionsResourceWithRawResponse(self)
33
-
34
- @cached_property
35
- def with_streaming_response(self) -> FunctionsResourceWithStreamingResponse:
36
- """
37
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
38
-
39
- For more information, see https://www.github.com/CaseMark/casedev-python#with_streaming_response
40
- """
41
- return FunctionsResourceWithStreamingResponse(self)
42
-
43
- def list(
44
- self,
45
- *,
46
- env: str | Omit = omit,
47
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
48
- # The extra values given here take precedence over values defined on the client or passed to this method.
49
- extra_headers: Headers | None = None,
50
- extra_query: Query | None = None,
51
- extra_body: Body | None = None,
52
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
53
- ) -> None:
54
- """
55
- Retrieves all serverless functions deployed in a specified compute environment.
56
- Functions can be used for custom document processing, AI model inference, or
57
- other computational tasks in legal workflows.
58
-
59
- Args:
60
- env: Environment name. If not specified, uses the default environment.
61
-
62
- extra_headers: Send extra headers
63
-
64
- extra_query: Add additional query parameters to the request
65
-
66
- extra_body: Add additional JSON properties to the request
67
-
68
- timeout: Override the client-level default timeout for this request, in seconds
69
- """
70
- extra_headers = {"Accept": "*/*", **(extra_headers or {})}
71
- return self._get(
72
- "/compute/v1/functions",
73
- options=make_request_options(
74
- extra_headers=extra_headers,
75
- extra_query=extra_query,
76
- extra_body=extra_body,
77
- timeout=timeout,
78
- query=maybe_transform({"env": env}, function_list_params.FunctionListParams),
79
- ),
80
- cast_to=NoneType,
81
- )
82
-
83
- def get_logs(
84
- self,
85
- id: str,
86
- *,
87
- tail: int | Omit = omit,
88
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
89
- # The extra values given here take precedence over values defined on the client or passed to this method.
90
- extra_headers: Headers | None = None,
91
- extra_query: Query | None = None,
92
- extra_body: Body | None = None,
93
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
94
- ) -> None:
95
- """Retrieve execution logs from a deployed serverless function.
96
-
97
- Logs include
98
- function output, errors, and runtime information. Useful for debugging and
99
- monitoring function performance in production.
100
-
101
- Args:
102
- tail: Number of log lines to retrieve (default 200, max 1000)
103
-
104
- extra_headers: Send extra headers
105
-
106
- extra_query: Add additional query parameters to the request
107
-
108
- extra_body: Add additional JSON properties to the request
109
-
110
- timeout: Override the client-level default timeout for this request, in seconds
111
- """
112
- if not id:
113
- raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
114
- extra_headers = {"Accept": "*/*", **(extra_headers or {})}
115
- return self._get(
116
- f"/compute/v1/functions/{id}/logs",
117
- options=make_request_options(
118
- extra_headers=extra_headers,
119
- extra_query=extra_query,
120
- extra_body=extra_body,
121
- timeout=timeout,
122
- query=maybe_transform({"tail": tail}, function_get_logs_params.FunctionGetLogsParams),
123
- ),
124
- cast_to=NoneType,
125
- )
126
-
127
-
128
- class AsyncFunctionsResource(AsyncAPIResource):
129
- @cached_property
130
- def with_raw_response(self) -> AsyncFunctionsResourceWithRawResponse:
131
- """
132
- This property can be used as a prefix for any HTTP method call to return
133
- the raw response object instead of the parsed content.
134
-
135
- For more information, see https://www.github.com/CaseMark/casedev-python#accessing-raw-response-data-eg-headers
136
- """
137
- return AsyncFunctionsResourceWithRawResponse(self)
138
-
139
- @cached_property
140
- def with_streaming_response(self) -> AsyncFunctionsResourceWithStreamingResponse:
141
- """
142
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
143
-
144
- For more information, see https://www.github.com/CaseMark/casedev-python#with_streaming_response
145
- """
146
- return AsyncFunctionsResourceWithStreamingResponse(self)
147
-
148
- async def list(
149
- self,
150
- *,
151
- env: str | Omit = omit,
152
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
153
- # The extra values given here take precedence over values defined on the client or passed to this method.
154
- extra_headers: Headers | None = None,
155
- extra_query: Query | None = None,
156
- extra_body: Body | None = None,
157
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
158
- ) -> None:
159
- """
160
- Retrieves all serverless functions deployed in a specified compute environment.
161
- Functions can be used for custom document processing, AI model inference, or
162
- other computational tasks in legal workflows.
163
-
164
- Args:
165
- env: Environment name. If not specified, uses the default environment.
166
-
167
- extra_headers: Send extra headers
168
-
169
- extra_query: Add additional query parameters to the request
170
-
171
- extra_body: Add additional JSON properties to the request
172
-
173
- timeout: Override the client-level default timeout for this request, in seconds
174
- """
175
- extra_headers = {"Accept": "*/*", **(extra_headers or {})}
176
- return await self._get(
177
- "/compute/v1/functions",
178
- options=make_request_options(
179
- extra_headers=extra_headers,
180
- extra_query=extra_query,
181
- extra_body=extra_body,
182
- timeout=timeout,
183
- query=await async_maybe_transform({"env": env}, function_list_params.FunctionListParams),
184
- ),
185
- cast_to=NoneType,
186
- )
187
-
188
- async def get_logs(
189
- self,
190
- id: str,
191
- *,
192
- tail: int | Omit = omit,
193
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
194
- # The extra values given here take precedence over values defined on the client or passed to this method.
195
- extra_headers: Headers | None = None,
196
- extra_query: Query | None = None,
197
- extra_body: Body | None = None,
198
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
199
- ) -> None:
200
- """Retrieve execution logs from a deployed serverless function.
201
-
202
- Logs include
203
- function output, errors, and runtime information. Useful for debugging and
204
- monitoring function performance in production.
205
-
206
- Args:
207
- tail: Number of log lines to retrieve (default 200, max 1000)
208
-
209
- extra_headers: Send extra headers
210
-
211
- extra_query: Add additional query parameters to the request
212
-
213
- extra_body: Add additional JSON properties to the request
214
-
215
- timeout: Override the client-level default timeout for this request, in seconds
216
- """
217
- if not id:
218
- raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
219
- extra_headers = {"Accept": "*/*", **(extra_headers or {})}
220
- return await self._get(
221
- f"/compute/v1/functions/{id}/logs",
222
- options=make_request_options(
223
- extra_headers=extra_headers,
224
- extra_query=extra_query,
225
- extra_body=extra_body,
226
- timeout=timeout,
227
- query=await async_maybe_transform({"tail": tail}, function_get_logs_params.FunctionGetLogsParams),
228
- ),
229
- cast_to=NoneType,
230
- )
231
-
232
-
233
- class FunctionsResourceWithRawResponse:
234
- def __init__(self, functions: FunctionsResource) -> None:
235
- self._functions = functions
236
-
237
- self.list = to_raw_response_wrapper(
238
- functions.list,
239
- )
240
- self.get_logs = to_raw_response_wrapper(
241
- functions.get_logs,
242
- )
243
-
244
-
245
- class AsyncFunctionsResourceWithRawResponse:
246
- def __init__(self, functions: AsyncFunctionsResource) -> None:
247
- self._functions = functions
248
-
249
- self.list = async_to_raw_response_wrapper(
250
- functions.list,
251
- )
252
- self.get_logs = async_to_raw_response_wrapper(
253
- functions.get_logs,
254
- )
255
-
256
-
257
- class FunctionsResourceWithStreamingResponse:
258
- def __init__(self, functions: FunctionsResource) -> None:
259
- self._functions = functions
260
-
261
- self.list = to_streamed_response_wrapper(
262
- functions.list,
263
- )
264
- self.get_logs = to_streamed_response_wrapper(
265
- functions.get_logs,
266
- )
267
-
268
-
269
- class AsyncFunctionsResourceWithStreamingResponse:
270
- def __init__(self, functions: AsyncFunctionsResource) -> None:
271
- self._functions = functions
272
-
273
- self.list = async_to_streamed_response_wrapper(
274
- functions.list,
275
- )
276
- self.get_logs = async_to_streamed_response_wrapper(
277
- functions.get_logs,
278
- )
@@ -1,216 +0,0 @@
1
- # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
- from __future__ import annotations
4
-
5
- from typing import Any, Dict, cast
6
- from typing_extensions import Literal
7
-
8
- import httpx
9
-
10
- from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
11
- from ...._utils import maybe_transform, async_maybe_transform
12
- from ...._compat import cached_property
13
- from ...._resource import SyncAPIResource, AsyncAPIResource
14
- from ...._response import (
15
- to_raw_response_wrapper,
16
- to_streamed_response_wrapper,
17
- async_to_raw_response_wrapper,
18
- async_to_streamed_response_wrapper,
19
- )
20
- from ...._base_client import make_request_options
21
- from ....types.compute.v1 import invoke_run_params
22
- from ....types.compute.v1.invoke_run_response import InvokeRunResponse
23
-
24
- __all__ = ["InvokeResource", "AsyncInvokeResource"]
25
-
26
-
27
- class InvokeResource(SyncAPIResource):
28
- @cached_property
29
- def with_raw_response(self) -> InvokeResourceWithRawResponse:
30
- """
31
- This property can be used as a prefix for any HTTP method call to return
32
- the raw response object instead of the parsed content.
33
-
34
- For more information, see https://www.github.com/CaseMark/casedev-python#accessing-raw-response-data-eg-headers
35
- """
36
- return InvokeResourceWithRawResponse(self)
37
-
38
- @cached_property
39
- def with_streaming_response(self) -> InvokeResourceWithStreamingResponse:
40
- """
41
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
42
-
43
- For more information, see https://www.github.com/CaseMark/casedev-python#with_streaming_response
44
- """
45
- return InvokeResourceWithStreamingResponse(self)
46
-
47
- def run(
48
- self,
49
- function_id: str,
50
- *,
51
- input: Dict[str, object],
52
- async_: bool | Omit = omit,
53
- function_suffix: Literal["_modal", "_task", "_web", "_server"] | Omit = omit,
54
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
55
- # The extra values given here take precedence over values defined on the client or passed to this method.
56
- extra_headers: Headers | None = None,
57
- extra_query: Query | None = None,
58
- extra_body: Body | None = None,
59
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
60
- ) -> InvokeRunResponse:
61
- """Execute a deployed compute function with custom input data.
62
-
63
- Supports both
64
- synchronous and asynchronous execution modes. Functions can be invoked by ID or
65
- name and can process various types of input data for legal document analysis,
66
- data processing, or other computational tasks.
67
-
68
- Args:
69
- input: Input data to pass to the function
70
-
71
- async_: If true, returns immediately with run ID for background execution
72
-
73
- function_suffix: Override the auto-detected function suffix
74
-
75
- extra_headers: Send extra headers
76
-
77
- extra_query: Add additional query parameters to the request
78
-
79
- extra_body: Add additional JSON properties to the request
80
-
81
- timeout: Override the client-level default timeout for this request, in seconds
82
- """
83
- if not function_id:
84
- raise ValueError(f"Expected a non-empty value for `function_id` but received {function_id!r}")
85
- return cast(
86
- InvokeRunResponse,
87
- self._post(
88
- f"/compute/v1/invoke/{function_id}",
89
- body=maybe_transform(
90
- {
91
- "input": input,
92
- "async_": async_,
93
- "function_suffix": function_suffix,
94
- },
95
- invoke_run_params.InvokeRunParams,
96
- ),
97
- options=make_request_options(
98
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
99
- ),
100
- cast_to=cast(Any, InvokeRunResponse), # Union types cannot be passed in as arguments in the type system
101
- ),
102
- )
103
-
104
-
105
- class AsyncInvokeResource(AsyncAPIResource):
106
- @cached_property
107
- def with_raw_response(self) -> AsyncInvokeResourceWithRawResponse:
108
- """
109
- This property can be used as a prefix for any HTTP method call to return
110
- the raw response object instead of the parsed content.
111
-
112
- For more information, see https://www.github.com/CaseMark/casedev-python#accessing-raw-response-data-eg-headers
113
- """
114
- return AsyncInvokeResourceWithRawResponse(self)
115
-
116
- @cached_property
117
- def with_streaming_response(self) -> AsyncInvokeResourceWithStreamingResponse:
118
- """
119
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
120
-
121
- For more information, see https://www.github.com/CaseMark/casedev-python#with_streaming_response
122
- """
123
- return AsyncInvokeResourceWithStreamingResponse(self)
124
-
125
- async def run(
126
- self,
127
- function_id: str,
128
- *,
129
- input: Dict[str, object],
130
- async_: bool | Omit = omit,
131
- function_suffix: Literal["_modal", "_task", "_web", "_server"] | Omit = omit,
132
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
133
- # The extra values given here take precedence over values defined on the client or passed to this method.
134
- extra_headers: Headers | None = None,
135
- extra_query: Query | None = None,
136
- extra_body: Body | None = None,
137
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
138
- ) -> InvokeRunResponse:
139
- """Execute a deployed compute function with custom input data.
140
-
141
- Supports both
142
- synchronous and asynchronous execution modes. Functions can be invoked by ID or
143
- name and can process various types of input data for legal document analysis,
144
- data processing, or other computational tasks.
145
-
146
- Args:
147
- input: Input data to pass to the function
148
-
149
- async_: If true, returns immediately with run ID for background execution
150
-
151
- function_suffix: Override the auto-detected function suffix
152
-
153
- extra_headers: Send extra headers
154
-
155
- extra_query: Add additional query parameters to the request
156
-
157
- extra_body: Add additional JSON properties to the request
158
-
159
- timeout: Override the client-level default timeout for this request, in seconds
160
- """
161
- if not function_id:
162
- raise ValueError(f"Expected a non-empty value for `function_id` but received {function_id!r}")
163
- return cast(
164
- InvokeRunResponse,
165
- await self._post(
166
- f"/compute/v1/invoke/{function_id}",
167
- body=await async_maybe_transform(
168
- {
169
- "input": input,
170
- "async_": async_,
171
- "function_suffix": function_suffix,
172
- },
173
- invoke_run_params.InvokeRunParams,
174
- ),
175
- options=make_request_options(
176
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
177
- ),
178
- cast_to=cast(Any, InvokeRunResponse), # Union types cannot be passed in as arguments in the type system
179
- ),
180
- )
181
-
182
-
183
- class InvokeResourceWithRawResponse:
184
- def __init__(self, invoke: InvokeResource) -> None:
185
- self._invoke = invoke
186
-
187
- self.run = to_raw_response_wrapper(
188
- invoke.run,
189
- )
190
-
191
-
192
- class AsyncInvokeResourceWithRawResponse:
193
- def __init__(self, invoke: AsyncInvokeResource) -> None:
194
- self._invoke = invoke
195
-
196
- self.run = async_to_raw_response_wrapper(
197
- invoke.run,
198
- )
199
-
200
-
201
- class InvokeResourceWithStreamingResponse:
202
- def __init__(self, invoke: InvokeResource) -> None:
203
- self._invoke = invoke
204
-
205
- self.run = to_streamed_response_wrapper(
206
- invoke.run,
207
- )
208
-
209
-
210
- class AsyncInvokeResourceWithStreamingResponse:
211
- def __init__(self, invoke: AsyncInvokeResource) -> None:
212
- self._invoke = invoke
213
-
214
- self.run = async_to_streamed_response_wrapper(
215
- invoke.run,
216
- )