groundx 2.0.15__py3-none-any.whl → 2.7.7__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. groundx/__init__.py +73 -21
  2. groundx/buckets/__init__.py +2 -0
  3. groundx/buckets/client.py +55 -388
  4. groundx/buckets/raw_client.py +628 -0
  5. groundx/client.py +22 -21
  6. groundx/core/__init__.py +5 -0
  7. groundx/core/api_error.py +13 -5
  8. groundx/core/client_wrapper.py +4 -3
  9. groundx/core/force_multipart.py +16 -0
  10. groundx/core/http_client.py +76 -32
  11. groundx/core/http_response.py +55 -0
  12. groundx/core/jsonable_encoder.py +0 -1
  13. groundx/core/pydantic_utilities.py +71 -112
  14. groundx/core/serialization.py +7 -3
  15. groundx/csv_splitter.py +64 -0
  16. groundx/customer/__init__.py +2 -0
  17. groundx/customer/client.py +31 -43
  18. groundx/customer/raw_client.py +91 -0
  19. groundx/documents/__init__.py +1 -2
  20. groundx/documents/client.py +455 -953
  21. groundx/documents/raw_client.py +1450 -0
  22. groundx/errors/__init__.py +2 -0
  23. groundx/errors/bad_request_error.py +4 -3
  24. groundx/errors/unauthorized_error.py +4 -3
  25. groundx/extract/__init__.py +48 -0
  26. groundx/extract/agents/__init__.py +7 -0
  27. groundx/extract/agents/agent.py +202 -0
  28. groundx/extract/classes/__init__.py +24 -0
  29. groundx/extract/classes/agent.py +23 -0
  30. groundx/extract/classes/api.py +15 -0
  31. groundx/extract/classes/document.py +338 -0
  32. groundx/extract/classes/field.py +88 -0
  33. groundx/extract/classes/groundx.py +147 -0
  34. groundx/extract/classes/prompt.py +36 -0
  35. groundx/extract/classes/test_document.py +109 -0
  36. groundx/extract/classes/test_field.py +43 -0
  37. groundx/extract/classes/test_groundx.py +223 -0
  38. groundx/extract/classes/test_prompt.py +68 -0
  39. groundx/extract/post_process/__init__.py +7 -0
  40. groundx/extract/post_process/post_process.py +33 -0
  41. groundx/extract/services/.DS_Store +0 -0
  42. groundx/extract/services/__init__.py +14 -0
  43. groundx/extract/services/csv.py +76 -0
  44. groundx/extract/services/logger.py +126 -0
  45. groundx/extract/services/logging_cfg.py +53 -0
  46. groundx/extract/services/ratelimit.py +104 -0
  47. groundx/extract/services/sheets_client.py +160 -0
  48. groundx/extract/services/status.py +197 -0
  49. groundx/extract/services/upload.py +68 -0
  50. groundx/extract/services/upload_minio.py +122 -0
  51. groundx/extract/services/upload_s3.py +91 -0
  52. groundx/extract/services/utility.py +52 -0
  53. groundx/extract/settings/__init__.py +15 -0
  54. groundx/extract/settings/settings.py +212 -0
  55. groundx/extract/settings/test_settings.py +512 -0
  56. groundx/extract/tasks/__init__.py +6 -0
  57. groundx/extract/tasks/utility.py +27 -0
  58. groundx/extract/utility/__init__.py +15 -0
  59. groundx/extract/utility/classes.py +193 -0
  60. groundx/extract/utility/test_utility.py +81 -0
  61. groundx/groups/__init__.py +2 -0
  62. groundx/groups/client.py +63 -550
  63. groundx/groups/raw_client.py +901 -0
  64. groundx/health/__init__.py +2 -0
  65. groundx/health/client.py +35 -101
  66. groundx/health/raw_client.py +193 -0
  67. groundx/ingest.py +771 -0
  68. groundx/search/__init__.py +2 -0
  69. groundx/search/client.py +94 -227
  70. groundx/search/raw_client.py +442 -0
  71. groundx/search/types/__init__.py +2 -0
  72. groundx/types/__init__.py +68 -16
  73. groundx/types/bounding_box_detail.py +4 -4
  74. groundx/types/bucket_detail.py +5 -5
  75. groundx/types/bucket_list_response.py +17 -3
  76. groundx/types/bucket_response.py +3 -3
  77. groundx/types/bucket_update_detail.py +4 -4
  78. groundx/types/bucket_update_response.py +3 -3
  79. groundx/types/customer_detail.py +2 -2
  80. groundx/types/customer_response.py +3 -3
  81. groundx/types/document.py +54 -0
  82. groundx/types/document_detail.py +16 -4
  83. groundx/types/document_list_response.py +4 -4
  84. groundx/types/document_local_ingest_request.py +7 -0
  85. groundx/types/document_lookup_response.py +8 -3
  86. groundx/types/document_response.py +3 -3
  87. groundx/types/document_type.py +21 -1
  88. groundx/types/group_detail.py +4 -4
  89. groundx/types/group_list_response.py +17 -3
  90. groundx/types/group_response.py +3 -3
  91. groundx/types/health_response.py +3 -3
  92. groundx/types/health_response_health.py +3 -3
  93. groundx/types/health_service.py +5 -5
  94. groundx/types/ingest_local_document.py +25 -0
  95. groundx/types/ingest_local_document_metadata.py +51 -0
  96. groundx/types/ingest_remote_document.py +15 -6
  97. groundx/types/ingest_response.py +4 -4
  98. groundx/types/{process_status_response_ingest.py → ingest_status.py} +8 -7
  99. groundx/types/{ingest_response_ingest.py → ingest_status_light.py} +7 -5
  100. groundx/types/ingest_status_progress.py +26 -0
  101. groundx/types/{process_status_response_ingest_progress_errors.py → ingest_status_progress_cancelled.py} +4 -4
  102. groundx/types/{process_status_response_ingest_progress_complete.py → ingest_status_progress_complete.py} +4 -4
  103. groundx/types/{process_status_response_ingest_progress_cancelled.py → ingest_status_progress_errors.py} +4 -4
  104. groundx/types/{process_status_response_ingest_progress_processing.py → ingest_status_progress_processing.py} +4 -4
  105. groundx/types/message_response.py +2 -2
  106. groundx/types/meter_detail.py +2 -2
  107. groundx/types/process_level.py +5 -0
  108. groundx/types/{process_status_response.py → processes_status_response.py} +8 -5
  109. groundx/types/processing_status.py +3 -1
  110. groundx/types/search_response.py +3 -3
  111. groundx/types/search_response_search.py +3 -3
  112. groundx/types/search_result_item.py +7 -5
  113. groundx/types/search_result_item_pages_item.py +41 -0
  114. groundx/types/subscription_detail.py +3 -3
  115. groundx/types/subscription_detail_meters.py +5 -5
  116. groundx/{documents/types/website_crawl_request_websites_item.py → types/website_source.py} +7 -7
  117. groundx/types/workflow_apply_request.py +24 -0
  118. groundx/types/workflow_detail.py +59 -0
  119. groundx/types/workflow_detail_chunk_strategy.py +5 -0
  120. groundx/types/workflow_detail_relationships.py +36 -0
  121. groundx/types/workflow_engine.py +58 -0
  122. groundx/types/workflow_engine_reasoning_effort.py +5 -0
  123. groundx/types/workflow_engine_service.py +7 -0
  124. groundx/types/workflow_prompt.py +37 -0
  125. groundx/types/workflow_prompt_group.py +25 -0
  126. groundx/types/workflow_prompt_role.py +5 -0
  127. groundx/types/workflow_request.py +31 -0
  128. groundx/types/workflow_request_chunk_strategy.py +5 -0
  129. groundx/types/workflow_response.py +20 -0
  130. groundx/types/workflow_step.py +33 -0
  131. groundx/types/workflow_step_config.py +33 -0
  132. groundx/types/workflow_step_config_field.py +8 -0
  133. groundx/types/workflow_steps.py +38 -0
  134. groundx/types/workflows_response.py +20 -0
  135. groundx/workflows/__init__.py +7 -0
  136. groundx/workflows/client.py +736 -0
  137. groundx/workflows/raw_client.py +841 -0
  138. groundx/workflows/types/__init__.py +7 -0
  139. groundx/workflows/types/workflows_get_request_id.py +5 -0
  140. {groundx-2.0.15.dist-info → groundx-2.7.7.dist-info}/LICENSE +1 -1
  141. {groundx-2.0.15.dist-info → groundx-2.7.7.dist-info}/METADATA +39 -22
  142. groundx-2.7.7.dist-info/RECORD +155 -0
  143. groundx/documents/types/__init__.py +0 -6
  144. groundx/documents/types/documents_ingest_local_request_files_item.py +0 -43
  145. groundx/types/process_status_response_ingest_progress.py +0 -26
  146. groundx-2.0.15.dist-info/RECORD +0 -82
  147. {groundx-2.0.15.dist-info → groundx-2.7.7.dist-info}/WHEEL +0 -0
