anyformat 0.2.0__tar.gz → 0.3.0__tar.gz

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 (95) hide show
  1. anyformat-0.3.0/.release-please-manifest.json +3 -0
  2. {anyformat-0.2.0 → anyformat-0.3.0}/CHANGELOG.md +8 -0
  3. {anyformat-0.2.0 → anyformat-0.3.0}/PKG-INFO +1 -1
  4. {anyformat-0.2.0 → anyformat-0.3.0}/api.md +0 -10
  5. {anyformat-0.2.0 → anyformat-0.3.0}/pyproject.toml +1 -1
  6. {anyformat-0.2.0 → anyformat-0.3.0}/src/anyformat/_version.py +1 -1
  7. anyformat-0.3.0/src/anyformat/resources/files.py +169 -0
  8. {anyformat-0.2.0 → anyformat-0.3.0}/src/anyformat/resources/workflows.py +1 -133
  9. {anyformat-0.2.0 → anyformat-0.3.0}/src/anyformat/types/__init__.py +0 -5
  10. {anyformat-0.2.0 → anyformat-0.3.0}/src/anyformat/types/workflow_run_params.py +0 -6
  11. {anyformat-0.2.0 → anyformat-0.3.0}/src/anyformat/types/workflow_upload_params.py +0 -6
  12. anyformat-0.3.0/tests/api_resources/test_files.py +106 -0
  13. {anyformat-0.2.0 → anyformat-0.3.0}/tests/api_resources/test_workflows.py +0 -116
  14. anyformat-0.2.0/.release-please-manifest.json +0 -3
  15. anyformat-0.2.0/src/anyformat/resources/files.py +0 -454
  16. anyformat-0.2.0/src/anyformat/types/file_create_params.py +0 -15
  17. anyformat-0.2.0/src/anyformat/types/file_create_response.py +0 -27
  18. anyformat-0.2.0/src/anyformat/types/file_list_params.py +0 -16
  19. anyformat-0.2.0/src/anyformat/types/file_list_response.py +0 -32
  20. anyformat-0.2.0/src/anyformat/types/workflow_results_params.py +0 -14
  21. anyformat-0.2.0/tests/api_resources/test_files.py +0 -342
  22. {anyformat-0.2.0 → anyformat-0.3.0}/.gitignore +0 -0
  23. {anyformat-0.2.0 → anyformat-0.3.0}/CONTRIBUTING.md +0 -0
  24. {anyformat-0.2.0 → anyformat-0.3.0}/LICENSE +0 -0
  25. {anyformat-0.2.0 → anyformat-0.3.0}/README.md +0 -0
  26. {anyformat-0.2.0 → anyformat-0.3.0}/SECURITY.md +0 -0
  27. {anyformat-0.2.0 → anyformat-0.3.0}/bin/check-release-environment +0 -0
  28. {anyformat-0.2.0 → anyformat-0.3.0}/bin/publish-pypi +0 -0
  29. {anyformat-0.2.0 → anyformat-0.3.0}/examples/.keep +0 -0
  30. {anyformat-0.2.0 → anyformat-0.3.0}/release-please-config.json +0 -0
  31. {anyformat-0.2.0 → anyformat-0.3.0}/requirements-dev.lock +0 -0
  32. {anyformat-0.2.0 → anyformat-0.3.0}/src/anyformat/__init__.py +0 -0
  33. {anyformat-0.2.0 → anyformat-0.3.0}/src/anyformat/_base_client.py +0 -0
  34. {anyformat-0.2.0 → anyformat-0.3.0}/src/anyformat/_client.py +0 -0
  35. {anyformat-0.2.0 → anyformat-0.3.0}/src/anyformat/_compat.py +0 -0
  36. {anyformat-0.2.0 → anyformat-0.3.0}/src/anyformat/_constants.py +0 -0
  37. {anyformat-0.2.0 → anyformat-0.3.0}/src/anyformat/_exceptions.py +0 -0
  38. {anyformat-0.2.0 → anyformat-0.3.0}/src/anyformat/_files.py +0 -0
  39. {anyformat-0.2.0 → anyformat-0.3.0}/src/anyformat/_models.py +0 -0
  40. {anyformat-0.2.0 → anyformat-0.3.0}/src/anyformat/_qs.py +0 -0
  41. {anyformat-0.2.0 → anyformat-0.3.0}/src/anyformat/_resource.py +0 -0
  42. {anyformat-0.2.0 → anyformat-0.3.0}/src/anyformat/_response.py +0 -0
  43. {anyformat-0.2.0 → anyformat-0.3.0}/src/anyformat/_streaming.py +0 -0
  44. {anyformat-0.2.0 → anyformat-0.3.0}/src/anyformat/_types.py +0 -0
  45. {anyformat-0.2.0 → anyformat-0.3.0}/src/anyformat/_utils/__init__.py +0 -0
  46. {anyformat-0.2.0 → anyformat-0.3.0}/src/anyformat/_utils/_compat.py +0 -0
  47. {anyformat-0.2.0 → anyformat-0.3.0}/src/anyformat/_utils/_datetime_parse.py +0 -0
  48. {anyformat-0.2.0 → anyformat-0.3.0}/src/anyformat/_utils/_json.py +0 -0
  49. {anyformat-0.2.0 → anyformat-0.3.0}/src/anyformat/_utils/_logs.py +0 -0
  50. {anyformat-0.2.0 → anyformat-0.3.0}/src/anyformat/_utils/_path.py +0 -0
  51. {anyformat-0.2.0 → anyformat-0.3.0}/src/anyformat/_utils/_proxy.py +0 -0
  52. {anyformat-0.2.0 → anyformat-0.3.0}/src/anyformat/_utils/_reflection.py +0 -0
  53. {anyformat-0.2.0 → anyformat-0.3.0}/src/anyformat/_utils/_resources_proxy.py +0 -0
  54. {anyformat-0.2.0 → anyformat-0.3.0}/src/anyformat/_utils/_streams.py +0 -0
  55. {anyformat-0.2.0 → anyformat-0.3.0}/src/anyformat/_utils/_sync.py +0 -0
  56. {anyformat-0.2.0 → anyformat-0.3.0}/src/anyformat/_utils/_transform.py +0 -0
  57. {anyformat-0.2.0 → anyformat-0.3.0}/src/anyformat/_utils/_typing.py +0 -0
  58. {anyformat-0.2.0 → anyformat-0.3.0}/src/anyformat/_utils/_utils.py +0 -0
  59. {anyformat-0.2.0 → anyformat-0.3.0}/src/anyformat/lib/.keep +0 -0
  60. {anyformat-0.2.0 → anyformat-0.3.0}/src/anyformat/py.typed +0 -0
  61. {anyformat-0.2.0 → anyformat-0.3.0}/src/anyformat/resources/__init__.py +0 -0
  62. {anyformat-0.2.0 → anyformat-0.3.0}/src/anyformat/resources/health.py +0 -0
  63. {anyformat-0.2.0 → anyformat-0.3.0}/src/anyformat/resources/webhooks.py +0 -0
  64. {anyformat-0.2.0 → anyformat-0.3.0}/src/anyformat/types/webhook_create_params.py +0 -0
  65. {anyformat-0.2.0 → anyformat-0.3.0}/src/anyformat/types/webhook_create_response.py +0 -0
  66. {anyformat-0.2.0 → anyformat-0.3.0}/src/anyformat/types/webhook_list_response.py +0 -0
  67. {anyformat-0.2.0 → anyformat-0.3.0}/src/anyformat/types/workflow.py +0 -0
  68. {anyformat-0.2.0 → anyformat-0.3.0}/src/anyformat/types/workflow_list_params.py +0 -0
  69. {anyformat-0.2.0 → anyformat-0.3.0}/src/anyformat/types/workflow_list_response.py +0 -0
  70. {anyformat-0.2.0 → anyformat-0.3.0}/src/anyformat/types/workflow_list_runs_params.py +0 -0
  71. {anyformat-0.2.0 → anyformat-0.3.0}/src/anyformat/types/workflow_list_runs_response.py +0 -0
  72. {anyformat-0.2.0 → anyformat-0.3.0}/src/anyformat/types/workflow_run_response.py +0 -0
  73. {anyformat-0.2.0 → anyformat-0.3.0}/src/anyformat/types/workflow_upload_response.py +0 -0
  74. {anyformat-0.2.0 → anyformat-0.3.0}/tests/__init__.py +0 -0
  75. {anyformat-0.2.0 → anyformat-0.3.0}/tests/api_resources/__init__.py +0 -0
  76. {anyformat-0.2.0 → anyformat-0.3.0}/tests/api_resources/test_health.py +0 -0
  77. {anyformat-0.2.0 → anyformat-0.3.0}/tests/api_resources/test_webhooks.py +0 -0
  78. {anyformat-0.2.0 → anyformat-0.3.0}/tests/conftest.py +0 -0
  79. {anyformat-0.2.0 → anyformat-0.3.0}/tests/sample_file.txt +0 -0
  80. {anyformat-0.2.0 → anyformat-0.3.0}/tests/test_client.py +0 -0
  81. {anyformat-0.2.0 → anyformat-0.3.0}/tests/test_extract_files.py +0 -0
  82. {anyformat-0.2.0 → anyformat-0.3.0}/tests/test_files.py +0 -0
  83. {anyformat-0.2.0 → anyformat-0.3.0}/tests/test_models.py +0 -0
  84. {anyformat-0.2.0 → anyformat-0.3.0}/tests/test_qs.py +0 -0
  85. {anyformat-0.2.0 → anyformat-0.3.0}/tests/test_required_args.py +0 -0
  86. {anyformat-0.2.0 → anyformat-0.3.0}/tests/test_response.py +0 -0
  87. {anyformat-0.2.0 → anyformat-0.3.0}/tests/test_streaming.py +0 -0
  88. {anyformat-0.2.0 → anyformat-0.3.0}/tests/test_transform.py +0 -0
  89. {anyformat-0.2.0 → anyformat-0.3.0}/tests/test_utils/test_datetime_parse.py +0 -0
  90. {anyformat-0.2.0 → anyformat-0.3.0}/tests/test_utils/test_json.py +0 -0
  91. {anyformat-0.2.0 → anyformat-0.3.0}/tests/test_utils/test_path.py +0 -0
  92. {anyformat-0.2.0 → anyformat-0.3.0}/tests/test_utils/test_proxy.py +0 -0
  93. {anyformat-0.2.0 → anyformat-0.3.0}/tests/test_utils/test_typing.py +0 -0
  94. {anyformat-0.2.0 → anyformat-0.3.0}/tests/utils.py +0 -0
  95. {anyformat-0.2.0 → anyformat-0.3.0}/uv.lock +0 -0
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "0.3.0"
3
+ }
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.0 (2026-04-20)
4
+
5
+ Full Changelog: [v0.2.0...v0.3.0](https://github.com/anyformat-ai/anyformat-python/compare/v0.2.0...v0.3.0)
6
+
7
+ ### Features
8
+
9
+ * **api:** api update ([7a801c6](https://github.com/anyformat-ai/anyformat-python/commit/7a801c6fe3aaa1c5f74c1508634bfbc06bd29910))
10
+
3
11
  ## 0.2.0 (2026-04-18)
4
12
 
5
13
  Full Changelog: [v0.1.2...v0.2.0](https://github.com/anyformat-ai/anyformat-python/compare/v0.1.2...v0.2.0)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: anyformat
3
- Version: 0.2.0
3
+ Version: 0.3.0
4
4
  Summary: The official Python library for the anyformat API
5
5
  Project-URL: Homepage, https://github.com/anyformat-ai/anyformat-python
6
6
  Project-URL: Repository, https://github.com/anyformat-ai/anyformat-python
@@ -20,18 +20,9 @@ Methods:
20
20
 
21
21
  # Files
22
22
 
23
- Types:
24
-
25
- ```python
26
- from anyformat.types import FileCreateResponse, FileListResponse
27
- ```
28
-
29
23
  Methods:
30
24
 
31
- - <code title="post /v2/files/">client.files.<a href="./src/anyformat/resources/files.py">create</a>(\*\*<a href="src/anyformat/types/file_create_params.py">params</a>) -> <a href="./src/anyformat/types/file_create_response.py">FileCreateResponse</a></code>
32
- - <code title="get /v2/files/">client.files.<a href="./src/anyformat/resources/files.py">list</a>(\*\*<a href="src/anyformat/types/file_list_params.py">params</a>) -> <a href="./src/anyformat/types/file_list_response.py">FileListResponse</a></code>
33
25
  - <code title="delete /v2/files/{collection_id}/">client.files.<a href="./src/anyformat/resources/files.py">delete</a>(collection_id) -> None</code>
34
- - <code title="get /v2/files/{collection_id}/extraction/">client.files.<a href="./src/anyformat/resources/files.py">get_extraction_results</a>(collection_id) -> object</code>
35
26
 
36
27
  # Workflows
37
28
 
@@ -54,6 +45,5 @@ Methods:
54
45
  - <code title="get /v2/workflows/">client.workflows.<a href="./src/anyformat/resources/workflows.py">list</a>(\*\*<a href="src/anyformat/types/workflow_list_params.py">params</a>) -> <a href="./src/anyformat/types/workflow_list_response.py">WorkflowListResponse</a></code>
55
46
  - <code title="delete /v2/workflows/{workflow_id}/">client.workflows.<a href="./src/anyformat/resources/workflows.py">delete</a>(workflow_id) -> None</code>
56
47
  - <code title="get /v2/workflows/{workflow_id}/runs/">client.workflows.<a href="./src/anyformat/resources/workflows.py">list_runs</a>(workflow_id, \*\*<a href="src/anyformat/types/workflow_list_runs_params.py">params</a>) -> <a href="./src/anyformat/types/workflow_list_runs_response.py">WorkflowListRunsResponse</a></code>
57
- - <code title="get /v2/workflows/{workflow_id}/results/">client.workflows.<a href="./src/anyformat/resources/workflows.py">results</a>(workflow_id, \*\*<a href="src/anyformat/types/workflow_results_params.py">params</a>) -> object</code>
58
48
  - <code title="post /v2/workflows/{workflow_id}/run/">client.workflows.<a href="./src/anyformat/resources/workflows.py">run</a>(workflow_id, \*\*<a href="src/anyformat/types/workflow_run_params.py">params</a>) -> <a href="./src/anyformat/types/workflow_run_response.py">WorkflowRunResponse</a></code>
59
49
  - <code title="post /v2/workflows/{workflow_id}/upload/">client.workflows.<a href="./src/anyformat/resources/workflows.py">upload</a>(workflow_id, \*\*<a href="src/anyformat/types/workflow_upload_params.py">params</a>) -> <a href="./src/anyformat/types/workflow_upload_response.py">WorkflowUploadResponse</a></code>
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "anyformat"
3
- version = "0.2.0"
3
+ version = "0.3.0"
4
4
  description = "The official Python library for the anyformat API"
5
5
  dynamic = ["readme"]
6
6
  license = "Apache-2.0"
@@ -1,4 +1,4 @@
1
1
  # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  __title__ = "anyformat"
4
- __version__ = "0.2.0" # x-release-please-version
4
+ __version__ = "0.3.0" # x-release-please-version
@@ -0,0 +1,169 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ import httpx
6
+
7
+ from .._types import Body, Query, Headers, NoneType, NotGiven, not_given
8
+ from .._utils import path_template
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
+
19
+ __all__ = ["FilesResource", "AsyncFilesResource"]
20
+
21
+
22
+ class FilesResource(SyncAPIResource):
23
+ """File collection management."""
24
+
25
+ @cached_property
26
+ def with_raw_response(self) -> FilesResourceWithRawResponse:
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/anyformat-ai/anyformat-python#accessing-raw-response-data-eg-headers
32
+ """
33
+ return FilesResourceWithRawResponse(self)
34
+
35
+ @cached_property
36
+ def with_streaming_response(self) -> FilesResourceWithStreamingResponse:
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/anyformat-ai/anyformat-python#with_streaming_response
41
+ """
42
+ return FilesResourceWithStreamingResponse(self)
43
+
44
+ def delete(
45
+ self,
46
+ collection_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
+ """
56
+ Delete a file collection and all its files.
57
+
58
+ Args:
59
+ extra_headers: Send extra headers
60
+
61
+ extra_query: Add additional query parameters to the request
62
+
63
+ extra_body: Add additional JSON properties to the request
64
+
65
+ timeout: Override the client-level default timeout for this request, in seconds
66
+ """
67
+ if not collection_id:
68
+ raise ValueError(f"Expected a non-empty value for `collection_id` but received {collection_id!r}")
69
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
70
+ return self._delete(
71
+ path_template("/v2/files/{collection_id}/", collection_id=collection_id),
72
+ options=make_request_options(
73
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
74
+ ),
75
+ cast_to=NoneType,
76
+ )
77
+
78
+
79
+ class AsyncFilesResource(AsyncAPIResource):
80
+ """File collection management."""
81
+
82
+ @cached_property
83
+ def with_raw_response(self) -> AsyncFilesResourceWithRawResponse:
84
+ """
85
+ This property can be used as a prefix for any HTTP method call to return
86
+ the raw response object instead of the parsed content.
87
+
88
+ For more information, see https://www.github.com/anyformat-ai/anyformat-python#accessing-raw-response-data-eg-headers
89
+ """
90
+ return AsyncFilesResourceWithRawResponse(self)
91
+
92
+ @cached_property
93
+ def with_streaming_response(self) -> AsyncFilesResourceWithStreamingResponse:
94
+ """
95
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
96
+
97
+ For more information, see https://www.github.com/anyformat-ai/anyformat-python#with_streaming_response
98
+ """
99
+ return AsyncFilesResourceWithStreamingResponse(self)
100
+
101
+ async def delete(
102
+ self,
103
+ collection_id: str,
104
+ *,
105
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
106
+ # The extra values given here take precedence over values defined on the client or passed to this method.
107
+ extra_headers: Headers | None = None,
108
+ extra_query: Query | None = None,
109
+ extra_body: Body | None = None,
110
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
111
+ ) -> None:
112
+ """
113
+ Delete a file collection and all its files.
114
+
115
+ Args:
116
+ extra_headers: Send extra headers
117
+
118
+ extra_query: Add additional query parameters to the request
119
+
120
+ extra_body: Add additional JSON properties to the request
121
+
122
+ timeout: Override the client-level default timeout for this request, in seconds
123
+ """
124
+ if not collection_id:
125
+ raise ValueError(f"Expected a non-empty value for `collection_id` but received {collection_id!r}")
126
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
127
+ return await self._delete(
128
+ path_template("/v2/files/{collection_id}/", collection_id=collection_id),
129
+ options=make_request_options(
130
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
131
+ ),
132
+ cast_to=NoneType,
133
+ )
134
+
135
+
136
+ class FilesResourceWithRawResponse:
137
+ def __init__(self, files: FilesResource) -> None:
138
+ self._files = files
139
+
140
+ self.delete = to_raw_response_wrapper(
141
+ files.delete,
142
+ )
143
+
144
+
145
+ class AsyncFilesResourceWithRawResponse:
146
+ def __init__(self, files: AsyncFilesResource) -> None:
147
+ self._files = files
148
+
149
+ self.delete = async_to_raw_response_wrapper(
150
+ files.delete,
151
+ )
152
+
153
+
154
+ class FilesResourceWithStreamingResponse:
155
+ def __init__(self, files: FilesResource) -> None:
156
+ self._files = files
157
+
158
+ self.delete = to_streamed_response_wrapper(
159
+ files.delete,
160
+ )
161
+
162
+
163
+ class AsyncFilesResourceWithStreamingResponse:
164
+ def __init__(self, files: AsyncFilesResource) -> None:
165
+ self._files = files
166
+
167
+ self.delete = async_to_streamed_response_wrapper(
168
+ files.delete,
169
+ )
@@ -6,13 +6,7 @@ from typing import Optional
6
6
 
7
7
  import httpx
8
8
 
9
- from ..types import (
10
- workflow_run_params,
11
- workflow_list_params,
12
- workflow_upload_params,
13
- workflow_results_params,
14
- workflow_list_runs_params,
15
- )
9
+ from ..types import workflow_run_params, workflow_list_params, workflow_upload_params, workflow_list_runs_params
16
10
  from .._types import Body, Omit, Query, Headers, NoneType, NotGiven, omit, not_given
17
11
  from .._utils import path_template, maybe_transform, async_maybe_transform
18
12
  from .._compat import cached_property
@@ -234,59 +228,11 @@ class WorkflowsResource(SyncAPIResource):
234
228
  cast_to=WorkflowListRunsResponse,
235
229
  )
236
230
 
237
- def results(
238
- self,
239
- workflow_id: str,
240
- *,
241
- as_lists: Optional[str] | Omit = omit,
242
- output_format: str | Omit = omit,
243
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
244
- # The extra values given here take precedence over values defined on the client or passed to this method.
245
- extra_headers: Headers | None = None,
246
- extra_query: Query | None = None,
247
- extra_body: Body | None = None,
248
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
249
- ) -> object:
250
- """
251
- Get workflow results.
252
-
253
- Args:
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 workflow_id:
263
- raise ValueError(f"Expected a non-empty value for `workflow_id` but received {workflow_id!r}")
264
- return self._get(
265
- path_template("/v2/workflows/{workflow_id}/results/", workflow_id=workflow_id),
266
- options=make_request_options(
267
- extra_headers=extra_headers,
268
- extra_query=extra_query,
269
- extra_body=extra_body,
270
- timeout=timeout,
271
- query=maybe_transform(
272
- {
273
- "as_lists": as_lists,
274
- "output_format": output_format,
275
- },
276
- workflow_results_params.WorkflowResultsParams,
277
- ),
278
- ),
279
- cast_to=object,
280
- )
281
-
282
231
  def run(
283
232
  self,
284
233
  workflow_id: str,
285
234
  *,
286
- content_type: Optional[str] | Omit = omit,
287
235
  file: Optional[str] | Omit = omit,
288
- file_base64: Optional[str] | Omit = omit,
289
- filename: Optional[str] | Omit = omit,
290
236
  text: Optional[str] | Omit = omit,
291
237
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
292
238
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -317,10 +263,7 @@ class WorkflowsResource(SyncAPIResource):
317
263
  path_template("/v2/workflows/{workflow_id}/run/", workflow_id=workflow_id),
318
264
  body=maybe_transform(
319
265
  {
320
- "content_type": content_type,
321
266
  "file": file,
322
- "file_base64": file_base64,
323
- "filename": filename,
324
267
  "text": text,
325
268
  },
326
269
  workflow_run_params.WorkflowRunParams,
@@ -335,10 +278,7 @@ class WorkflowsResource(SyncAPIResource):
335
278
  self,
336
279
  workflow_id: str,
337
280
  *,
338
- content_type: Optional[str] | Omit = omit,
339
281
  file: Optional[str] | Omit = omit,
340
- file_base64: Optional[str] | Omit = omit,
341
- filename: Optional[str] | Omit = omit,
342
282
  text: Optional[str] | Omit = omit,
343
283
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
344
284
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -369,10 +309,7 @@ class WorkflowsResource(SyncAPIResource):
369
309
  path_template("/v2/workflows/{workflow_id}/upload/", workflow_id=workflow_id),
370
310
  body=maybe_transform(
371
311
  {
372
- "content_type": content_type,
373
312
  "file": file,
374
- "file_base64": file_base64,
375
- "filename": filename,
376
313
  "text": text,
377
314
  },
378
315
  workflow_upload_params.WorkflowUploadParams,
@@ -585,59 +522,11 @@ class AsyncWorkflowsResource(AsyncAPIResource):
585
522
  cast_to=WorkflowListRunsResponse,
586
523
  )
587
524
 
588
- async def results(
589
- self,
590
- workflow_id: str,
591
- *,
592
- as_lists: Optional[str] | Omit = omit,
593
- output_format: str | Omit = omit,
594
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
595
- # The extra values given here take precedence over values defined on the client or passed to this method.
596
- extra_headers: Headers | None = None,
597
- extra_query: Query | None = None,
598
- extra_body: Body | None = None,
599
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
600
- ) -> object:
601
- """
602
- Get workflow results.
603
-
604
- Args:
605
- extra_headers: Send extra headers
606
-
607
- extra_query: Add additional query parameters to the request
608
-
609
- extra_body: Add additional JSON properties to the request
610
-
611
- timeout: Override the client-level default timeout for this request, in seconds
612
- """
613
- if not workflow_id:
614
- raise ValueError(f"Expected a non-empty value for `workflow_id` but received {workflow_id!r}")
615
- return await self._get(
616
- path_template("/v2/workflows/{workflow_id}/results/", workflow_id=workflow_id),
617
- options=make_request_options(
618
- extra_headers=extra_headers,
619
- extra_query=extra_query,
620
- extra_body=extra_body,
621
- timeout=timeout,
622
- query=await async_maybe_transform(
623
- {
624
- "as_lists": as_lists,
625
- "output_format": output_format,
626
- },
627
- workflow_results_params.WorkflowResultsParams,
628
- ),
629
- ),
630
- cast_to=object,
631
- )
632
-
633
525
  async def run(
634
526
  self,
635
527
  workflow_id: str,
636
528
  *,
637
- content_type: Optional[str] | Omit = omit,
638
529
  file: Optional[str] | Omit = omit,
639
- file_base64: Optional[str] | Omit = omit,
640
- filename: Optional[str] | Omit = omit,
641
530
  text: Optional[str] | Omit = omit,
642
531
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
643
532
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -668,10 +557,7 @@ class AsyncWorkflowsResource(AsyncAPIResource):
668
557
  path_template("/v2/workflows/{workflow_id}/run/", workflow_id=workflow_id),
669
558
  body=await async_maybe_transform(
670
559
  {
671
- "content_type": content_type,
672
560
  "file": file,
673
- "file_base64": file_base64,
674
- "filename": filename,
675
561
  "text": text,
676
562
  },
677
563
  workflow_run_params.WorkflowRunParams,
@@ -686,10 +572,7 @@ class AsyncWorkflowsResource(AsyncAPIResource):
686
572
  self,
687
573
  workflow_id: str,
688
574
  *,
689
- content_type: Optional[str] | Omit = omit,
690
575
  file: Optional[str] | Omit = omit,
691
- file_base64: Optional[str] | Omit = omit,
692
- filename: Optional[str] | Omit = omit,
693
576
  text: Optional[str] | Omit = omit,
694
577
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
695
578
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -720,10 +603,7 @@ class AsyncWorkflowsResource(AsyncAPIResource):
720
603
  path_template("/v2/workflows/{workflow_id}/upload/", workflow_id=workflow_id),
721
604
  body=await async_maybe_transform(
722
605
  {
723
- "content_type": content_type,
724
606
  "file": file,
725
- "file_base64": file_base64,
726
- "filename": filename,
727
607
  "text": text,
728
608
  },
729
609
  workflow_upload_params.WorkflowUploadParams,
@@ -754,9 +634,6 @@ class WorkflowsResourceWithRawResponse:
754
634
  self.list_runs = to_raw_response_wrapper(
755
635
  workflows.list_runs,
756
636
  )
757
- self.results = to_raw_response_wrapper(
758
- workflows.results,
759
- )
760
637
  self.run = to_raw_response_wrapper(
761
638
  workflows.run,
762
639
  )
@@ -784,9 +661,6 @@ class AsyncWorkflowsResourceWithRawResponse:
784
661
  self.list_runs = async_to_raw_response_wrapper(
785
662
  workflows.list_runs,
786
663
  )
787
- self.results = async_to_raw_response_wrapper(
788
- workflows.results,
789
- )
790
664
  self.run = async_to_raw_response_wrapper(
791
665
  workflows.run,
792
666
  )
@@ -814,9 +688,6 @@ class WorkflowsResourceWithStreamingResponse:
814
688
  self.list_runs = to_streamed_response_wrapper(
815
689
  workflows.list_runs,
816
690
  )
817
- self.results = to_streamed_response_wrapper(
818
- workflows.results,
819
- )
820
691
  self.run = to_streamed_response_wrapper(
821
692
  workflows.run,
822
693
  )
@@ -844,9 +715,6 @@ class AsyncWorkflowsResourceWithStreamingResponse:
844
715
  self.list_runs = async_to_streamed_response_wrapper(
845
716
  workflows.list_runs,
846
717
  )
847
- self.results = async_to_streamed_response_wrapper(
848
- workflows.results,
849
- )
850
718
  self.run = async_to_streamed_response_wrapper(
851
719
  workflows.run,
852
720
  )
@@ -3,11 +3,7 @@
3
3
  from __future__ import annotations
4
4
 
5
5
  from .workflow import Workflow as Workflow
6
- from .file_list_params import FileListParams as FileListParams
7
- from .file_create_params import FileCreateParams as FileCreateParams
8
- from .file_list_response import FileListResponse as FileListResponse
9
6
  from .workflow_run_params import WorkflowRunParams as WorkflowRunParams
10
- from .file_create_response import FileCreateResponse as FileCreateResponse
11
7
  from .workflow_list_params import WorkflowListParams as WorkflowListParams
12
8
  from .webhook_create_params import WebhookCreateParams as WebhookCreateParams
13
9
  from .webhook_list_response import WebhookListResponse as WebhookListResponse
@@ -15,7 +11,6 @@ from .workflow_run_response import WorkflowRunResponse as WorkflowRunResponse
15
11
  from .workflow_list_response import WorkflowListResponse as WorkflowListResponse
16
12
  from .workflow_upload_params import WorkflowUploadParams as WorkflowUploadParams
17
13
  from .webhook_create_response import WebhookCreateResponse as WebhookCreateResponse
18
- from .workflow_results_params import WorkflowResultsParams as WorkflowResultsParams
19
14
  from .workflow_upload_response import WorkflowUploadResponse as WorkflowUploadResponse
20
15
  from .workflow_list_runs_params import WorkflowListRunsParams as WorkflowListRunsParams
21
16
  from .workflow_list_runs_response import WorkflowListRunsResponse as WorkflowListRunsResponse
@@ -9,12 +9,6 @@ __all__ = ["WorkflowRunParams"]
9
9
 
10
10
 
11
11
  class WorkflowRunParams(TypedDict, total=False):
12
- content_type: Optional[str]
13
-
14
12
  file: Optional[str]
15
13
 
16
- file_base64: Optional[str]
17
-
18
- filename: Optional[str]
19
-
20
14
  text: Optional[str]
@@ -9,12 +9,6 @@ __all__ = ["WorkflowUploadParams"]
9
9
 
10
10
 
11
11
  class WorkflowUploadParams(TypedDict, total=False):
12
- content_type: Optional[str]
13
-
14
12
  file: Optional[str]
15
13
 
16
- file_base64: Optional[str]
17
-
18
- filename: Optional[str]
19
-
20
14
  text: Optional[str]
@@ -0,0 +1,106 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ import os
6
+ from typing import Any, cast
7
+
8
+ import pytest
9
+
10
+ from anyformat import Anyformat, AsyncAnyformat
11
+
12
+ base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
13
+
14
+
15
+ class TestFiles:
16
+ parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
17
+
18
+ @pytest.mark.skip(reason="Mock server tests are disabled")
19
+ @parametrize
20
+ def test_method_delete(self, client: Anyformat) -> None:
21
+ file = client.files.delete(
22
+ "collection_id",
23
+ )
24
+ assert file is None
25
+
26
+ @pytest.mark.skip(reason="Mock server tests are disabled")
27
+ @parametrize
28
+ def test_raw_response_delete(self, client: Anyformat) -> None:
29
+ response = client.files.with_raw_response.delete(
30
+ "collection_id",
31
+ )
32
+
33
+ assert response.is_closed is True
34
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
35
+ file = response.parse()
36
+ assert file is None
37
+
38
+ @pytest.mark.skip(reason="Mock server tests are disabled")
39
+ @parametrize
40
+ def test_streaming_response_delete(self, client: Anyformat) -> None:
41
+ with client.files.with_streaming_response.delete(
42
+ "collection_id",
43
+ ) as response:
44
+ assert not response.is_closed
45
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
46
+
47
+ file = response.parse()
48
+ assert file is None
49
+
50
+ assert cast(Any, response.is_closed) is True
51
+
52
+ @pytest.mark.skip(reason="Mock server tests are disabled")
53
+ @parametrize
54
+ def test_path_params_delete(self, client: Anyformat) -> None:
55
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection_id` but received ''"):
56
+ client.files.with_raw_response.delete(
57
+ "",
58
+ )
59
+
60
+
61
+ class TestAsyncFiles:
62
+ parametrize = pytest.mark.parametrize(
63
+ "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"]
64
+ )
65
+
66
+ @pytest.mark.skip(reason="Mock server tests are disabled")
67
+ @parametrize
68
+ async def test_method_delete(self, async_client: AsyncAnyformat) -> None:
69
+ file = await async_client.files.delete(
70
+ "collection_id",
71
+ )
72
+ assert file is None
73
+
74
+ @pytest.mark.skip(reason="Mock server tests are disabled")
75
+ @parametrize
76
+ async def test_raw_response_delete(self, async_client: AsyncAnyformat) -> None:
77
+ response = await async_client.files.with_raw_response.delete(
78
+ "collection_id",
79
+ )
80
+
81
+ assert response.is_closed is True
82
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
83
+ file = await response.parse()
84
+ assert file is None
85
+
86
+ @pytest.mark.skip(reason="Mock server tests are disabled")
87
+ @parametrize
88
+ async def test_streaming_response_delete(self, async_client: AsyncAnyformat) -> None:
89
+ async with async_client.files.with_streaming_response.delete(
90
+ "collection_id",
91
+ ) as response:
92
+ assert not response.is_closed
93
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
94
+
95
+ file = await response.parse()
96
+ assert file is None
97
+
98
+ assert cast(Any, response.is_closed) is True
99
+
100
+ @pytest.mark.skip(reason="Mock server tests are disabled")
101
+ @parametrize
102
+ async def test_path_params_delete(self, async_client: AsyncAnyformat) -> None:
103
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection_id` but received ''"):
104
+ await async_client.files.with_raw_response.delete(
105
+ "",
106
+ )