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,419 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing_extensions import Literal
|
|
6
|
+
|
|
7
|
+
import httpx
|
|
8
|
+
|
|
9
|
+
from ...._types import Body, Omit, Query, Headers, NoneType, NotGiven, SequenceNotStr, omit, not_given
|
|
10
|
+
from ...._utils import maybe_transform, async_maybe_transform
|
|
11
|
+
from ...._compat import cached_property
|
|
12
|
+
from ...._resource import SyncAPIResource, AsyncAPIResource
|
|
13
|
+
from ...._response import (
|
|
14
|
+
to_raw_response_wrapper,
|
|
15
|
+
to_streamed_response_wrapper,
|
|
16
|
+
async_to_raw_response_wrapper,
|
|
17
|
+
async_to_streamed_response_wrapper,
|
|
18
|
+
)
|
|
19
|
+
from ...._base_client import make_request_options
|
|
20
|
+
from ....types.format.v1 import template_list_params, template_create_params
|
|
21
|
+
from ....types.format.v1.template_create_response import TemplateCreateResponse
|
|
22
|
+
|
|
23
|
+
__all__ = ["TemplatesResource", "AsyncTemplatesResource"]
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class TemplatesResource(SyncAPIResource):
|
|
27
|
+
@cached_property
|
|
28
|
+
def with_raw_response(self) -> TemplatesResourceWithRawResponse:
|
|
29
|
+
"""
|
|
30
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
31
|
+
the raw response object instead of the parsed content.
|
|
32
|
+
|
|
33
|
+
For more information, see https://www.github.com/CaseMark/casedev-python#accessing-raw-response-data-eg-headers
|
|
34
|
+
"""
|
|
35
|
+
return TemplatesResourceWithRawResponse(self)
|
|
36
|
+
|
|
37
|
+
@cached_property
|
|
38
|
+
def with_streaming_response(self) -> TemplatesResourceWithStreamingResponse:
|
|
39
|
+
"""
|
|
40
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
41
|
+
|
|
42
|
+
For more information, see https://www.github.com/CaseMark/casedev-python#with_streaming_response
|
|
43
|
+
"""
|
|
44
|
+
return TemplatesResourceWithStreamingResponse(self)
|
|
45
|
+
|
|
46
|
+
def create(
|
|
47
|
+
self,
|
|
48
|
+
*,
|
|
49
|
+
content: str,
|
|
50
|
+
name: str,
|
|
51
|
+
type: Literal["caption", "signature", "letterhead", "certificate", "footer", "custom"],
|
|
52
|
+
description: str | Omit = omit,
|
|
53
|
+
styles: object | Omit = omit,
|
|
54
|
+
tags: SequenceNotStr[str] | Omit = omit,
|
|
55
|
+
variables: SequenceNotStr[str] | Omit = omit,
|
|
56
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
57
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
58
|
+
extra_headers: Headers | None = None,
|
|
59
|
+
extra_query: Query | None = None,
|
|
60
|
+
extra_body: Body | None = None,
|
|
61
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
62
|
+
) -> TemplateCreateResponse:
|
|
63
|
+
"""Create a new format template for document formatting.
|
|
64
|
+
|
|
65
|
+
Templates support
|
|
66
|
+
variables using `{{variable}}` syntax and can be used for captions, signatures,
|
|
67
|
+
letterheads, certificates, footers, or custom formatting needs.
|
|
68
|
+
|
|
69
|
+
Args:
|
|
70
|
+
content: Template content with {{variable}} placeholders
|
|
71
|
+
|
|
72
|
+
name: Template name
|
|
73
|
+
|
|
74
|
+
type: Template type
|
|
75
|
+
|
|
76
|
+
description: Template description
|
|
77
|
+
|
|
78
|
+
styles: CSS styles for the template
|
|
79
|
+
|
|
80
|
+
tags: Template tags for organization
|
|
81
|
+
|
|
82
|
+
variables: Template variables (auto-detected if not provided)
|
|
83
|
+
|
|
84
|
+
extra_headers: Send extra headers
|
|
85
|
+
|
|
86
|
+
extra_query: Add additional query parameters to the request
|
|
87
|
+
|
|
88
|
+
extra_body: Add additional JSON properties to the request
|
|
89
|
+
|
|
90
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
91
|
+
"""
|
|
92
|
+
return self._post(
|
|
93
|
+
"/format/v1/templates",
|
|
94
|
+
body=maybe_transform(
|
|
95
|
+
{
|
|
96
|
+
"content": content,
|
|
97
|
+
"name": name,
|
|
98
|
+
"type": type,
|
|
99
|
+
"description": description,
|
|
100
|
+
"styles": styles,
|
|
101
|
+
"tags": tags,
|
|
102
|
+
"variables": variables,
|
|
103
|
+
},
|
|
104
|
+
template_create_params.TemplateCreateParams,
|
|
105
|
+
),
|
|
106
|
+
options=make_request_options(
|
|
107
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
108
|
+
),
|
|
109
|
+
cast_to=TemplateCreateResponse,
|
|
110
|
+
)
|
|
111
|
+
|
|
112
|
+
def retrieve(
|
|
113
|
+
self,
|
|
114
|
+
id: str,
|
|
115
|
+
*,
|
|
116
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
117
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
118
|
+
extra_headers: Headers | None = None,
|
|
119
|
+
extra_query: Query | None = None,
|
|
120
|
+
extra_body: Body | None = None,
|
|
121
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
122
|
+
) -> None:
|
|
123
|
+
"""Retrieve a specific document format template by ID.
|
|
124
|
+
|
|
125
|
+
Format templates define how
|
|
126
|
+
documents should be structured and formatted for specific legal use cases such
|
|
127
|
+
as contracts, briefs, or pleadings.
|
|
128
|
+
|
|
129
|
+
Args:
|
|
130
|
+
extra_headers: Send extra headers
|
|
131
|
+
|
|
132
|
+
extra_query: Add additional query parameters to the request
|
|
133
|
+
|
|
134
|
+
extra_body: Add additional JSON properties to the request
|
|
135
|
+
|
|
136
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
137
|
+
"""
|
|
138
|
+
if not id:
|
|
139
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
|
140
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
141
|
+
return self._get(
|
|
142
|
+
f"/format/v1/templates/{id}",
|
|
143
|
+
options=make_request_options(
|
|
144
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
145
|
+
),
|
|
146
|
+
cast_to=NoneType,
|
|
147
|
+
)
|
|
148
|
+
|
|
149
|
+
def list(
|
|
150
|
+
self,
|
|
151
|
+
*,
|
|
152
|
+
type: str | Omit = omit,
|
|
153
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
154
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
155
|
+
extra_headers: Headers | None = None,
|
|
156
|
+
extra_query: Query | None = None,
|
|
157
|
+
extra_body: Body | None = None,
|
|
158
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
159
|
+
) -> None:
|
|
160
|
+
"""Retrieve all format templates for the organization.
|
|
161
|
+
|
|
162
|
+
Templates define reusable
|
|
163
|
+
document formatting patterns with customizable variables for consistent legal
|
|
164
|
+
document generation.
|
|
165
|
+
|
|
166
|
+
Filter by type to get specific template categories like contracts, pleadings, or
|
|
167
|
+
correspondence.
|
|
168
|
+
|
|
169
|
+
Args:
|
|
170
|
+
type: Filter templates by type (e.g., contract, pleading, letter)
|
|
171
|
+
|
|
172
|
+
extra_headers: Send extra headers
|
|
173
|
+
|
|
174
|
+
extra_query: Add additional query parameters to the request
|
|
175
|
+
|
|
176
|
+
extra_body: Add additional JSON properties to the request
|
|
177
|
+
|
|
178
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
179
|
+
"""
|
|
180
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
181
|
+
return self._get(
|
|
182
|
+
"/format/v1/templates",
|
|
183
|
+
options=make_request_options(
|
|
184
|
+
extra_headers=extra_headers,
|
|
185
|
+
extra_query=extra_query,
|
|
186
|
+
extra_body=extra_body,
|
|
187
|
+
timeout=timeout,
|
|
188
|
+
query=maybe_transform({"type": type}, template_list_params.TemplateListParams),
|
|
189
|
+
),
|
|
190
|
+
cast_to=NoneType,
|
|
191
|
+
)
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
class AsyncTemplatesResource(AsyncAPIResource):
|
|
195
|
+
@cached_property
|
|
196
|
+
def with_raw_response(self) -> AsyncTemplatesResourceWithRawResponse:
|
|
197
|
+
"""
|
|
198
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
199
|
+
the raw response object instead of the parsed content.
|
|
200
|
+
|
|
201
|
+
For more information, see https://www.github.com/CaseMark/casedev-python#accessing-raw-response-data-eg-headers
|
|
202
|
+
"""
|
|
203
|
+
return AsyncTemplatesResourceWithRawResponse(self)
|
|
204
|
+
|
|
205
|
+
@cached_property
|
|
206
|
+
def with_streaming_response(self) -> AsyncTemplatesResourceWithStreamingResponse:
|
|
207
|
+
"""
|
|
208
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
209
|
+
|
|
210
|
+
For more information, see https://www.github.com/CaseMark/casedev-python#with_streaming_response
|
|
211
|
+
"""
|
|
212
|
+
return AsyncTemplatesResourceWithStreamingResponse(self)
|
|
213
|
+
|
|
214
|
+
async def create(
|
|
215
|
+
self,
|
|
216
|
+
*,
|
|
217
|
+
content: str,
|
|
218
|
+
name: str,
|
|
219
|
+
type: Literal["caption", "signature", "letterhead", "certificate", "footer", "custom"],
|
|
220
|
+
description: str | Omit = omit,
|
|
221
|
+
styles: object | Omit = omit,
|
|
222
|
+
tags: SequenceNotStr[str] | Omit = omit,
|
|
223
|
+
variables: SequenceNotStr[str] | Omit = omit,
|
|
224
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
225
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
226
|
+
extra_headers: Headers | None = None,
|
|
227
|
+
extra_query: Query | None = None,
|
|
228
|
+
extra_body: Body | None = None,
|
|
229
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
230
|
+
) -> TemplateCreateResponse:
|
|
231
|
+
"""Create a new format template for document formatting.
|
|
232
|
+
|
|
233
|
+
Templates support
|
|
234
|
+
variables using `{{variable}}` syntax and can be used for captions, signatures,
|
|
235
|
+
letterheads, certificates, footers, or custom formatting needs.
|
|
236
|
+
|
|
237
|
+
Args:
|
|
238
|
+
content: Template content with {{variable}} placeholders
|
|
239
|
+
|
|
240
|
+
name: Template name
|
|
241
|
+
|
|
242
|
+
type: Template type
|
|
243
|
+
|
|
244
|
+
description: Template description
|
|
245
|
+
|
|
246
|
+
styles: CSS styles for the template
|
|
247
|
+
|
|
248
|
+
tags: Template tags for organization
|
|
249
|
+
|
|
250
|
+
variables: Template variables (auto-detected if not provided)
|
|
251
|
+
|
|
252
|
+
extra_headers: Send extra headers
|
|
253
|
+
|
|
254
|
+
extra_query: Add additional query parameters to the request
|
|
255
|
+
|
|
256
|
+
extra_body: Add additional JSON properties to the request
|
|
257
|
+
|
|
258
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
259
|
+
"""
|
|
260
|
+
return await self._post(
|
|
261
|
+
"/format/v1/templates",
|
|
262
|
+
body=await async_maybe_transform(
|
|
263
|
+
{
|
|
264
|
+
"content": content,
|
|
265
|
+
"name": name,
|
|
266
|
+
"type": type,
|
|
267
|
+
"description": description,
|
|
268
|
+
"styles": styles,
|
|
269
|
+
"tags": tags,
|
|
270
|
+
"variables": variables,
|
|
271
|
+
},
|
|
272
|
+
template_create_params.TemplateCreateParams,
|
|
273
|
+
),
|
|
274
|
+
options=make_request_options(
|
|
275
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
276
|
+
),
|
|
277
|
+
cast_to=TemplateCreateResponse,
|
|
278
|
+
)
|
|
279
|
+
|
|
280
|
+
async def retrieve(
|
|
281
|
+
self,
|
|
282
|
+
id: str,
|
|
283
|
+
*,
|
|
284
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
285
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
286
|
+
extra_headers: Headers | None = None,
|
|
287
|
+
extra_query: Query | None = None,
|
|
288
|
+
extra_body: Body | None = None,
|
|
289
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
290
|
+
) -> None:
|
|
291
|
+
"""Retrieve a specific document format template by ID.
|
|
292
|
+
|
|
293
|
+
Format templates define how
|
|
294
|
+
documents should be structured and formatted for specific legal use cases such
|
|
295
|
+
as contracts, briefs, or pleadings.
|
|
296
|
+
|
|
297
|
+
Args:
|
|
298
|
+
extra_headers: Send extra headers
|
|
299
|
+
|
|
300
|
+
extra_query: Add additional query parameters to the request
|
|
301
|
+
|
|
302
|
+
extra_body: Add additional JSON properties to the request
|
|
303
|
+
|
|
304
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
305
|
+
"""
|
|
306
|
+
if not id:
|
|
307
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
|
308
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
309
|
+
return await self._get(
|
|
310
|
+
f"/format/v1/templates/{id}",
|
|
311
|
+
options=make_request_options(
|
|
312
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
313
|
+
),
|
|
314
|
+
cast_to=NoneType,
|
|
315
|
+
)
|
|
316
|
+
|
|
317
|
+
async def list(
|
|
318
|
+
self,
|
|
319
|
+
*,
|
|
320
|
+
type: str | Omit = omit,
|
|
321
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
322
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
323
|
+
extra_headers: Headers | None = None,
|
|
324
|
+
extra_query: Query | None = None,
|
|
325
|
+
extra_body: Body | None = None,
|
|
326
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
327
|
+
) -> None:
|
|
328
|
+
"""Retrieve all format templates for the organization.
|
|
329
|
+
|
|
330
|
+
Templates define reusable
|
|
331
|
+
document formatting patterns with customizable variables for consistent legal
|
|
332
|
+
document generation.
|
|
333
|
+
|
|
334
|
+
Filter by type to get specific template categories like contracts, pleadings, or
|
|
335
|
+
correspondence.
|
|
336
|
+
|
|
337
|
+
Args:
|
|
338
|
+
type: Filter templates by type (e.g., contract, pleading, letter)
|
|
339
|
+
|
|
340
|
+
extra_headers: Send extra headers
|
|
341
|
+
|
|
342
|
+
extra_query: Add additional query parameters to the request
|
|
343
|
+
|
|
344
|
+
extra_body: Add additional JSON properties to the request
|
|
345
|
+
|
|
346
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
347
|
+
"""
|
|
348
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
349
|
+
return await self._get(
|
|
350
|
+
"/format/v1/templates",
|
|
351
|
+
options=make_request_options(
|
|
352
|
+
extra_headers=extra_headers,
|
|
353
|
+
extra_query=extra_query,
|
|
354
|
+
extra_body=extra_body,
|
|
355
|
+
timeout=timeout,
|
|
356
|
+
query=await async_maybe_transform({"type": type}, template_list_params.TemplateListParams),
|
|
357
|
+
),
|
|
358
|
+
cast_to=NoneType,
|
|
359
|
+
)
|
|
360
|
+
|
|
361
|
+
|
|
362
|
+
class TemplatesResourceWithRawResponse:
|
|
363
|
+
def __init__(self, templates: TemplatesResource) -> None:
|
|
364
|
+
self._templates = templates
|
|
365
|
+
|
|
366
|
+
self.create = to_raw_response_wrapper(
|
|
367
|
+
templates.create,
|
|
368
|
+
)
|
|
369
|
+
self.retrieve = to_raw_response_wrapper(
|
|
370
|
+
templates.retrieve,
|
|
371
|
+
)
|
|
372
|
+
self.list = to_raw_response_wrapper(
|
|
373
|
+
templates.list,
|
|
374
|
+
)
|
|
375
|
+
|
|
376
|
+
|
|
377
|
+
class AsyncTemplatesResourceWithRawResponse:
|
|
378
|
+
def __init__(self, templates: AsyncTemplatesResource) -> None:
|
|
379
|
+
self._templates = templates
|
|
380
|
+
|
|
381
|
+
self.create = async_to_raw_response_wrapper(
|
|
382
|
+
templates.create,
|
|
383
|
+
)
|
|
384
|
+
self.retrieve = async_to_raw_response_wrapper(
|
|
385
|
+
templates.retrieve,
|
|
386
|
+
)
|
|
387
|
+
self.list = async_to_raw_response_wrapper(
|
|
388
|
+
templates.list,
|
|
389
|
+
)
|
|
390
|
+
|
|
391
|
+
|
|
392
|
+
class TemplatesResourceWithStreamingResponse:
|
|
393
|
+
def __init__(self, templates: TemplatesResource) -> None:
|
|
394
|
+
self._templates = templates
|
|
395
|
+
|
|
396
|
+
self.create = to_streamed_response_wrapper(
|
|
397
|
+
templates.create,
|
|
398
|
+
)
|
|
399
|
+
self.retrieve = to_streamed_response_wrapper(
|
|
400
|
+
templates.retrieve,
|
|
401
|
+
)
|
|
402
|
+
self.list = to_streamed_response_wrapper(
|
|
403
|
+
templates.list,
|
|
404
|
+
)
|
|
405
|
+
|
|
406
|
+
|
|
407
|
+
class AsyncTemplatesResourceWithStreamingResponse:
|
|
408
|
+
def __init__(self, templates: AsyncTemplatesResource) -> None:
|
|
409
|
+
self._templates = templates
|
|
410
|
+
|
|
411
|
+
self.create = async_to_streamed_response_wrapper(
|
|
412
|
+
templates.create,
|
|
413
|
+
)
|
|
414
|
+
self.retrieve = async_to_streamed_response_wrapper(
|
|
415
|
+
templates.retrieve,
|
|
416
|
+
)
|
|
417
|
+
self.list = async_to_streamed_response_wrapper(
|
|
418
|
+
templates.list,
|
|
419
|
+
)
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing_extensions import Literal
|
|
6
|
+
|
|
7
|
+
import httpx
|
|
8
|
+
|
|
9
|
+
from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
|
|
10
|
+
from ...._utils import maybe_transform, async_maybe_transform
|
|
11
|
+
from .templates import (
|
|
12
|
+
TemplatesResource,
|
|
13
|
+
AsyncTemplatesResource,
|
|
14
|
+
TemplatesResourceWithRawResponse,
|
|
15
|
+
AsyncTemplatesResourceWithRawResponse,
|
|
16
|
+
TemplatesResourceWithStreamingResponse,
|
|
17
|
+
AsyncTemplatesResourceWithStreamingResponse,
|
|
18
|
+
)
|
|
19
|
+
from ...._compat import cached_property
|
|
20
|
+
from ...._resource import SyncAPIResource, AsyncAPIResource
|
|
21
|
+
from ...._response import (
|
|
22
|
+
BinaryAPIResponse,
|
|
23
|
+
AsyncBinaryAPIResponse,
|
|
24
|
+
StreamedBinaryAPIResponse,
|
|
25
|
+
AsyncStreamedBinaryAPIResponse,
|
|
26
|
+
to_custom_raw_response_wrapper,
|
|
27
|
+
to_custom_streamed_response_wrapper,
|
|
28
|
+
async_to_custom_raw_response_wrapper,
|
|
29
|
+
async_to_custom_streamed_response_wrapper,
|
|
30
|
+
)
|
|
31
|
+
from ...._base_client import make_request_options
|
|
32
|
+
from ....types.format import v1_create_document_params
|
|
33
|
+
|
|
34
|
+
__all__ = ["V1Resource", "AsyncV1Resource"]
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class V1Resource(SyncAPIResource):
|
|
38
|
+
@cached_property
|
|
39
|
+
def templates(self) -> TemplatesResource:
|
|
40
|
+
return TemplatesResource(self._client)
|
|
41
|
+
|
|
42
|
+
@cached_property
|
|
43
|
+
def with_raw_response(self) -> V1ResourceWithRawResponse:
|
|
44
|
+
"""
|
|
45
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
46
|
+
the raw response object instead of the parsed content.
|
|
47
|
+
|
|
48
|
+
For more information, see https://www.github.com/CaseMark/casedev-python#accessing-raw-response-data-eg-headers
|
|
49
|
+
"""
|
|
50
|
+
return V1ResourceWithRawResponse(self)
|
|
51
|
+
|
|
52
|
+
@cached_property
|
|
53
|
+
def with_streaming_response(self) -> V1ResourceWithStreamingResponse:
|
|
54
|
+
"""
|
|
55
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
56
|
+
|
|
57
|
+
For more information, see https://www.github.com/CaseMark/casedev-python#with_streaming_response
|
|
58
|
+
"""
|
|
59
|
+
return V1ResourceWithStreamingResponse(self)
|
|
60
|
+
|
|
61
|
+
def create_document(
|
|
62
|
+
self,
|
|
63
|
+
*,
|
|
64
|
+
content: str,
|
|
65
|
+
output_format: Literal["pdf", "docx", "html_preview"],
|
|
66
|
+
input_format: Literal["md", "json", "text"] | Omit = omit,
|
|
67
|
+
options: v1_create_document_params.Options | Omit = omit,
|
|
68
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
69
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
70
|
+
extra_headers: Headers | None = None,
|
|
71
|
+
extra_query: Query | None = None,
|
|
72
|
+
extra_body: Body | None = None,
|
|
73
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
74
|
+
) -> BinaryAPIResponse:
|
|
75
|
+
"""
|
|
76
|
+
Convert Markdown, JSON, or text content to professionally formatted PDF, DOCX,
|
|
77
|
+
or HTML documents. Supports template components with variable interpolation for
|
|
78
|
+
creating consistent legal documents like contracts, briefs, and reports.
|
|
79
|
+
|
|
80
|
+
Args:
|
|
81
|
+
content: The source content to format
|
|
82
|
+
|
|
83
|
+
output_format: Desired output format
|
|
84
|
+
|
|
85
|
+
input_format: Format of the input content
|
|
86
|
+
|
|
87
|
+
extra_headers: Send extra headers
|
|
88
|
+
|
|
89
|
+
extra_query: Add additional query parameters to the request
|
|
90
|
+
|
|
91
|
+
extra_body: Add additional JSON properties to the request
|
|
92
|
+
|
|
93
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
94
|
+
"""
|
|
95
|
+
extra_headers = {"Accept": "application/pdf", **(extra_headers or {})}
|
|
96
|
+
return self._post(
|
|
97
|
+
"/format/v1/document",
|
|
98
|
+
body=maybe_transform(
|
|
99
|
+
{
|
|
100
|
+
"content": content,
|
|
101
|
+
"output_format": output_format,
|
|
102
|
+
"input_format": input_format,
|
|
103
|
+
"options": options,
|
|
104
|
+
},
|
|
105
|
+
v1_create_document_params.V1CreateDocumentParams,
|
|
106
|
+
),
|
|
107
|
+
options=make_request_options(
|
|
108
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
109
|
+
),
|
|
110
|
+
cast_to=BinaryAPIResponse,
|
|
111
|
+
)
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
class AsyncV1Resource(AsyncAPIResource):
|
|
115
|
+
@cached_property
|
|
116
|
+
def templates(self) -> AsyncTemplatesResource:
|
|
117
|
+
return AsyncTemplatesResource(self._client)
|
|
118
|
+
|
|
119
|
+
@cached_property
|
|
120
|
+
def with_raw_response(self) -> AsyncV1ResourceWithRawResponse:
|
|
121
|
+
"""
|
|
122
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
123
|
+
the raw response object instead of the parsed content.
|
|
124
|
+
|
|
125
|
+
For more information, see https://www.github.com/CaseMark/casedev-python#accessing-raw-response-data-eg-headers
|
|
126
|
+
"""
|
|
127
|
+
return AsyncV1ResourceWithRawResponse(self)
|
|
128
|
+
|
|
129
|
+
@cached_property
|
|
130
|
+
def with_streaming_response(self) -> AsyncV1ResourceWithStreamingResponse:
|
|
131
|
+
"""
|
|
132
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
133
|
+
|
|
134
|
+
For more information, see https://www.github.com/CaseMark/casedev-python#with_streaming_response
|
|
135
|
+
"""
|
|
136
|
+
return AsyncV1ResourceWithStreamingResponse(self)
|
|
137
|
+
|
|
138
|
+
async def create_document(
|
|
139
|
+
self,
|
|
140
|
+
*,
|
|
141
|
+
content: str,
|
|
142
|
+
output_format: Literal["pdf", "docx", "html_preview"],
|
|
143
|
+
input_format: Literal["md", "json", "text"] | Omit = omit,
|
|
144
|
+
options: v1_create_document_params.Options | Omit = omit,
|
|
145
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
146
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
147
|
+
extra_headers: Headers | None = None,
|
|
148
|
+
extra_query: Query | None = None,
|
|
149
|
+
extra_body: Body | None = None,
|
|
150
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
151
|
+
) -> AsyncBinaryAPIResponse:
|
|
152
|
+
"""
|
|
153
|
+
Convert Markdown, JSON, or text content to professionally formatted PDF, DOCX,
|
|
154
|
+
or HTML documents. Supports template components with variable interpolation for
|
|
155
|
+
creating consistent legal documents like contracts, briefs, and reports.
|
|
156
|
+
|
|
157
|
+
Args:
|
|
158
|
+
content: The source content to format
|
|
159
|
+
|
|
160
|
+
output_format: Desired output format
|
|
161
|
+
|
|
162
|
+
input_format: Format of the input content
|
|
163
|
+
|
|
164
|
+
extra_headers: Send extra headers
|
|
165
|
+
|
|
166
|
+
extra_query: Add additional query parameters to the request
|
|
167
|
+
|
|
168
|
+
extra_body: Add additional JSON properties to the request
|
|
169
|
+
|
|
170
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
171
|
+
"""
|
|
172
|
+
extra_headers = {"Accept": "application/pdf", **(extra_headers or {})}
|
|
173
|
+
return await self._post(
|
|
174
|
+
"/format/v1/document",
|
|
175
|
+
body=await async_maybe_transform(
|
|
176
|
+
{
|
|
177
|
+
"content": content,
|
|
178
|
+
"output_format": output_format,
|
|
179
|
+
"input_format": input_format,
|
|
180
|
+
"options": options,
|
|
181
|
+
},
|
|
182
|
+
v1_create_document_params.V1CreateDocumentParams,
|
|
183
|
+
),
|
|
184
|
+
options=make_request_options(
|
|
185
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
186
|
+
),
|
|
187
|
+
cast_to=AsyncBinaryAPIResponse,
|
|
188
|
+
)
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
class V1ResourceWithRawResponse:
|
|
192
|
+
def __init__(self, v1: V1Resource) -> None:
|
|
193
|
+
self._v1 = v1
|
|
194
|
+
|
|
195
|
+
self.create_document = to_custom_raw_response_wrapper(
|
|
196
|
+
v1.create_document,
|
|
197
|
+
BinaryAPIResponse,
|
|
198
|
+
)
|
|
199
|
+
|
|
200
|
+
@cached_property
|
|
201
|
+
def templates(self) -> TemplatesResourceWithRawResponse:
|
|
202
|
+
return TemplatesResourceWithRawResponse(self._v1.templates)
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
class AsyncV1ResourceWithRawResponse:
|
|
206
|
+
def __init__(self, v1: AsyncV1Resource) -> None:
|
|
207
|
+
self._v1 = v1
|
|
208
|
+
|
|
209
|
+
self.create_document = async_to_custom_raw_response_wrapper(
|
|
210
|
+
v1.create_document,
|
|
211
|
+
AsyncBinaryAPIResponse,
|
|
212
|
+
)
|
|
213
|
+
|
|
214
|
+
@cached_property
|
|
215
|
+
def templates(self) -> AsyncTemplatesResourceWithRawResponse:
|
|
216
|
+
return AsyncTemplatesResourceWithRawResponse(self._v1.templates)
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
class V1ResourceWithStreamingResponse:
|
|
220
|
+
def __init__(self, v1: V1Resource) -> None:
|
|
221
|
+
self._v1 = v1
|
|
222
|
+
|
|
223
|
+
self.create_document = to_custom_streamed_response_wrapper(
|
|
224
|
+
v1.create_document,
|
|
225
|
+
StreamedBinaryAPIResponse,
|
|
226
|
+
)
|
|
227
|
+
|
|
228
|
+
@cached_property
|
|
229
|
+
def templates(self) -> TemplatesResourceWithStreamingResponse:
|
|
230
|
+
return TemplatesResourceWithStreamingResponse(self._v1.templates)
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
class AsyncV1ResourceWithStreamingResponse:
|
|
234
|
+
def __init__(self, v1: AsyncV1Resource) -> None:
|
|
235
|
+
self._v1 = v1
|
|
236
|
+
|
|
237
|
+
self.create_document = async_to_custom_streamed_response_wrapper(
|
|
238
|
+
v1.create_document,
|
|
239
|
+
AsyncStreamedBinaryAPIResponse,
|
|
240
|
+
)
|
|
241
|
+
|
|
242
|
+
@cached_property
|
|
243
|
+
def templates(self) -> AsyncTemplatesResourceWithStreamingResponse:
|
|
244
|
+
return AsyncTemplatesResourceWithStreamingResponse(self._v1.templates)
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from .v1 import (
|
|
4
|
+
V1Resource,
|
|
5
|
+
AsyncV1Resource,
|
|
6
|
+
V1ResourceWithRawResponse,
|
|
7
|
+
AsyncV1ResourceWithRawResponse,
|
|
8
|
+
V1ResourceWithStreamingResponse,
|
|
9
|
+
AsyncV1ResourceWithStreamingResponse,
|
|
10
|
+
)
|
|
11
|
+
from .llm import (
|
|
12
|
+
LlmResource,
|
|
13
|
+
AsyncLlmResource,
|
|
14
|
+
LlmResourceWithRawResponse,
|
|
15
|
+
AsyncLlmResourceWithRawResponse,
|
|
16
|
+
LlmResourceWithStreamingResponse,
|
|
17
|
+
AsyncLlmResourceWithStreamingResponse,
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
__all__ = [
|
|
21
|
+
"V1Resource",
|
|
22
|
+
"AsyncV1Resource",
|
|
23
|
+
"V1ResourceWithRawResponse",
|
|
24
|
+
"AsyncV1ResourceWithRawResponse",
|
|
25
|
+
"V1ResourceWithStreamingResponse",
|
|
26
|
+
"AsyncV1ResourceWithStreamingResponse",
|
|
27
|
+
"LlmResource",
|
|
28
|
+
"AsyncLlmResource",
|
|
29
|
+
"LlmResourceWithRawResponse",
|
|
30
|
+
"AsyncLlmResourceWithRawResponse",
|
|
31
|
+
"LlmResourceWithStreamingResponse",
|
|
32
|
+
"AsyncLlmResourceWithStreamingResponse",
|
|
33
|
+
]
|