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.
- casedev/__init__.py +104 -0
- casedev/_base_client.py +1995 -0
- casedev/_client.py +560 -0
- casedev/_compat.py +219 -0
- casedev/_constants.py +14 -0
- casedev/_exceptions.py +108 -0
- casedev/_files.py +123 -0
- casedev/_models.py +857 -0
- casedev/_qs.py +150 -0
- casedev/_resource.py +43 -0
- casedev/_response.py +830 -0
- casedev/_streaming.py +333 -0
- casedev/_types.py +260 -0
- casedev/_utils/__init__.py +64 -0
- casedev/_utils/_compat.py +45 -0
- casedev/_utils/_datetime_parse.py +136 -0
- casedev/_utils/_logs.py +25 -0
- casedev/_utils/_proxy.py +65 -0
- casedev/_utils/_reflection.py +42 -0
- casedev/_utils/_resources_proxy.py +24 -0
- casedev/_utils/_streams.py +12 -0
- casedev/_utils/_sync.py +58 -0
- casedev/_utils/_transform.py +457 -0
- casedev/_utils/_typing.py +156 -0
- casedev/_utils/_utils.py +421 -0
- casedev/_version.py +4 -0
- casedev/lib/.keep +4 -0
- casedev/py.typed +0 -0
- casedev/resources/__init__.py +173 -0
- casedev/resources/actions/__init__.py +33 -0
- casedev/resources/actions/actions.py +102 -0
- casedev/resources/actions/v1.py +640 -0
- casedev/resources/compute/__init__.py +33 -0
- casedev/resources/compute/compute.py +102 -0
- casedev/resources/compute/v1/__init__.py +89 -0
- casedev/resources/compute/v1/environments.py +492 -0
- casedev/resources/compute/v1/functions.py +278 -0
- casedev/resources/compute/v1/invoke.py +216 -0
- casedev/resources/compute/v1/runs.py +290 -0
- casedev/resources/compute/v1/secrets.py +655 -0
- casedev/resources/compute/v1/v1.py +583 -0
- casedev/resources/convert/__init__.py +33 -0
- casedev/resources/convert/convert.py +102 -0
- casedev/resources/convert/v1/__init__.py +33 -0
- casedev/resources/convert/v1/jobs.py +254 -0
- casedev/resources/convert/v1/v1.py +450 -0
- casedev/resources/format/__init__.py +33 -0
- casedev/resources/format/format.py +102 -0
- casedev/resources/format/v1/__init__.py +33 -0
- casedev/resources/format/v1/templates.py +419 -0
- casedev/resources/format/v1/v1.py +244 -0
- casedev/resources/llm/__init__.py +33 -0
- casedev/resources/llm/llm.py +192 -0
- casedev/resources/llm/v1/__init__.py +33 -0
- casedev/resources/llm/v1/chat.py +243 -0
- casedev/resources/llm/v1/v1.py +317 -0
- casedev/resources/ocr/__init__.py +33 -0
- casedev/resources/ocr/ocr.py +102 -0
- casedev/resources/ocr/v1.py +407 -0
- casedev/resources/search/__init__.py +33 -0
- casedev/resources/search/search.py +102 -0
- casedev/resources/search/v1.py +1052 -0
- casedev/resources/templates/__init__.py +33 -0
- casedev/resources/templates/templates.py +102 -0
- casedev/resources/templates/v1.py +633 -0
- casedev/resources/vault/__init__.py +47 -0
- casedev/resources/vault/graphrag.py +256 -0
- casedev/resources/vault/objects.py +571 -0
- casedev/resources/vault/vault.py +764 -0
- casedev/resources/voice/__init__.py +61 -0
- casedev/resources/voice/streaming.py +160 -0
- casedev/resources/voice/transcription.py +327 -0
- casedev/resources/voice/v1/__init__.py +33 -0
- casedev/resources/voice/v1/speak.py +478 -0
- casedev/resources/voice/v1/v1.py +290 -0
- casedev/resources/voice/voice.py +166 -0
- casedev/resources/webhooks/__init__.py +33 -0
- casedev/resources/webhooks/v1.py +447 -0
- casedev/resources/webhooks/webhooks.py +102 -0
- casedev/resources/workflows/__init__.py +33 -0
- casedev/resources/workflows/v1.py +1053 -0
- casedev/resources/workflows/workflows.py +102 -0
- casedev/types/__init__.py +12 -0
- casedev/types/actions/__init__.py +8 -0
- casedev/types/actions/v1_create_params.py +22 -0
- casedev/types/actions/v1_create_response.py +33 -0
- casedev/types/actions/v1_execute_params.py +16 -0
- casedev/types/actions/v1_execute_response.py +31 -0
- casedev/types/compute/__init__.py +7 -0
- casedev/types/compute/v1/__init__.py +18 -0
- casedev/types/compute/v1/environment_create_params.py +12 -0
- casedev/types/compute/v1/environment_create_response.py +34 -0
- casedev/types/compute/v1/environment_delete_response.py +11 -0
- casedev/types/compute/v1/function_get_logs_params.py +12 -0
- casedev/types/compute/v1/function_list_params.py +12 -0
- casedev/types/compute/v1/invoke_run_params.py +21 -0
- casedev/types/compute/v1/invoke_run_response.py +39 -0
- casedev/types/compute/v1/run_list_params.py +18 -0
- casedev/types/compute/v1/secret_create_params.py +24 -0
- casedev/types/compute/v1/secret_create_response.py +24 -0
- casedev/types/compute/v1/secret_delete_group_params.py +18 -0
- casedev/types/compute/v1/secret_list_params.py +15 -0
- casedev/types/compute/v1/secret_retrieve_group_params.py +12 -0
- casedev/types/compute/v1/secret_update_group_params.py +16 -0
- casedev/types/compute/v1_deploy_params.py +114 -0
- casedev/types/compute/v1_deploy_response.py +30 -0
- casedev/types/compute/v1_get_usage_params.py +15 -0
- casedev/types/convert/__init__.py +8 -0
- casedev/types/convert/v1/__init__.py +3 -0
- casedev/types/convert/v1_process_params.py +15 -0
- casedev/types/convert/v1_process_response.py +19 -0
- casedev/types/convert/v1_webhook_params.py +32 -0
- casedev/types/convert/v1_webhook_response.py +13 -0
- casedev/types/format/__init__.py +5 -0
- casedev/types/format/v1/__init__.py +7 -0
- casedev/types/format/v1/template_create_params.py +32 -0
- casedev/types/format/v1/template_create_response.py +27 -0
- casedev/types/format/v1/template_list_params.py +12 -0
- casedev/types/format/v1_create_document_params.py +42 -0
- casedev/types/llm/__init__.py +5 -0
- casedev/types/llm/v1/__init__.py +6 -0
- casedev/types/llm/v1/chat_create_completion_params.py +42 -0
- casedev/types/llm/v1/chat_create_completion_response.py +49 -0
- casedev/types/llm/v1_create_embedding_params.py +27 -0
- casedev/types/ocr/__init__.py +6 -0
- casedev/types/ocr/v1_process_params.py +44 -0
- casedev/types/ocr/v1_process_response.py +32 -0
- casedev/types/search/__init__.py +15 -0
- casedev/types/search/v1_answer_params.py +45 -0
- casedev/types/search/v1_answer_response.py +35 -0
- casedev/types/search/v1_contents_params.py +42 -0
- casedev/types/search/v1_contents_response.py +31 -0
- casedev/types/search/v1_research_params.py +23 -0
- casedev/types/search/v1_research_response.py +20 -0
- casedev/types/search/v1_retrieve_research_params.py +15 -0
- casedev/types/search/v1_search_params.py +56 -0
- casedev/types/search/v1_search_response.py +38 -0
- casedev/types/search/v1_similar_params.py +44 -0
- casedev/types/search/v1_similar_response.py +33 -0
- casedev/types/templates/__init__.py +8 -0
- casedev/types/templates/v1_execute_params.py +22 -0
- casedev/types/templates/v1_execute_response.py +31 -0
- casedev/types/templates/v1_list_params.py +32 -0
- casedev/types/templates/v1_search_params.py +18 -0
- casedev/types/vault/__init__.py +6 -0
- casedev/types/vault/object_create_presigned_url_params.py +22 -0
- casedev/types/vault/object_create_presigned_url_response.py +51 -0
- casedev/types/vault_create_params.py +20 -0
- casedev/types/vault_create_response.py +36 -0
- casedev/types/vault_ingest_response.py +26 -0
- casedev/types/vault_list_response.py +40 -0
- casedev/types/vault_search_params.py +27 -0
- casedev/types/vault_search_response.py +53 -0
- casedev/types/vault_upload_params.py +26 -0
- casedev/types/vault_upload_response.py +39 -0
- casedev/types/voice/__init__.py +7 -0
- casedev/types/voice/transcription_create_params.py +36 -0
- casedev/types/voice/transcription_retrieve_response.py +41 -0
- casedev/types/voice/v1/__init__.py +6 -0
- casedev/types/voice/v1/speak_create_params.py +59 -0
- casedev/types/voice/v1/speak_stream_params.py +58 -0
- casedev/types/voice/v1_list_voices_params.py +36 -0
- casedev/types/webhooks/__init__.py +6 -0
- casedev/types/webhooks/v1_create_params.py +20 -0
- casedev/types/webhooks/v1_create_response.py +33 -0
- casedev/types/workflows/__init__.py +19 -0
- casedev/types/workflows/v1_create_params.py +32 -0
- casedev/types/workflows/v1_create_response.py +29 -0
- casedev/types/workflows/v1_delete_response.py +13 -0
- casedev/types/workflows/v1_deploy_response.py +20 -0
- casedev/types/workflows/v1_execute_params.py +12 -0
- casedev/types/workflows/v1_execute_response.py +22 -0
- casedev/types/workflows/v1_list_executions_params.py +13 -0
- casedev/types/workflows/v1_list_executions_response.py +27 -0
- casedev/types/workflows/v1_list_params.py +18 -0
- casedev/types/workflows/v1_list_response.py +37 -0
- casedev/types/workflows/v1_retrieve_execution_response.py +31 -0
- casedev/types/workflows/v1_retrieve_response.py +35 -0
- casedev/types/workflows/v1_undeploy_response.py +13 -0
- casedev/types/workflows/v1_update_params.py +26 -0
- casedev/types/workflows/v1_update_response.py +17 -0
- casedev-0.1.0.dist-info/METADATA +454 -0
- casedev-0.1.0.dist-info/RECORD +185 -0
- casedev-0.1.0.dist-info/WHEEL +4 -0
- casedev-0.1.0.dist-info/licenses/LICENSE +201 -0
|
@@ -0,0 +1,633 @@
|
|
|
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.templates import v1_list_params, v1_search_params, v1_execute_params
|
|
19
|
+
from ...types.templates.v1_execute_response import V1ExecuteResponse
|
|
20
|
+
|
|
21
|
+
__all__ = ["V1Resource", "AsyncV1Resource"]
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class V1Resource(SyncAPIResource):
|
|
25
|
+
@cached_property
|
|
26
|
+
def with_raw_response(self) -> V1ResourceWithRawResponse:
|
|
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 V1ResourceWithRawResponse(self)
|
|
34
|
+
|
|
35
|
+
@cached_property
|
|
36
|
+
def with_streaming_response(self) -> V1ResourceWithStreamingResponse:
|
|
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 V1ResourceWithStreamingResponse(self)
|
|
43
|
+
|
|
44
|
+
def retrieve(
|
|
45
|
+
self,
|
|
46
|
+
id: str,
|
|
47
|
+
*,
|
|
48
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
49
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
50
|
+
extra_headers: Headers | None = None,
|
|
51
|
+
extra_query: Query | None = None,
|
|
52
|
+
extra_body: Body | None = None,
|
|
53
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
54
|
+
) -> None:
|
|
55
|
+
"""Retrieve metadata for a published workflow by ID.
|
|
56
|
+
|
|
57
|
+
Returns workflow configuration
|
|
58
|
+
including input/output schemas, but excludes the prompt template for security.
|
|
59
|
+
|
|
60
|
+
Args:
|
|
61
|
+
extra_headers: Send extra headers
|
|
62
|
+
|
|
63
|
+
extra_query: Add additional query parameters to the request
|
|
64
|
+
|
|
65
|
+
extra_body: Add additional JSON properties to the request
|
|
66
|
+
|
|
67
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
68
|
+
"""
|
|
69
|
+
if not id:
|
|
70
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
|
71
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
72
|
+
return self._get(
|
|
73
|
+
f"/templates/v1/{id}",
|
|
74
|
+
options=make_request_options(
|
|
75
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
76
|
+
),
|
|
77
|
+
cast_to=NoneType,
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
def list(
|
|
81
|
+
self,
|
|
82
|
+
*,
|
|
83
|
+
category: str | Omit = omit,
|
|
84
|
+
limit: int | Omit = omit,
|
|
85
|
+
offset: int | Omit = omit,
|
|
86
|
+
published: bool | Omit = omit,
|
|
87
|
+
sub_category: str | Omit = omit,
|
|
88
|
+
type: str | Omit = omit,
|
|
89
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
90
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
91
|
+
extra_headers: Headers | None = None,
|
|
92
|
+
extra_query: Query | None = None,
|
|
93
|
+
extra_body: Body | None = None,
|
|
94
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
95
|
+
) -> None:
|
|
96
|
+
"""
|
|
97
|
+
Retrieve a paginated list of available workflows with optional filtering by
|
|
98
|
+
category, subcategory, type, and publication status. Workflows are pre-built
|
|
99
|
+
document processing pipelines optimized for legal use cases.
|
|
100
|
+
|
|
101
|
+
Args:
|
|
102
|
+
category: Filter workflows by category (e.g., 'legal', 'compliance', 'contract')
|
|
103
|
+
|
|
104
|
+
limit: Maximum number of workflows to return
|
|
105
|
+
|
|
106
|
+
offset: Number of workflows to skip for pagination
|
|
107
|
+
|
|
108
|
+
published: Include only published workflows
|
|
109
|
+
|
|
110
|
+
sub_category: Filter workflows by subcategory (e.g., 'due-diligence', 'litigation', 'mergers')
|
|
111
|
+
|
|
112
|
+
type: Filter workflows by type (e.g., 'document-review', 'contract-analysis',
|
|
113
|
+
'compliance-check')
|
|
114
|
+
|
|
115
|
+
extra_headers: Send extra headers
|
|
116
|
+
|
|
117
|
+
extra_query: Add additional query parameters to the request
|
|
118
|
+
|
|
119
|
+
extra_body: Add additional JSON properties to the request
|
|
120
|
+
|
|
121
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
122
|
+
"""
|
|
123
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
124
|
+
return self._get(
|
|
125
|
+
"/templates/v1",
|
|
126
|
+
options=make_request_options(
|
|
127
|
+
extra_headers=extra_headers,
|
|
128
|
+
extra_query=extra_query,
|
|
129
|
+
extra_body=extra_body,
|
|
130
|
+
timeout=timeout,
|
|
131
|
+
query=maybe_transform(
|
|
132
|
+
{
|
|
133
|
+
"category": category,
|
|
134
|
+
"limit": limit,
|
|
135
|
+
"offset": offset,
|
|
136
|
+
"published": published,
|
|
137
|
+
"sub_category": sub_category,
|
|
138
|
+
"type": type,
|
|
139
|
+
},
|
|
140
|
+
v1_list_params.V1ListParams,
|
|
141
|
+
),
|
|
142
|
+
),
|
|
143
|
+
cast_to=NoneType,
|
|
144
|
+
)
|
|
145
|
+
|
|
146
|
+
def execute(
|
|
147
|
+
self,
|
|
148
|
+
id: str,
|
|
149
|
+
*,
|
|
150
|
+
input: object,
|
|
151
|
+
options: v1_execute_params.Options | 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
|
+
) -> V1ExecuteResponse:
|
|
159
|
+
"""Execute a pre-built workflow with custom input data.
|
|
160
|
+
|
|
161
|
+
Workflows automate common
|
|
162
|
+
legal document processing tasks like contract analysis, due diligence reviews,
|
|
163
|
+
and document classification.
|
|
164
|
+
|
|
165
|
+
**Available Workflows:**
|
|
166
|
+
|
|
167
|
+
- Contract analysis and risk assessment
|
|
168
|
+
- Document classification and tagging
|
|
169
|
+
- Legal research and case summarization
|
|
170
|
+
- Due diligence document review
|
|
171
|
+
- Compliance checking and reporting
|
|
172
|
+
|
|
173
|
+
Args:
|
|
174
|
+
input: Input data for the workflow (structure varies by workflow type)
|
|
175
|
+
|
|
176
|
+
extra_headers: Send extra headers
|
|
177
|
+
|
|
178
|
+
extra_query: Add additional query parameters to the request
|
|
179
|
+
|
|
180
|
+
extra_body: Add additional JSON properties to the request
|
|
181
|
+
|
|
182
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
183
|
+
"""
|
|
184
|
+
if not id:
|
|
185
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
|
186
|
+
return self._post(
|
|
187
|
+
f"/templates/v1/{id}/execute",
|
|
188
|
+
body=maybe_transform(
|
|
189
|
+
{
|
|
190
|
+
"input": input,
|
|
191
|
+
"options": options,
|
|
192
|
+
},
|
|
193
|
+
v1_execute_params.V1ExecuteParams,
|
|
194
|
+
),
|
|
195
|
+
options=make_request_options(
|
|
196
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
197
|
+
),
|
|
198
|
+
cast_to=V1ExecuteResponse,
|
|
199
|
+
)
|
|
200
|
+
|
|
201
|
+
def retrieve_execution(
|
|
202
|
+
self,
|
|
203
|
+
id: str,
|
|
204
|
+
*,
|
|
205
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
206
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
207
|
+
extra_headers: Headers | None = None,
|
|
208
|
+
extra_query: Query | None = None,
|
|
209
|
+
extra_body: Body | None = None,
|
|
210
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
211
|
+
) -> None:
|
|
212
|
+
"""Retrieves the status and details of a workflow execution.
|
|
213
|
+
|
|
214
|
+
This endpoint is
|
|
215
|
+
designed for future asynchronous execution support and currently returns a 501
|
|
216
|
+
Not Implemented status since all executions are synchronous.
|
|
217
|
+
|
|
218
|
+
Args:
|
|
219
|
+
extra_headers: Send extra headers
|
|
220
|
+
|
|
221
|
+
extra_query: Add additional query parameters to the request
|
|
222
|
+
|
|
223
|
+
extra_body: Add additional JSON properties to the request
|
|
224
|
+
|
|
225
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
226
|
+
"""
|
|
227
|
+
if not id:
|
|
228
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
|
229
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
230
|
+
return self._get(
|
|
231
|
+
f"/templates/v1/executions/{id}",
|
|
232
|
+
options=make_request_options(
|
|
233
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
234
|
+
),
|
|
235
|
+
cast_to=NoneType,
|
|
236
|
+
)
|
|
237
|
+
|
|
238
|
+
def search(
|
|
239
|
+
self,
|
|
240
|
+
*,
|
|
241
|
+
query: str,
|
|
242
|
+
category: str | Omit = omit,
|
|
243
|
+
limit: int | Omit = omit,
|
|
244
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
245
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
246
|
+
extra_headers: Headers | None = None,
|
|
247
|
+
extra_query: Query | None = None,
|
|
248
|
+
extra_body: Body | None = None,
|
|
249
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
250
|
+
) -> None:
|
|
251
|
+
"""
|
|
252
|
+
Perform semantic search across available workflows to find the most relevant
|
|
253
|
+
pre-built document processing pipelines for your legal use case.
|
|
254
|
+
|
|
255
|
+
Args:
|
|
256
|
+
query: Search query to find relevant workflows
|
|
257
|
+
|
|
258
|
+
category: Optional category filter to narrow results
|
|
259
|
+
|
|
260
|
+
limit: Maximum number of results to return (default: 10, max: 50)
|
|
261
|
+
|
|
262
|
+
extra_headers: Send extra headers
|
|
263
|
+
|
|
264
|
+
extra_query: Add additional query parameters to the request
|
|
265
|
+
|
|
266
|
+
extra_body: Add additional JSON properties to the request
|
|
267
|
+
|
|
268
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
269
|
+
"""
|
|
270
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
271
|
+
return self._post(
|
|
272
|
+
"/templates/v1/search",
|
|
273
|
+
body=maybe_transform(
|
|
274
|
+
{
|
|
275
|
+
"query": query,
|
|
276
|
+
"category": category,
|
|
277
|
+
"limit": limit,
|
|
278
|
+
},
|
|
279
|
+
v1_search_params.V1SearchParams,
|
|
280
|
+
),
|
|
281
|
+
options=make_request_options(
|
|
282
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
283
|
+
),
|
|
284
|
+
cast_to=NoneType,
|
|
285
|
+
)
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
class AsyncV1Resource(AsyncAPIResource):
|
|
289
|
+
@cached_property
|
|
290
|
+
def with_raw_response(self) -> AsyncV1ResourceWithRawResponse:
|
|
291
|
+
"""
|
|
292
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
293
|
+
the raw response object instead of the parsed content.
|
|
294
|
+
|
|
295
|
+
For more information, see https://www.github.com/CaseMark/casedev-python#accessing-raw-response-data-eg-headers
|
|
296
|
+
"""
|
|
297
|
+
return AsyncV1ResourceWithRawResponse(self)
|
|
298
|
+
|
|
299
|
+
@cached_property
|
|
300
|
+
def with_streaming_response(self) -> AsyncV1ResourceWithStreamingResponse:
|
|
301
|
+
"""
|
|
302
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
303
|
+
|
|
304
|
+
For more information, see https://www.github.com/CaseMark/casedev-python#with_streaming_response
|
|
305
|
+
"""
|
|
306
|
+
return AsyncV1ResourceWithStreamingResponse(self)
|
|
307
|
+
|
|
308
|
+
async def retrieve(
|
|
309
|
+
self,
|
|
310
|
+
id: str,
|
|
311
|
+
*,
|
|
312
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
313
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
314
|
+
extra_headers: Headers | None = None,
|
|
315
|
+
extra_query: Query | None = None,
|
|
316
|
+
extra_body: Body | None = None,
|
|
317
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
318
|
+
) -> None:
|
|
319
|
+
"""Retrieve metadata for a published workflow by ID.
|
|
320
|
+
|
|
321
|
+
Returns workflow configuration
|
|
322
|
+
including input/output schemas, but excludes the prompt template for security.
|
|
323
|
+
|
|
324
|
+
Args:
|
|
325
|
+
extra_headers: Send extra headers
|
|
326
|
+
|
|
327
|
+
extra_query: Add additional query parameters to the request
|
|
328
|
+
|
|
329
|
+
extra_body: Add additional JSON properties to the request
|
|
330
|
+
|
|
331
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
332
|
+
"""
|
|
333
|
+
if not id:
|
|
334
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
|
335
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
336
|
+
return await self._get(
|
|
337
|
+
f"/templates/v1/{id}",
|
|
338
|
+
options=make_request_options(
|
|
339
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
340
|
+
),
|
|
341
|
+
cast_to=NoneType,
|
|
342
|
+
)
|
|
343
|
+
|
|
344
|
+
async def list(
|
|
345
|
+
self,
|
|
346
|
+
*,
|
|
347
|
+
category: str | Omit = omit,
|
|
348
|
+
limit: int | Omit = omit,
|
|
349
|
+
offset: int | Omit = omit,
|
|
350
|
+
published: bool | Omit = omit,
|
|
351
|
+
sub_category: str | Omit = omit,
|
|
352
|
+
type: str | Omit = omit,
|
|
353
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
354
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
355
|
+
extra_headers: Headers | None = None,
|
|
356
|
+
extra_query: Query | None = None,
|
|
357
|
+
extra_body: Body | None = None,
|
|
358
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
359
|
+
) -> None:
|
|
360
|
+
"""
|
|
361
|
+
Retrieve a paginated list of available workflows with optional filtering by
|
|
362
|
+
category, subcategory, type, and publication status. Workflows are pre-built
|
|
363
|
+
document processing pipelines optimized for legal use cases.
|
|
364
|
+
|
|
365
|
+
Args:
|
|
366
|
+
category: Filter workflows by category (e.g., 'legal', 'compliance', 'contract')
|
|
367
|
+
|
|
368
|
+
limit: Maximum number of workflows to return
|
|
369
|
+
|
|
370
|
+
offset: Number of workflows to skip for pagination
|
|
371
|
+
|
|
372
|
+
published: Include only published workflows
|
|
373
|
+
|
|
374
|
+
sub_category: Filter workflows by subcategory (e.g., 'due-diligence', 'litigation', 'mergers')
|
|
375
|
+
|
|
376
|
+
type: Filter workflows by type (e.g., 'document-review', 'contract-analysis',
|
|
377
|
+
'compliance-check')
|
|
378
|
+
|
|
379
|
+
extra_headers: Send extra headers
|
|
380
|
+
|
|
381
|
+
extra_query: Add additional query parameters to the request
|
|
382
|
+
|
|
383
|
+
extra_body: Add additional JSON properties to the request
|
|
384
|
+
|
|
385
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
386
|
+
"""
|
|
387
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
388
|
+
return await self._get(
|
|
389
|
+
"/templates/v1",
|
|
390
|
+
options=make_request_options(
|
|
391
|
+
extra_headers=extra_headers,
|
|
392
|
+
extra_query=extra_query,
|
|
393
|
+
extra_body=extra_body,
|
|
394
|
+
timeout=timeout,
|
|
395
|
+
query=await async_maybe_transform(
|
|
396
|
+
{
|
|
397
|
+
"category": category,
|
|
398
|
+
"limit": limit,
|
|
399
|
+
"offset": offset,
|
|
400
|
+
"published": published,
|
|
401
|
+
"sub_category": sub_category,
|
|
402
|
+
"type": type,
|
|
403
|
+
},
|
|
404
|
+
v1_list_params.V1ListParams,
|
|
405
|
+
),
|
|
406
|
+
),
|
|
407
|
+
cast_to=NoneType,
|
|
408
|
+
)
|
|
409
|
+
|
|
410
|
+
async def execute(
|
|
411
|
+
self,
|
|
412
|
+
id: str,
|
|
413
|
+
*,
|
|
414
|
+
input: object,
|
|
415
|
+
options: v1_execute_params.Options | Omit = omit,
|
|
416
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
417
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
418
|
+
extra_headers: Headers | None = None,
|
|
419
|
+
extra_query: Query | None = None,
|
|
420
|
+
extra_body: Body | None = None,
|
|
421
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
422
|
+
) -> V1ExecuteResponse:
|
|
423
|
+
"""Execute a pre-built workflow with custom input data.
|
|
424
|
+
|
|
425
|
+
Workflows automate common
|
|
426
|
+
legal document processing tasks like contract analysis, due diligence reviews,
|
|
427
|
+
and document classification.
|
|
428
|
+
|
|
429
|
+
**Available Workflows:**
|
|
430
|
+
|
|
431
|
+
- Contract analysis and risk assessment
|
|
432
|
+
- Document classification and tagging
|
|
433
|
+
- Legal research and case summarization
|
|
434
|
+
- Due diligence document review
|
|
435
|
+
- Compliance checking and reporting
|
|
436
|
+
|
|
437
|
+
Args:
|
|
438
|
+
input: Input data for the workflow (structure varies by workflow type)
|
|
439
|
+
|
|
440
|
+
extra_headers: Send extra headers
|
|
441
|
+
|
|
442
|
+
extra_query: Add additional query parameters to the request
|
|
443
|
+
|
|
444
|
+
extra_body: Add additional JSON properties to the request
|
|
445
|
+
|
|
446
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
447
|
+
"""
|
|
448
|
+
if not id:
|
|
449
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
|
450
|
+
return await self._post(
|
|
451
|
+
f"/templates/v1/{id}/execute",
|
|
452
|
+
body=await async_maybe_transform(
|
|
453
|
+
{
|
|
454
|
+
"input": input,
|
|
455
|
+
"options": options,
|
|
456
|
+
},
|
|
457
|
+
v1_execute_params.V1ExecuteParams,
|
|
458
|
+
),
|
|
459
|
+
options=make_request_options(
|
|
460
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
461
|
+
),
|
|
462
|
+
cast_to=V1ExecuteResponse,
|
|
463
|
+
)
|
|
464
|
+
|
|
465
|
+
async def retrieve_execution(
|
|
466
|
+
self,
|
|
467
|
+
id: str,
|
|
468
|
+
*,
|
|
469
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
470
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
471
|
+
extra_headers: Headers | None = None,
|
|
472
|
+
extra_query: Query | None = None,
|
|
473
|
+
extra_body: Body | None = None,
|
|
474
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
475
|
+
) -> None:
|
|
476
|
+
"""Retrieves the status and details of a workflow execution.
|
|
477
|
+
|
|
478
|
+
This endpoint is
|
|
479
|
+
designed for future asynchronous execution support and currently returns a 501
|
|
480
|
+
Not Implemented status since all executions are synchronous.
|
|
481
|
+
|
|
482
|
+
Args:
|
|
483
|
+
extra_headers: Send extra headers
|
|
484
|
+
|
|
485
|
+
extra_query: Add additional query parameters to the request
|
|
486
|
+
|
|
487
|
+
extra_body: Add additional JSON properties to the request
|
|
488
|
+
|
|
489
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
490
|
+
"""
|
|
491
|
+
if not id:
|
|
492
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
|
493
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
494
|
+
return await self._get(
|
|
495
|
+
f"/templates/v1/executions/{id}",
|
|
496
|
+
options=make_request_options(
|
|
497
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
498
|
+
),
|
|
499
|
+
cast_to=NoneType,
|
|
500
|
+
)
|
|
501
|
+
|
|
502
|
+
async def search(
|
|
503
|
+
self,
|
|
504
|
+
*,
|
|
505
|
+
query: str,
|
|
506
|
+
category: str | Omit = omit,
|
|
507
|
+
limit: int | Omit = omit,
|
|
508
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
509
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
510
|
+
extra_headers: Headers | None = None,
|
|
511
|
+
extra_query: Query | None = None,
|
|
512
|
+
extra_body: Body | None = None,
|
|
513
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
514
|
+
) -> None:
|
|
515
|
+
"""
|
|
516
|
+
Perform semantic search across available workflows to find the most relevant
|
|
517
|
+
pre-built document processing pipelines for your legal use case.
|
|
518
|
+
|
|
519
|
+
Args:
|
|
520
|
+
query: Search query to find relevant workflows
|
|
521
|
+
|
|
522
|
+
category: Optional category filter to narrow results
|
|
523
|
+
|
|
524
|
+
limit: Maximum number of results to return (default: 10, max: 50)
|
|
525
|
+
|
|
526
|
+
extra_headers: Send extra headers
|
|
527
|
+
|
|
528
|
+
extra_query: Add additional query parameters to the request
|
|
529
|
+
|
|
530
|
+
extra_body: Add additional JSON properties to the request
|
|
531
|
+
|
|
532
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
533
|
+
"""
|
|
534
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
535
|
+
return await self._post(
|
|
536
|
+
"/templates/v1/search",
|
|
537
|
+
body=await async_maybe_transform(
|
|
538
|
+
{
|
|
539
|
+
"query": query,
|
|
540
|
+
"category": category,
|
|
541
|
+
"limit": limit,
|
|
542
|
+
},
|
|
543
|
+
v1_search_params.V1SearchParams,
|
|
544
|
+
),
|
|
545
|
+
options=make_request_options(
|
|
546
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
547
|
+
),
|
|
548
|
+
cast_to=NoneType,
|
|
549
|
+
)
|
|
550
|
+
|
|
551
|
+
|
|
552
|
+
class V1ResourceWithRawResponse:
|
|
553
|
+
def __init__(self, v1: V1Resource) -> None:
|
|
554
|
+
self._v1 = v1
|
|
555
|
+
|
|
556
|
+
self.retrieve = to_raw_response_wrapper(
|
|
557
|
+
v1.retrieve,
|
|
558
|
+
)
|
|
559
|
+
self.list = to_raw_response_wrapper(
|
|
560
|
+
v1.list,
|
|
561
|
+
)
|
|
562
|
+
self.execute = to_raw_response_wrapper(
|
|
563
|
+
v1.execute,
|
|
564
|
+
)
|
|
565
|
+
self.retrieve_execution = to_raw_response_wrapper(
|
|
566
|
+
v1.retrieve_execution,
|
|
567
|
+
)
|
|
568
|
+
self.search = to_raw_response_wrapper(
|
|
569
|
+
v1.search,
|
|
570
|
+
)
|
|
571
|
+
|
|
572
|
+
|
|
573
|
+
class AsyncV1ResourceWithRawResponse:
|
|
574
|
+
def __init__(self, v1: AsyncV1Resource) -> None:
|
|
575
|
+
self._v1 = v1
|
|
576
|
+
|
|
577
|
+
self.retrieve = async_to_raw_response_wrapper(
|
|
578
|
+
v1.retrieve,
|
|
579
|
+
)
|
|
580
|
+
self.list = async_to_raw_response_wrapper(
|
|
581
|
+
v1.list,
|
|
582
|
+
)
|
|
583
|
+
self.execute = async_to_raw_response_wrapper(
|
|
584
|
+
v1.execute,
|
|
585
|
+
)
|
|
586
|
+
self.retrieve_execution = async_to_raw_response_wrapper(
|
|
587
|
+
v1.retrieve_execution,
|
|
588
|
+
)
|
|
589
|
+
self.search = async_to_raw_response_wrapper(
|
|
590
|
+
v1.search,
|
|
591
|
+
)
|
|
592
|
+
|
|
593
|
+
|
|
594
|
+
class V1ResourceWithStreamingResponse:
|
|
595
|
+
def __init__(self, v1: V1Resource) -> None:
|
|
596
|
+
self._v1 = v1
|
|
597
|
+
|
|
598
|
+
self.retrieve = to_streamed_response_wrapper(
|
|
599
|
+
v1.retrieve,
|
|
600
|
+
)
|
|
601
|
+
self.list = to_streamed_response_wrapper(
|
|
602
|
+
v1.list,
|
|
603
|
+
)
|
|
604
|
+
self.execute = to_streamed_response_wrapper(
|
|
605
|
+
v1.execute,
|
|
606
|
+
)
|
|
607
|
+
self.retrieve_execution = to_streamed_response_wrapper(
|
|
608
|
+
v1.retrieve_execution,
|
|
609
|
+
)
|
|
610
|
+
self.search = to_streamed_response_wrapper(
|
|
611
|
+
v1.search,
|
|
612
|
+
)
|
|
613
|
+
|
|
614
|
+
|
|
615
|
+
class AsyncV1ResourceWithStreamingResponse:
|
|
616
|
+
def __init__(self, v1: AsyncV1Resource) -> None:
|
|
617
|
+
self._v1 = v1
|
|
618
|
+
|
|
619
|
+
self.retrieve = async_to_streamed_response_wrapper(
|
|
620
|
+
v1.retrieve,
|
|
621
|
+
)
|
|
622
|
+
self.list = async_to_streamed_response_wrapper(
|
|
623
|
+
v1.list,
|
|
624
|
+
)
|
|
625
|
+
self.execute = async_to_streamed_response_wrapper(
|
|
626
|
+
v1.execute,
|
|
627
|
+
)
|
|
628
|
+
self.retrieve_execution = async_to_streamed_response_wrapper(
|
|
629
|
+
v1.retrieve_execution,
|
|
630
|
+
)
|
|
631
|
+
self.search = async_to_streamed_response_wrapper(
|
|
632
|
+
v1.search,
|
|
633
|
+
)
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from .vault import (
|
|
4
|
+
VaultResource,
|
|
5
|
+
AsyncVaultResource,
|
|
6
|
+
VaultResourceWithRawResponse,
|
|
7
|
+
AsyncVaultResourceWithRawResponse,
|
|
8
|
+
VaultResourceWithStreamingResponse,
|
|
9
|
+
AsyncVaultResourceWithStreamingResponse,
|
|
10
|
+
)
|
|
11
|
+
from .objects import (
|
|
12
|
+
ObjectsResource,
|
|
13
|
+
AsyncObjectsResource,
|
|
14
|
+
ObjectsResourceWithRawResponse,
|
|
15
|
+
AsyncObjectsResourceWithRawResponse,
|
|
16
|
+
ObjectsResourceWithStreamingResponse,
|
|
17
|
+
AsyncObjectsResourceWithStreamingResponse,
|
|
18
|
+
)
|
|
19
|
+
from .graphrag import (
|
|
20
|
+
GraphragResource,
|
|
21
|
+
AsyncGraphragResource,
|
|
22
|
+
GraphragResourceWithRawResponse,
|
|
23
|
+
AsyncGraphragResourceWithRawResponse,
|
|
24
|
+
GraphragResourceWithStreamingResponse,
|
|
25
|
+
AsyncGraphragResourceWithStreamingResponse,
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
__all__ = [
|
|
29
|
+
"GraphragResource",
|
|
30
|
+
"AsyncGraphragResource",
|
|
31
|
+
"GraphragResourceWithRawResponse",
|
|
32
|
+
"AsyncGraphragResourceWithRawResponse",
|
|
33
|
+
"GraphragResourceWithStreamingResponse",
|
|
34
|
+
"AsyncGraphragResourceWithStreamingResponse",
|
|
35
|
+
"ObjectsResource",
|
|
36
|
+
"AsyncObjectsResource",
|
|
37
|
+
"ObjectsResourceWithRawResponse",
|
|
38
|
+
"AsyncObjectsResourceWithRawResponse",
|
|
39
|
+
"ObjectsResourceWithStreamingResponse",
|
|
40
|
+
"AsyncObjectsResourceWithStreamingResponse",
|
|
41
|
+
"VaultResource",
|
|
42
|
+
"AsyncVaultResource",
|
|
43
|
+
"VaultResourceWithRawResponse",
|
|
44
|
+
"AsyncVaultResourceWithRawResponse",
|
|
45
|
+
"VaultResourceWithStreamingResponse",
|
|
46
|
+
"AsyncVaultResourceWithStreamingResponse",
|
|
47
|
+
]
|