groundx 2.5.10__py3-none-any.whl → 2.6.2__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.

Potentially problematic release.


This version of groundx might be problematic. Click here for more details.

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