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,764 @@
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 Dict
6
+ from typing_extensions import Literal
7
+
8
+ import httpx
9
+
10
+ from ...types import vault_create_params, vault_search_params, vault_upload_params
11
+ from .objects import (
12
+ ObjectsResource,
13
+ AsyncObjectsResource,
14
+ ObjectsResourceWithRawResponse,
15
+ AsyncObjectsResourceWithRawResponse,
16
+ ObjectsResourceWithStreamingResponse,
17
+ AsyncObjectsResourceWithStreamingResponse,
18
+ )
19
+ from ..._types import Body, Omit, Query, Headers, NoneType, NotGiven, omit, not_given
20
+ from ..._utils import maybe_transform, async_maybe_transform
21
+ from .graphrag import (
22
+ GraphragResource,
23
+ AsyncGraphragResource,
24
+ GraphragResourceWithRawResponse,
25
+ AsyncGraphragResourceWithRawResponse,
26
+ GraphragResourceWithStreamingResponse,
27
+ AsyncGraphragResourceWithStreamingResponse,
28
+ )
29
+ from ..._compat import cached_property
30
+ from ..._resource import SyncAPIResource, AsyncAPIResource
31
+ from ..._response import (
32
+ to_raw_response_wrapper,
33
+ to_streamed_response_wrapper,
34
+ async_to_raw_response_wrapper,
35
+ async_to_streamed_response_wrapper,
36
+ )
37
+ from ..._base_client import make_request_options
38
+ from ...types.vault_list_response import VaultListResponse
39
+ from ...types.vault_create_response import VaultCreateResponse
40
+ from ...types.vault_ingest_response import VaultIngestResponse
41
+ from ...types.vault_search_response import VaultSearchResponse
42
+ from ...types.vault_upload_response import VaultUploadResponse
43
+
44
+ __all__ = ["VaultResource", "AsyncVaultResource"]
45
+
46
+
47
+ class VaultResource(SyncAPIResource):
48
+ @cached_property
49
+ def graphrag(self) -> GraphragResource:
50
+ return GraphragResource(self._client)
51
+
52
+ @cached_property
53
+ def objects(self) -> ObjectsResource:
54
+ return ObjectsResource(self._client)
55
+
56
+ @cached_property
57
+ def with_raw_response(self) -> VaultResourceWithRawResponse:
58
+ """
59
+ This property can be used as a prefix for any HTTP method call to return
60
+ the raw response object instead of the parsed content.
61
+
62
+ For more information, see https://www.github.com/CaseMark/casedev-python#accessing-raw-response-data-eg-headers
63
+ """
64
+ return VaultResourceWithRawResponse(self)
65
+
66
+ @cached_property
67
+ def with_streaming_response(self) -> VaultResourceWithStreamingResponse:
68
+ """
69
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
70
+
71
+ For more information, see https://www.github.com/CaseMark/casedev-python#with_streaming_response
72
+ """
73
+ return VaultResourceWithStreamingResponse(self)
74
+
75
+ def create(
76
+ self,
77
+ *,
78
+ name: str,
79
+ description: str | Omit = omit,
80
+ enable_graph: bool | Omit = omit,
81
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
82
+ # The extra values given here take precedence over values defined on the client or passed to this method.
83
+ extra_headers: Headers | None = None,
84
+ extra_query: Query | None = None,
85
+ extra_body: Body | None = None,
86
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
87
+ ) -> VaultCreateResponse:
88
+ """
89
+ Creates a new secure vault with dedicated S3 storage and vector search
90
+ capabilities. Each vault provides isolated document storage with semantic
91
+ search, OCR processing, and optional knowledge graph features for legal document
92
+ analysis and discovery.
93
+
94
+ Args:
95
+ name: Display name for the vault
96
+
97
+ description: Optional description of the vault's purpose
98
+
99
+ enable_graph: Enable knowledge graph for entity relationship mapping
100
+
101
+ extra_headers: Send extra headers
102
+
103
+ extra_query: Add additional query parameters to the request
104
+
105
+ extra_body: Add additional JSON properties to the request
106
+
107
+ timeout: Override the client-level default timeout for this request, in seconds
108
+ """
109
+ return self._post(
110
+ "/vault",
111
+ body=maybe_transform(
112
+ {
113
+ "name": name,
114
+ "description": description,
115
+ "enable_graph": enable_graph,
116
+ },
117
+ vault_create_params.VaultCreateParams,
118
+ ),
119
+ options=make_request_options(
120
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
121
+ ),
122
+ cast_to=VaultCreateResponse,
123
+ )
124
+
125
+ def retrieve(
126
+ self,
127
+ id: str,
128
+ *,
129
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
130
+ # The extra values given here take precedence over values defined on the client or passed to this method.
131
+ extra_headers: Headers | None = None,
132
+ extra_query: Query | None = None,
133
+ extra_body: Body | None = None,
134
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
135
+ ) -> None:
136
+ """
137
+ Retrieve detailed information about a specific vault, including storage
138
+ configuration, chunking strategy, and usage statistics. Returns vault metadata,
139
+ bucket information, and vector storage details.
140
+
141
+ Args:
142
+ extra_headers: Send extra headers
143
+
144
+ extra_query: Add additional query parameters to the request
145
+
146
+ extra_body: Add additional JSON properties to the request
147
+
148
+ timeout: Override the client-level default timeout for this request, in seconds
149
+ """
150
+ if not id:
151
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
152
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
153
+ return self._get(
154
+ f"/vault/{id}",
155
+ options=make_request_options(
156
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
157
+ ),
158
+ cast_to=NoneType,
159
+ )
160
+
161
+ def list(
162
+ self,
163
+ *,
164
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
165
+ # The extra values given here take precedence over values defined on the client or passed to this method.
166
+ extra_headers: Headers | None = None,
167
+ extra_query: Query | None = None,
168
+ extra_body: Body | None = None,
169
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
170
+ ) -> VaultListResponse:
171
+ """List all vaults for the authenticated organization.
172
+
173
+ Returns vault metadata
174
+ including storage configuration and usage statistics.
175
+ """
176
+ return self._get(
177
+ "/vault",
178
+ options=make_request_options(
179
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
180
+ ),
181
+ cast_to=VaultListResponse,
182
+ )
183
+
184
+ def ingest(
185
+ self,
186
+ object_id: str,
187
+ *,
188
+ id: str,
189
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
190
+ # The extra values given here take precedence over values defined on the client or passed to this method.
191
+ extra_headers: Headers | None = None,
192
+ extra_query: Query | None = None,
193
+ extra_body: Body | None = None,
194
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
195
+ ) -> VaultIngestResponse:
196
+ """
197
+ Triggers OCR ingestion workflow for a vault object to extract text, generate
198
+ chunks, and create embeddings. Processing happens asynchronously with GraphRAG
199
+ support if enabled on the vault. Returns immediately with workflow tracking
200
+ information.
201
+
202
+ Args:
203
+ extra_headers: Send extra headers
204
+
205
+ extra_query: Add additional query parameters to the request
206
+
207
+ extra_body: Add additional JSON properties to the request
208
+
209
+ timeout: Override the client-level default timeout for this request, in seconds
210
+ """
211
+ if not id:
212
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
213
+ if not object_id:
214
+ raise ValueError(f"Expected a non-empty value for `object_id` but received {object_id!r}")
215
+ return self._post(
216
+ f"/vault/{id}/ingest/{object_id}",
217
+ options=make_request_options(
218
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
219
+ ),
220
+ cast_to=VaultIngestResponse,
221
+ )
222
+
223
+ def search(
224
+ self,
225
+ id: str,
226
+ *,
227
+ query: str,
228
+ filters: Dict[str, object] | Omit = omit,
229
+ method: Literal["vector", "graph", "hybrid", "global", "local", "fast", "entity"] | Omit = omit,
230
+ top_k: int | Omit = omit,
231
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
232
+ # The extra values given here take precedence over values defined on the client or passed to this method.
233
+ extra_headers: Headers | None = None,
234
+ extra_query: Query | None = None,
235
+ extra_body: Body | None = None,
236
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
237
+ ) -> VaultSearchResponse:
238
+ """
239
+ Search across vault documents using multiple methods including hybrid vector +
240
+ graph search, GraphRAG global search, entity-based search, and fast similarity
241
+ search. Returns relevant documents and contextual answers based on the search
242
+ method.
243
+
244
+ Args:
245
+ query: Search query or question to find relevant documents
246
+
247
+ filters: Additional filters to apply to search results
248
+
249
+ method: Search method: 'global' for comprehensive questions, 'entity' for specific
250
+ entities, 'fast' for quick similarity search, 'hybrid' for combined approach
251
+
252
+ top_k: Maximum number of results to return
253
+
254
+ extra_headers: Send extra headers
255
+
256
+ extra_query: Add additional query parameters to the request
257
+
258
+ extra_body: Add additional JSON properties to the request
259
+
260
+ timeout: Override the client-level default timeout for this request, in seconds
261
+ """
262
+ if not id:
263
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
264
+ return self._post(
265
+ f"/vault/{id}/search",
266
+ body=maybe_transform(
267
+ {
268
+ "query": query,
269
+ "filters": filters,
270
+ "method": method,
271
+ "top_k": top_k,
272
+ },
273
+ vault_search_params.VaultSearchParams,
274
+ ),
275
+ options=make_request_options(
276
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
277
+ ),
278
+ cast_to=VaultSearchResponse,
279
+ )
280
+
281
+ def upload(
282
+ self,
283
+ id: str,
284
+ *,
285
+ content_type: str,
286
+ filename: str,
287
+ auto_index: bool | Omit = omit,
288
+ metadata: object | Omit = omit,
289
+ size_bytes: float | Omit = omit,
290
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
291
+ # The extra values given here take precedence over values defined on the client or passed to this method.
292
+ extra_headers: Headers | None = None,
293
+ extra_query: Query | None = None,
294
+ extra_body: Body | None = None,
295
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
296
+ ) -> VaultUploadResponse:
297
+ """
298
+ Generate a presigned URL for uploading files directly to a vault's S3 storage.
299
+ This endpoint creates a temporary upload URL that allows secure file uploads
300
+ without exposing credentials. Files can be automatically indexed for semantic
301
+ search or stored for manual processing.
302
+
303
+ Args:
304
+ content_type: MIME type of the file (e.g., application/pdf, image/jpeg)
305
+
306
+ filename: Name of the file to upload
307
+
308
+ auto_index: Whether to automatically process and index the file for search
309
+
310
+ metadata: Additional metadata to associate with the file
311
+
312
+ size_bytes: Estimated file size in bytes for cost calculation
313
+
314
+ extra_headers: Send extra headers
315
+
316
+ extra_query: Add additional query parameters to the request
317
+
318
+ extra_body: Add additional JSON properties to the request
319
+
320
+ timeout: Override the client-level default timeout for this request, in seconds
321
+ """
322
+ if not id:
323
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
324
+ return self._post(
325
+ f"/vault/{id}/upload",
326
+ body=maybe_transform(
327
+ {
328
+ "content_type": content_type,
329
+ "filename": filename,
330
+ "auto_index": auto_index,
331
+ "metadata": metadata,
332
+ "size_bytes": size_bytes,
333
+ },
334
+ vault_upload_params.VaultUploadParams,
335
+ ),
336
+ options=make_request_options(
337
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
338
+ ),
339
+ cast_to=VaultUploadResponse,
340
+ )
341
+
342
+
343
+ class AsyncVaultResource(AsyncAPIResource):
344
+ @cached_property
345
+ def graphrag(self) -> AsyncGraphragResource:
346
+ return AsyncGraphragResource(self._client)
347
+
348
+ @cached_property
349
+ def objects(self) -> AsyncObjectsResource:
350
+ return AsyncObjectsResource(self._client)
351
+
352
+ @cached_property
353
+ def with_raw_response(self) -> AsyncVaultResourceWithRawResponse:
354
+ """
355
+ This property can be used as a prefix for any HTTP method call to return
356
+ the raw response object instead of the parsed content.
357
+
358
+ For more information, see https://www.github.com/CaseMark/casedev-python#accessing-raw-response-data-eg-headers
359
+ """
360
+ return AsyncVaultResourceWithRawResponse(self)
361
+
362
+ @cached_property
363
+ def with_streaming_response(self) -> AsyncVaultResourceWithStreamingResponse:
364
+ """
365
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
366
+
367
+ For more information, see https://www.github.com/CaseMark/casedev-python#with_streaming_response
368
+ """
369
+ return AsyncVaultResourceWithStreamingResponse(self)
370
+
371
+ async def create(
372
+ self,
373
+ *,
374
+ name: str,
375
+ description: str | Omit = omit,
376
+ enable_graph: bool | Omit = omit,
377
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
378
+ # The extra values given here take precedence over values defined on the client or passed to this method.
379
+ extra_headers: Headers | None = None,
380
+ extra_query: Query | None = None,
381
+ extra_body: Body | None = None,
382
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
383
+ ) -> VaultCreateResponse:
384
+ """
385
+ Creates a new secure vault with dedicated S3 storage and vector search
386
+ capabilities. Each vault provides isolated document storage with semantic
387
+ search, OCR processing, and optional knowledge graph features for legal document
388
+ analysis and discovery.
389
+
390
+ Args:
391
+ name: Display name for the vault
392
+
393
+ description: Optional description of the vault's purpose
394
+
395
+ enable_graph: Enable knowledge graph for entity relationship mapping
396
+
397
+ extra_headers: Send extra headers
398
+
399
+ extra_query: Add additional query parameters to the request
400
+
401
+ extra_body: Add additional JSON properties to the request
402
+
403
+ timeout: Override the client-level default timeout for this request, in seconds
404
+ """
405
+ return await self._post(
406
+ "/vault",
407
+ body=await async_maybe_transform(
408
+ {
409
+ "name": name,
410
+ "description": description,
411
+ "enable_graph": enable_graph,
412
+ },
413
+ vault_create_params.VaultCreateParams,
414
+ ),
415
+ options=make_request_options(
416
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
417
+ ),
418
+ cast_to=VaultCreateResponse,
419
+ )
420
+
421
+ async def retrieve(
422
+ self,
423
+ id: str,
424
+ *,
425
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
426
+ # The extra values given here take precedence over values defined on the client or passed to this method.
427
+ extra_headers: Headers | None = None,
428
+ extra_query: Query | None = None,
429
+ extra_body: Body | None = None,
430
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
431
+ ) -> None:
432
+ """
433
+ Retrieve detailed information about a specific vault, including storage
434
+ configuration, chunking strategy, and usage statistics. Returns vault metadata,
435
+ bucket information, and vector storage details.
436
+
437
+ Args:
438
+ extra_headers: Send extra headers
439
+
440
+ extra_query: Add additional query parameters to the request
441
+
442
+ extra_body: Add additional JSON properties to the request
443
+
444
+ timeout: Override the client-level default timeout for this request, in seconds
445
+ """
446
+ if not id:
447
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
448
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
449
+ return await self._get(
450
+ f"/vault/{id}",
451
+ options=make_request_options(
452
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
453
+ ),
454
+ cast_to=NoneType,
455
+ )
456
+
457
+ async def list(
458
+ self,
459
+ *,
460
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
461
+ # The extra values given here take precedence over values defined on the client or passed to this method.
462
+ extra_headers: Headers | None = None,
463
+ extra_query: Query | None = None,
464
+ extra_body: Body | None = None,
465
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
466
+ ) -> VaultListResponse:
467
+ """List all vaults for the authenticated organization.
468
+
469
+ Returns vault metadata
470
+ including storage configuration and usage statistics.
471
+ """
472
+ return await self._get(
473
+ "/vault",
474
+ options=make_request_options(
475
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
476
+ ),
477
+ cast_to=VaultListResponse,
478
+ )
479
+
480
+ async def ingest(
481
+ self,
482
+ object_id: str,
483
+ *,
484
+ id: str,
485
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
486
+ # The extra values given here take precedence over values defined on the client or passed to this method.
487
+ extra_headers: Headers | None = None,
488
+ extra_query: Query | None = None,
489
+ extra_body: Body | None = None,
490
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
491
+ ) -> VaultIngestResponse:
492
+ """
493
+ Triggers OCR ingestion workflow for a vault object to extract text, generate
494
+ chunks, and create embeddings. Processing happens asynchronously with GraphRAG
495
+ support if enabled on the vault. Returns immediately with workflow tracking
496
+ information.
497
+
498
+ Args:
499
+ extra_headers: Send extra headers
500
+
501
+ extra_query: Add additional query parameters to the request
502
+
503
+ extra_body: Add additional JSON properties to the request
504
+
505
+ timeout: Override the client-level default timeout for this request, in seconds
506
+ """
507
+ if not id:
508
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
509
+ if not object_id:
510
+ raise ValueError(f"Expected a non-empty value for `object_id` but received {object_id!r}")
511
+ return await self._post(
512
+ f"/vault/{id}/ingest/{object_id}",
513
+ options=make_request_options(
514
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
515
+ ),
516
+ cast_to=VaultIngestResponse,
517
+ )
518
+
519
+ async def search(
520
+ self,
521
+ id: str,
522
+ *,
523
+ query: str,
524
+ filters: Dict[str, object] | Omit = omit,
525
+ method: Literal["vector", "graph", "hybrid", "global", "local", "fast", "entity"] | Omit = omit,
526
+ top_k: int | Omit = omit,
527
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
528
+ # The extra values given here take precedence over values defined on the client or passed to this method.
529
+ extra_headers: Headers | None = None,
530
+ extra_query: Query | None = None,
531
+ extra_body: Body | None = None,
532
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
533
+ ) -> VaultSearchResponse:
534
+ """
535
+ Search across vault documents using multiple methods including hybrid vector +
536
+ graph search, GraphRAG global search, entity-based search, and fast similarity
537
+ search. Returns relevant documents and contextual answers based on the search
538
+ method.
539
+
540
+ Args:
541
+ query: Search query or question to find relevant documents
542
+
543
+ filters: Additional filters to apply to search results
544
+
545
+ method: Search method: 'global' for comprehensive questions, 'entity' for specific
546
+ entities, 'fast' for quick similarity search, 'hybrid' for combined approach
547
+
548
+ top_k: Maximum number of results to return
549
+
550
+ extra_headers: Send extra headers
551
+
552
+ extra_query: Add additional query parameters to the request
553
+
554
+ extra_body: Add additional JSON properties to the request
555
+
556
+ timeout: Override the client-level default timeout for this request, in seconds
557
+ """
558
+ if not id:
559
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
560
+ return await self._post(
561
+ f"/vault/{id}/search",
562
+ body=await async_maybe_transform(
563
+ {
564
+ "query": query,
565
+ "filters": filters,
566
+ "method": method,
567
+ "top_k": top_k,
568
+ },
569
+ vault_search_params.VaultSearchParams,
570
+ ),
571
+ options=make_request_options(
572
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
573
+ ),
574
+ cast_to=VaultSearchResponse,
575
+ )
576
+
577
+ async def upload(
578
+ self,
579
+ id: str,
580
+ *,
581
+ content_type: str,
582
+ filename: str,
583
+ auto_index: bool | Omit = omit,
584
+ metadata: object | Omit = omit,
585
+ size_bytes: float | Omit = omit,
586
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
587
+ # The extra values given here take precedence over values defined on the client or passed to this method.
588
+ extra_headers: Headers | None = None,
589
+ extra_query: Query | None = None,
590
+ extra_body: Body | None = None,
591
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
592
+ ) -> VaultUploadResponse:
593
+ """
594
+ Generate a presigned URL for uploading files directly to a vault's S3 storage.
595
+ This endpoint creates a temporary upload URL that allows secure file uploads
596
+ without exposing credentials. Files can be automatically indexed for semantic
597
+ search or stored for manual processing.
598
+
599
+ Args:
600
+ content_type: MIME type of the file (e.g., application/pdf, image/jpeg)
601
+
602
+ filename: Name of the file to upload
603
+
604
+ auto_index: Whether to automatically process and index the file for search
605
+
606
+ metadata: Additional metadata to associate with the file
607
+
608
+ size_bytes: Estimated file size in bytes for cost calculation
609
+
610
+ extra_headers: Send extra headers
611
+
612
+ extra_query: Add additional query parameters to the request
613
+
614
+ extra_body: Add additional JSON properties to the request
615
+
616
+ timeout: Override the client-level default timeout for this request, in seconds
617
+ """
618
+ if not id:
619
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
620
+ return await self._post(
621
+ f"/vault/{id}/upload",
622
+ body=await async_maybe_transform(
623
+ {
624
+ "content_type": content_type,
625
+ "filename": filename,
626
+ "auto_index": auto_index,
627
+ "metadata": metadata,
628
+ "size_bytes": size_bytes,
629
+ },
630
+ vault_upload_params.VaultUploadParams,
631
+ ),
632
+ options=make_request_options(
633
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
634
+ ),
635
+ cast_to=VaultUploadResponse,
636
+ )
637
+
638
+
639
+ class VaultResourceWithRawResponse:
640
+ def __init__(self, vault: VaultResource) -> None:
641
+ self._vault = vault
642
+
643
+ self.create = to_raw_response_wrapper(
644
+ vault.create,
645
+ )
646
+ self.retrieve = to_raw_response_wrapper(
647
+ vault.retrieve,
648
+ )
649
+ self.list = to_raw_response_wrapper(
650
+ vault.list,
651
+ )
652
+ self.ingest = to_raw_response_wrapper(
653
+ vault.ingest,
654
+ )
655
+ self.search = to_raw_response_wrapper(
656
+ vault.search,
657
+ )
658
+ self.upload = to_raw_response_wrapper(
659
+ vault.upload,
660
+ )
661
+
662
+ @cached_property
663
+ def graphrag(self) -> GraphragResourceWithRawResponse:
664
+ return GraphragResourceWithRawResponse(self._vault.graphrag)
665
+
666
+ @cached_property
667
+ def objects(self) -> ObjectsResourceWithRawResponse:
668
+ return ObjectsResourceWithRawResponse(self._vault.objects)
669
+
670
+
671
+ class AsyncVaultResourceWithRawResponse:
672
+ def __init__(self, vault: AsyncVaultResource) -> None:
673
+ self._vault = vault
674
+
675
+ self.create = async_to_raw_response_wrapper(
676
+ vault.create,
677
+ )
678
+ self.retrieve = async_to_raw_response_wrapper(
679
+ vault.retrieve,
680
+ )
681
+ self.list = async_to_raw_response_wrapper(
682
+ vault.list,
683
+ )
684
+ self.ingest = async_to_raw_response_wrapper(
685
+ vault.ingest,
686
+ )
687
+ self.search = async_to_raw_response_wrapper(
688
+ vault.search,
689
+ )
690
+ self.upload = async_to_raw_response_wrapper(
691
+ vault.upload,
692
+ )
693
+
694
+ @cached_property
695
+ def graphrag(self) -> AsyncGraphragResourceWithRawResponse:
696
+ return AsyncGraphragResourceWithRawResponse(self._vault.graphrag)
697
+
698
+ @cached_property
699
+ def objects(self) -> AsyncObjectsResourceWithRawResponse:
700
+ return AsyncObjectsResourceWithRawResponse(self._vault.objects)
701
+
702
+
703
+ class VaultResourceWithStreamingResponse:
704
+ def __init__(self, vault: VaultResource) -> None:
705
+ self._vault = vault
706
+
707
+ self.create = to_streamed_response_wrapper(
708
+ vault.create,
709
+ )
710
+ self.retrieve = to_streamed_response_wrapper(
711
+ vault.retrieve,
712
+ )
713
+ self.list = to_streamed_response_wrapper(
714
+ vault.list,
715
+ )
716
+ self.ingest = to_streamed_response_wrapper(
717
+ vault.ingest,
718
+ )
719
+ self.search = to_streamed_response_wrapper(
720
+ vault.search,
721
+ )
722
+ self.upload = to_streamed_response_wrapper(
723
+ vault.upload,
724
+ )
725
+
726
+ @cached_property
727
+ def graphrag(self) -> GraphragResourceWithStreamingResponse:
728
+ return GraphragResourceWithStreamingResponse(self._vault.graphrag)
729
+
730
+ @cached_property
731
+ def objects(self) -> ObjectsResourceWithStreamingResponse:
732
+ return ObjectsResourceWithStreamingResponse(self._vault.objects)
733
+
734
+
735
+ class AsyncVaultResourceWithStreamingResponse:
736
+ def __init__(self, vault: AsyncVaultResource) -> None:
737
+ self._vault = vault
738
+
739
+ self.create = async_to_streamed_response_wrapper(
740
+ vault.create,
741
+ )
742
+ self.retrieve = async_to_streamed_response_wrapper(
743
+ vault.retrieve,
744
+ )
745
+ self.list = async_to_streamed_response_wrapper(
746
+ vault.list,
747
+ )
748
+ self.ingest = async_to_streamed_response_wrapper(
749
+ vault.ingest,
750
+ )
751
+ self.search = async_to_streamed_response_wrapper(
752
+ vault.search,
753
+ )
754
+ self.upload = async_to_streamed_response_wrapper(
755
+ vault.upload,
756
+ )
757
+
758
+ @cached_property
759
+ def graphrag(self) -> AsyncGraphragResourceWithStreamingResponse:
760
+ return AsyncGraphragResourceWithStreamingResponse(self._vault.graphrag)
761
+
762
+ @cached_property
763
+ def objects(self) -> AsyncObjectsResourceWithStreamingResponse:
764
+ return AsyncObjectsResourceWithStreamingResponse(self._vault.objects)