@@ -0,0 +1,736 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
6
+ from ..core.request_options import RequestOptions
7
+ from ..types.message_response import MessageResponse
8
+ from ..types.workflow_request_chunk_strategy import WorkflowRequestChunkStrategy
9
+ from ..types.workflow_response import WorkflowResponse
10
+ from ..types.workflow_steps import WorkflowSteps
11
+ from ..types.workflows_response import WorkflowsResponse
12
+ from .raw_client import AsyncRawWorkflowsClient, RawWorkflowsClient
13
+ from .types.workflows_get_request_id import WorkflowsGetRequestId
14
+
15
+ # this is used as the default value for optional parameters
16
+ OMIT = typing.cast(typing.Any, ...)
17
+
18
+
19
+ class WorkflowsClient:
20
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
21
+ self._raw_client = RawWorkflowsClient(client_wrapper=client_wrapper)
22
+
23
+ @property
24
+ def with_raw_response(self) -> RawWorkflowsClient:
25
+ """
26
+ Retrieves a raw implementation of this client that returns raw responses.
27
+
28
+ Returns
29
+ -------
30
+ RawWorkflowsClient
31
+ """
32
+ return self._raw_client
33
+
34
+ def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> WorkflowsResponse:
35
+ """
36
+ Get all workflows associated with the API key.
37
+
38
+ Parameters
39
+ ----------
40
+ request_options : typing.Optional[RequestOptions]
41
+ Request-specific configuration.
42
+
43
+ Returns
44
+ -------
45
+ WorkflowsResponse
46
+ Look up success
47
+
48
+ Examples
49
+ --------
50
+ from groundx import GroundX
51
+
52
+ client = GroundX(
53
+ api_key="YOUR_API_KEY",
54
+ )
55
+ client.workflows.list()
56
+ """
57
+ _response = self._raw_client.list(request_options=request_options)
58
+ return _response.data
59
+
60
+ def create(
61
+ self,
62
+ *,
63
+ chunk_strategy: typing.Optional[WorkflowRequestChunkStrategy] = OMIT,
64
+ name: typing.Optional[str] = OMIT,
65
+ steps: typing.Optional[WorkflowSteps] = OMIT,
66
+ request_options: typing.Optional[RequestOptions] = None,
67
+ ) -> WorkflowResponse:
68
+ """
69
+ Create a workflow.
70
+
71
+ Parameters
72
+ ----------
73
+ chunk_strategy : typing.Optional[WorkflowRequestChunkStrategy]
74
+
75
+ name : typing.Optional[str]
76
+ The name of the workflow being created.
77
+
78
+ steps : typing.Optional[WorkflowSteps]
79
+
80
+ request_options : typing.Optional[RequestOptions]
81
+ Request-specific configuration.
82
+
83
+ Returns
84
+ -------
85
+ WorkflowResponse
86
+ Workflow successfully created
87
+
88
+ Examples
89
+ --------
90
+ from groundx import GroundX
91
+
92
+ client = GroundX(
93
+ api_key="YOUR_API_KEY",
94
+ )
95
+ client.workflows.create()
96
+ """
97
+ _response = self._raw_client.create(
98
+ chunk_strategy=chunk_strategy, name=name, steps=steps, request_options=request_options
99
+ )
100
+ return _response.data
101
+
102
+ def add_to_account(
103
+ self, *, workflow_id: str, request_options: typing.Optional[RequestOptions] = None
104
+ ) -> MessageResponse:
105
+ """
106
+ Assigns the given workflow to the customer account and is applied by default to all files unless overridden by document or bucket workflows.
107
+
108
+ Parameters
109
+ ----------
110
+ workflow_id : str
111
+ The id of the workflow that is being applied.
112
+
113
+ request_options : typing.Optional[RequestOptions]
114
+ Request-specific configuration.
115
+
116
+ Returns
117
+ -------
118
+ MessageResponse
119
+ Apply success
120
+
121
+ Examples
122
+ --------
123
+ from groundx import GroundX
124
+
125
+ client = GroundX(
126
+ api_key="YOUR_API_KEY",
127
+ )
128
+ client.workflows.add_to_account(
129
+ workflow_id="workflowId",
130
+ )
131
+ """
132
+ _response = self._raw_client.add_to_account(workflow_id=workflow_id, request_options=request_options)
133
+ return _response.data
134
+
135
+ def remove_from_account(self, *, request_options: typing.Optional[RequestOptions] = None) -> MessageResponse:
136
+ """
137
+ Removes the assigned workflow from the customer account.
138
+
139
+ Parameters
140
+ ----------
141
+ request_options : typing.Optional[RequestOptions]
142
+ Request-specific configuration.
143
+
144
+ Returns
145
+ -------
146
+ MessageResponse
147
+ Apply success
148
+
149
+ Examples
150
+ --------
151
+ from groundx import GroundX
152
+
153
+ client = GroundX(
154
+ api_key="YOUR_API_KEY",
155
+ )
156
+ client.workflows.remove_from_account()
157
+ """
158
+ _response = self._raw_client.remove_from_account(request_options=request_options)
159
+ return _response.data
160
+
161
+ def add_to_id(
162
+ self, id: int, *, workflow_id: str, request_options: typing.Optional[RequestOptions] = None
163
+ ) -> MessageResponse:
164
+ """
165
+ Assigns the given workflow to the group or bucket and is applied by default to all files unless overridden by document workflows.
166
+
167
+ Parameters
168
+ ----------
169
+ id : int
170
+ The id of the group or bucket that the workflow will be assigned to.
171
+
172
+ workflow_id : str
173
+ The id of the workflow that is being applied.
174
+
175
+ request_options : typing.Optional[RequestOptions]
176
+ Request-specific configuration.
177
+
178
+ Returns
179
+ -------
180
+ MessageResponse
181
+ Apply success
182
+
183
+ Examples
184
+ --------
185
+ from groundx import GroundX
186
+
187
+ client = GroundX(
188
+ api_key="YOUR_API_KEY",
189
+ )
190
+ client.workflows.add_to_id(
191
+ id=1,
192
+ workflow_id="workflowId",
193
+ )
194
+ """
195
+ _response = self._raw_client.add_to_id(id, workflow_id=workflow_id, request_options=request_options)
196
+ return _response.data
197
+
198
+ def remove_from_id(self, id: int, *, request_options: typing.Optional[RequestOptions] = None) -> MessageResponse:
199
+ """
200
+ Removes the assigned workflow from the customer account.
201
+
202
+ Parameters
203
+ ----------
204
+ id : int
205
+ The id of the group or bucket that the workflow will removed from.
206
+
207
+ request_options : typing.Optional[RequestOptions]
208
+ Request-specific configuration.
209
+
210
+ Returns
211
+ -------
212
+ MessageResponse
213
+ Apply success
214
+
215
+ Examples
216
+ --------
217
+ from groundx import GroundX
218
+
219
+ client = GroundX(
220
+ api_key="YOUR_API_KEY",
221
+ )
222
+ client.workflows.remove_from_id(
223
+ id=1,
224
+ )
225
+ """
226
+ _response = self._raw_client.remove_from_id(id, request_options=request_options)
227
+ return _response.data
228
+
229
+ def get(
230
+ self, id: WorkflowsGetRequestId, *, request_options: typing.Optional[RequestOptions] = None
231
+ ) -> WorkflowResponse:
232
+ """
233
+ look up a specific workflow by groupId, bucketId, or workflowId.
234
+
235
+ Parameters
236
+ ----------
237
+ id : WorkflowsGetRequestId
238
+ The id of the group, bucket, or workflow to look up.
239
+
240
+ request_options : typing.Optional[RequestOptions]
241
+ Request-specific configuration.
242
+
243
+ Returns
244
+ -------
245
+ WorkflowResponse
246
+ Look up success
247
+
248
+ Examples
249
+ --------
250
+ from groundx import GroundX
251
+
252
+ client = GroundX(
253
+ api_key="YOUR_API_KEY",
254
+ )
255
+ client.workflows.get(
256
+ id=1,
257
+ )
258
+ """
259
+ _response = self._raw_client.get(id, request_options=request_options)
260
+ return _response.data
261
+
262
+ def update(
263
+ self,
264
+ id: str,
265
+ *,
266
+ chunk_strategy: typing.Optional[WorkflowRequestChunkStrategy] = OMIT,
267
+ name: typing.Optional[str] = OMIT,
268
+ steps: typing.Optional[WorkflowSteps] = OMIT,
269
+ request_options: typing.Optional[RequestOptions] = None,
270
+ ) -> WorkflowResponse:
271
+ """
272
+ Update an existing workflow.
273
+
274
+ Parameters
275
+ ----------
276
+ id : str
277
+ The workflowId of the workflow being updated.
278
+
279
+ chunk_strategy : typing.Optional[WorkflowRequestChunkStrategy]
280
+
281
+ name : typing.Optional[str]
282
+ The name of the workflow being created.
283
+
284
+ steps : typing.Optional[WorkflowSteps]
285
+
286
+ request_options : typing.Optional[RequestOptions]
287
+ Request-specific configuration.
288
+
289
+ Returns
290
+ -------
291
+ WorkflowResponse
292
+ Update success
293
+
294
+ Examples
295
+ --------
296
+ from groundx import GroundX
297
+
298
+ client = GroundX(
299
+ api_key="YOUR_API_KEY",
300
+ )
301
+ client.workflows.update(
302
+ id="id",
303
+ )
304
+ """
305
+ _response = self._raw_client.update(
306
+ id, chunk_strategy=chunk_strategy, name=name, steps=steps, request_options=request_options
307
+ )
308
+ return _response.data
309
+
310
+ def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> MessageResponse:
311
+ """
312
+ Delete a workflow.
313
+
314
+ Parameters
315
+ ----------
316
+ id : str
317
+ The workflowId of the workflow being deleted.
318
+
319
+ request_options : typing.Optional[RequestOptions]
320
+ Request-specific configuration.
321
+
322
+ Returns
323
+ -------
324
+ MessageResponse
325
+ Delete success
326
+
327
+ Examples
328
+ --------
329
+ from groundx import GroundX
330
+
331
+ client = GroundX(
332
+ api_key="YOUR_API_KEY",
333
+ )
334
+ client.workflows.delete(
335
+ id="id",
336
+ )
337
+ """
338
+ _response = self._raw_client.delete(id, request_options=request_options)
339
+ return _response.data
340
+
341
+
342
+ class AsyncWorkflowsClient:
343
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
344
+ self._raw_client = AsyncRawWorkflowsClient(client_wrapper=client_wrapper)
345
+
346
+ @property
347
+ def with_raw_response(self) -> AsyncRawWorkflowsClient:
348
+ """
349
+ Retrieves a raw implementation of this client that returns raw responses.
350
+
351
+ Returns
352
+ -------
353
+ AsyncRawWorkflowsClient
354
+ """
355
+ return self._raw_client
356
+
357
+ async def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> WorkflowsResponse:
358
+ """
359
+ Get all workflows associated with the API key.
360
+
361
+ Parameters
362
+ ----------
363
+ request_options : typing.Optional[RequestOptions]
364
+ Request-specific configuration.
365
+
366
+ Returns
367
+ -------
368
+ WorkflowsResponse
369
+ Look up success
370
+
371
+ Examples
372
+ --------
373
+ import asyncio
374
+
375
+ from groundx import AsyncGroundX
376
+
377
+ client = AsyncGroundX(
378
+ api_key="YOUR_API_KEY",
379
+ )
380
+
381
+
382
+ async def main() -> None:
383
+ await client.workflows.list()
384
+
385
+
386
+ asyncio.run(main())
387
+ """
388
+ _response = await self._raw_client.list(request_options=request_options)
389
+ return _response.data
390
+
391
+ async def create(
392
+ self,
393
+ *,
394
+ chunk_strategy: typing.Optional[WorkflowRequestChunkStrategy] = OMIT,
395
+ name: typing.Optional[str] = OMIT,
396
+ steps: typing.Optional[WorkflowSteps] = OMIT,
397
+ request_options: typing.Optional[RequestOptions] = None,
398
+ ) -> WorkflowResponse:
399
+ """
400
+ Create a workflow.
401
+
402
+ Parameters
403
+ ----------
404
+ chunk_strategy : typing.Optional[WorkflowRequestChunkStrategy]
405
+
406
+ name : typing.Optional[str]
407
+ The name of the workflow being created.
408
+
409
+ steps : typing.Optional[WorkflowSteps]
410
+
411
+ request_options : typing.Optional[RequestOptions]
412
+ Request-specific configuration.
413
+
414
+ Returns
415
+ -------
416
+ WorkflowResponse
417
+ Workflow successfully created
418
+
419
+ Examples
420
+ --------
421
+ import asyncio
422
+
423
+ from groundx import AsyncGroundX
424
+
425
+ client = AsyncGroundX(
426
+ api_key="YOUR_API_KEY",
427
+ )
428
+
429
+
430
+ async def main() -> None:
431
+ await client.workflows.create()
432
+
433
+
434
+ asyncio.run(main())
435
+ """
436
+ _response = await self._raw_client.create(
437
+ chunk_strategy=chunk_strategy, name=name, steps=steps, request_options=request_options
438
+ )
439
+ return _response.data
440
+
441
+ async def add_to_account(
442
+ self, *, workflow_id: str, request_options: typing.Optional[RequestOptions] = None
443
+ ) -> MessageResponse:
444
+ """
445
+ Assigns the given workflow to the customer account and is applied by default to all files unless overridden by document or bucket workflows.
446
+
447
+ Parameters
448
+ ----------
449
+ workflow_id : str
450
+ The id of the workflow that is being applied.
451
+
452
+ request_options : typing.Optional[RequestOptions]
453
+ Request-specific configuration.
454
+
455
+ Returns
456
+ -------
457
+ MessageResponse
458
+ Apply success
459
+
460
+ Examples
461
+ --------
462
+ import asyncio
463
+
464
+ from groundx import AsyncGroundX
465
+
466
+ client = AsyncGroundX(
467
+ api_key="YOUR_API_KEY",
468
+ )
469
+
470
+
471
+ async def main() -> None:
472
+ await client.workflows.add_to_account(
473
+ workflow_id="workflowId",
474
+ )
475
+
476
+
477
+ asyncio.run(main())
478
+ """
479
+ _response = await self._raw_client.add_to_account(workflow_id=workflow_id, request_options=request_options)
480
+ return _response.data
481
+
482
+ async def remove_from_account(self, *, request_options: typing.Optional[RequestOptions] = None) -> MessageResponse:
483
+ """
484
+ Removes the assigned workflow from the customer account.
485
+
486
+ Parameters
487
+ ----------
488
+ request_options : typing.Optional[RequestOptions]
489
+ Request-specific configuration.
490
+
491
+ Returns
492
+ -------
493
+ MessageResponse
494
+ Apply success
495
+
496
+ Examples
497
+ --------
498
+ import asyncio
499
+
500
+ from groundx import AsyncGroundX
501
+
502
+ client = AsyncGroundX(
503
+ api_key="YOUR_API_KEY",
504
+ )
505
+
506
+
507
+ async def main() -> None:
508
+ await client.workflows.remove_from_account()
509
+
510
+
511
+ asyncio.run(main())
512
+ """
513
+ _response = await self._raw_client.remove_from_account(request_options=request_options)
514
+ return _response.data
515
+
516
+ async def add_to_id(
517
+ self, id: int, *, workflow_id: str, request_options: typing.Optional[RequestOptions] = None
518
+ ) -> MessageResponse:
519
+ """
520
+ Assigns the given workflow to the group or bucket and is applied by default to all files unless overridden by document workflows.
521
+
522
+ Parameters
523
+ ----------
524
+ id : int
525
+ The id of the group or bucket that the workflow will be assigned to.
526
+
527
+ workflow_id : str
528
+ The id of the workflow that is being applied.
529
+
530
+ request_options : typing.Optional[RequestOptions]
531
+ Request-specific configuration.
532
+
533
+ Returns
534
+ -------
535
+ MessageResponse
536
+ Apply success
537
+
538
+ Examples
539
+ --------
540
+ import asyncio
541
+
542
+ from groundx import AsyncGroundX
543
+
544
+ client = AsyncGroundX(
545
+ api_key="YOUR_API_KEY",
546
+ )
547
+
548
+
549
+ async def main() -> None:
550
+ await client.workflows.add_to_id(
551
+ id=1,
552
+ workflow_id="workflowId",
553
+ )
554
+
555
+
556
+ asyncio.run(main())
557
+ """
558
+ _response = await self._raw_client.add_to_id(id, workflow_id=workflow_id, request_options=request_options)
559
+ return _response.data
560
+
561
+ async def remove_from_id(
562
+ self, id: int, *, request_options: typing.Optional[RequestOptions] = None
563
+ ) -> MessageResponse:
564
+ """
565
+ Removes the assigned workflow from the customer account.
566
+
567
+ Parameters
568
+ ----------
569
+ id : int
570
+ The id of the group or bucket that the workflow will removed from.
571
+
572
+ request_options : typing.Optional[RequestOptions]
573
+ Request-specific configuration.
574
+
575
+ Returns
576
+ -------
577
+ MessageResponse
578
+ Apply success
579
+
580
+ Examples
581
+ --------
582
+ import asyncio
583
+
584
+ from groundx import AsyncGroundX
585
+
586
+ client = AsyncGroundX(
587
+ api_key="YOUR_API_KEY",
588
+ )
589
+
590
+
591
+ async def main() -> None:
592
+ await client.workflows.remove_from_id(
593
+ id=1,
594
+ )
595
+
596
+
597
+ asyncio.run(main())
598
+ """
599
+ _response = await self._raw_client.remove_from_id(id, request_options=request_options)
600
+ return _response.data
601
+
602
+ async def get(
603
+ self, id: WorkflowsGetRequestId, *, request_options: typing.Optional[RequestOptions] = None
604
+ ) -> WorkflowResponse:
605
+ """
606
+ look up a specific workflow by groupId, bucketId, or workflowId.
607
+
608
+ Parameters
609
+ ----------
610
+ id : WorkflowsGetRequestId
611
+ The id of the group, bucket, or workflow to look up.
612
+
613
+ request_options : typing.Optional[RequestOptions]
614
+ Request-specific configuration.
615
+
616
+ Returns
617
+ -------
618
+ WorkflowResponse
619
+ Look up success
620
+
621
+ Examples
622
+ --------
623
+ import asyncio
624
+
625
+ from groundx import AsyncGroundX
626
+
627
+ client = AsyncGroundX(
628
+ api_key="YOUR_API_KEY",
629
+ )
630
+
631
+
632
+ async def main() -> None:
633
+ await client.workflows.get(
634
+ id=1,
635
+ )
636
+
637
+
638
+ asyncio.run(main())
639
+ """
640
+ _response = await self._raw_client.get(id, request_options=request_options)
641
+ return _response.data
642
+
643
+ async def update(
644
+ self,
645
+ id: str,
646
+ *,
647
+ chunk_strategy: typing.Optional[WorkflowRequestChunkStrategy] = OMIT,
648
+ name: typing.Optional[str] = OMIT,
649
+ steps: typing.Optional[WorkflowSteps] = OMIT,
650
+ request_options: typing.Optional[RequestOptions] = None,
651
+ ) -> WorkflowResponse:
652
+ """
653
+ Update an existing workflow.
654
+
655
+ Parameters
656
+ ----------
657
+ id : str
658
+ The workflowId of the workflow being updated.
659
+
660
+ chunk_strategy : typing.Optional[WorkflowRequestChunkStrategy]
661
+
662
+ name : typing.Optional[str]
663
+ The name of the workflow being created.
664
+
665
+ steps : typing.Optional[WorkflowSteps]
666
+
667
+ request_options : typing.Optional[RequestOptions]
668
+ Request-specific configuration.
669
+
670
+ Returns
671
+ -------
672
+ WorkflowResponse
673
+ Update success
674
+
675
+ Examples
676
+ --------
677
+ import asyncio
678
+
679
+ from groundx import AsyncGroundX
680
+
681
+ client = AsyncGroundX(
682
+ api_key="YOUR_API_KEY",
683
+ )
684
+
685
+
686
+ async def main() -> None:
687
+ await client.workflows.update(
688
+ id="id",
689
+ )
690
+
691
+
692
+ asyncio.run(main())
693
+ """
694
+ _response = await self._raw_client.update(
695
+ id, chunk_strategy=chunk_strategy, name=name, steps=steps, request_options=request_options
696
+ )
697
+ return _response.data
698
+
699
+ async def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> MessageResponse:
700
+ """
701
+ Delete a workflow.
702
+
703
+ Parameters
704
+ ----------
705
+ id : str
706
+ The workflowId of the workflow being deleted.
707
+
708
+ request_options : typing.Optional[RequestOptions]
709
+ Request-specific configuration.
710
+
711
+ Returns
712
+ -------
713
+ MessageResponse
714
+ Delete success
715
+
716
+ Examples
717
+ --------
718
+ import asyncio
719
+
720
+ from groundx import AsyncGroundX
721
+
722
+ client = AsyncGroundX(
723
+ api_key="YOUR_API_KEY",
724
+ )
725
+
726
+
727
+ async def main() -> None:
728
+ await client.workflows.delete(
729
+ id="id",
730
+ )
731
+
732
+
733
+ asyncio.run(main())
734
+ """
735
+ _response = await self._raw_client.delete(id, request_options=request_options)
736
+ return _response.data