groundx 2.2.0__py3-none-any.whl → 2.2.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.
groundx/__init__.py CHANGED
@@ -37,6 +37,7 @@ from .types import (
37
37
  ProcessStatusResponseIngestProgressComplete,
38
38
  ProcessStatusResponseIngestProgressErrors,
39
39
  ProcessStatusResponseIngestProgressProcessing,
40
+ ProcessesStatusResponse,
40
41
  ProcessingStatus,
41
42
  SearchResponse,
42
43
  SearchResponseSearch,
@@ -95,6 +96,7 @@ __all__ = [
95
96
  "ProcessStatusResponseIngestProgressComplete",
96
97
  "ProcessStatusResponseIngestProgressErrors",
97
98
  "ProcessStatusResponseIngestProgressProcessing",
99
+ "ProcessesStatusResponse",
98
100
  "ProcessingStatus",
99
101
  "SearchContentRequestId",
100
102
  "SearchResponse",
@@ -16,7 +16,7 @@ class BaseClientWrapper:
16
16
  headers: typing.Dict[str, str] = {
17
17
  "X-Fern-Language": "Python",
18
18
  "X-Fern-SDK-Name": "groundx",
19
- "X-Fern-SDK-Version": "2.2.0",
19
+ "X-Fern-SDK-Version": "2.2.2",
20
20
  }
21
21
  headers["X-API-Key"] = self.api_key
22
22
  return headers
@@ -85,8 +85,8 @@ def _retry_timeout(response: httpx.Response, retries: int) -> float:
85
85
 
86
86
 
87
87
  def _should_retry(response: httpx.Response) -> bool:
88
- retriable_400s = [429, 408, 409]
89
- return response.status_code >= 500 or response.status_code in retriable_400s
88
+ retryable_400s = [429, 408, 409]
89
+ return response.status_code >= 500 or response.status_code in retryable_400s
90
90
 
91
91
 
92
92
  def remove_omit_from_dict(
@@ -79,7 +79,7 @@ def to_jsonable_with_fallback(
79
79
  class UniversalBaseModel(pydantic.BaseModel):
80
80
  if IS_PYDANTIC_V2:
81
81
  model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(
82
- # Allow fields begining with `model_` to be used in the model
82
+ # Allow fields beginning with `model_` to be used in the model
83
83
  protected_namespaces=(),
84
84
  ) # type: ignore # Pydantic v2
85
85
 
@@ -128,7 +128,7 @@ class UniversalBaseModel(pydantic.BaseModel):
128
128
  Override the default dict method to `exclude_unset` by default. This function patches
129
129
  `exclude_unset` to work include fields within non-None default values.
130
130
  """
131
- # Note: the logic here is multi-plexed given the levers exposed in Pydantic V1 vs V2
131
+ # Note: the logic here is multiplexed given the levers exposed in Pydantic V1 vs V2
132
132
  # Pydantic V1's .dict can be extremely slow, so we do not want to call it twice.
133
133
  #
134
134
  # We'd ideally do the same for Pydantic V2, but it shells out to a library to serialize models
@@ -21,6 +21,7 @@ from ..types.process_status_response import ProcessStatusResponse
21
21
  from ..core.jsonable_encoder import jsonable_encoder
22
22
  from ..types.document_lookup_response import DocumentLookupResponse
23
23
  from ..types.document_response import DocumentResponse
24
+ from ..types.processes_status_response import ProcessesStatusResponse
24
25
  from ..core.client_wrapper import AsyncClientWrapper
25
26
 
26
27
  # this is used as the default value for optional parameters
@@ -748,6 +749,64 @@ class DocumentsClient:
748
749
  raise ApiError(status_code=_response.status_code, body=_response.text)
749
750
  raise ApiError(status_code=_response.status_code, body=_response_json)
750
751
 
752
+ def document_get_processes(
753
+ self,
754
+ *,
755
+ n: typing.Optional[int] = None,
756
+ status: typing.Optional[ProcessingStatus] = None,
757
+ request_options: typing.Optional[RequestOptions] = None,
758
+ ) -> ProcessesStatusResponse:
759
+ """
760
+ Get a list of ingest process requests, sorted from most recent to least.
761
+
762
+ Parameters
763
+ ----------
764
+ n : typing.Optional[int]
765
+ The maximum number of returned processes. Accepts 1-100 with a default of 20.
766
+
767
+ status : typing.Optional[ProcessingStatus]
768
+ A status filter on the processing status. If this value is set, then only processes with this status will be returned in the results.
769
+
770
+ request_options : typing.Optional[RequestOptions]
771
+ Request-specific configuration.
772
+
773
+ Returns
774
+ -------
775
+ ProcessesStatusResponse
776
+ Look up success
777
+
778
+ Examples
779
+ --------
780
+ from groundx import GroundX
781
+
782
+ client = GroundX(
783
+ api_key="YOUR_API_KEY",
784
+ )
785
+ client.documents.document_get_processes()
786
+ """
787
+ _response = self._client_wrapper.httpx_client.request(
788
+ "v1/ingest",
789
+ method="GET",
790
+ params={
791
+ "n": n,
792
+ "status": status,
793
+ },
794
+ request_options=request_options,
795
+ )
796
+ try:
797
+ if 200 <= _response.status_code < 300:
798
+ return typing.cast(
799
+ ProcessesStatusResponse,
800
+ parse_obj_as(
801
+ type_=ProcessesStatusResponse, # type: ignore
802
+ object_=_response.json(),
803
+ ),
804
+ )
805
+ _response_json = _response.json()
806
+ except JSONDecodeError:
807
+ raise ApiError(status_code=_response.status_code, body=_response.text)
808
+ raise ApiError(status_code=_response.status_code, body=_response_json)
809
+
751
810
 
752
811
  class AsyncDocumentsClient:
753
812
  def __init__(self, *, client_wrapper: AsyncClientWrapper):
@@ -1547,3 +1606,69 @@ class AsyncDocumentsClient:
1547
1606
  except JSONDecodeError:
1548
1607
  raise ApiError(status_code=_response.status_code, body=_response.text)
1549
1608
  raise ApiError(status_code=_response.status_code, body=_response_json)
1609
+
1610
+ async def document_get_processes(
1611
+ self,
1612
+ *,
1613
+ n: typing.Optional[int] = None,
1614
+ status: typing.Optional[ProcessingStatus] = None,
1615
+ request_options: typing.Optional[RequestOptions] = None,
1616
+ ) -> ProcessesStatusResponse:
1617
+ """
1618
+ Get a list of ingest process requests, sorted from most recent to least.
1619
+
1620
+ Parameters
1621
+ ----------
1622
+ n : typing.Optional[int]
1623
+ The maximum number of returned processes. Accepts 1-100 with a default of 20.
1624
+
1625
+ status : typing.Optional[ProcessingStatus]
1626
+ A status filter on the processing status. If this value is set, then only processes with this status will be returned in the results.
1627
+
1628
+ request_options : typing.Optional[RequestOptions]
1629
+ Request-specific configuration.
1630
+
1631
+ Returns
1632
+ -------
1633
+ ProcessesStatusResponse
1634
+ Look up success
1635
+
1636
+ Examples
1637
+ --------
1638
+ import asyncio
1639
+
1640
+ from groundx import AsyncGroundX
1641
+
1642
+ client = AsyncGroundX(
1643
+ api_key="YOUR_API_KEY",
1644
+ )
1645
+
1646
+
1647
+ async def main() -> None:
1648
+ await client.documents.document_get_processes()
1649
+
1650
+
1651
+ asyncio.run(main())
1652
+ """
1653
+ _response = await self._client_wrapper.httpx_client.request(
1654
+ "v1/ingest",
1655
+ method="GET",
1656
+ params={
1657
+ "n": n,
1658
+ "status": status,
1659
+ },
1660
+ request_options=request_options,
1661
+ )
1662
+ try:
1663
+ if 200 <= _response.status_code < 300:
1664
+ return typing.cast(
1665
+ ProcessesStatusResponse,
1666
+ parse_obj_as(
1667
+ type_=ProcessesStatusResponse, # type: ignore
1668
+ object_=_response.json(),
1669
+ ),
1670
+ )
1671
+ _response_json = _response.json()
1672
+ except JSONDecodeError:
1673
+ raise ApiError(status_code=_response.status_code, body=_response.text)
1674
+ raise ApiError(status_code=_response.status_code, body=_response_json)
groundx/types/__init__.py CHANGED
@@ -36,6 +36,7 @@ from .process_status_response_ingest_progress_cancelled import ProcessStatusResp
36
36
  from .process_status_response_ingest_progress_complete import ProcessStatusResponseIngestProgressComplete
37
37
  from .process_status_response_ingest_progress_errors import ProcessStatusResponseIngestProgressErrors
38
38
  from .process_status_response_ingest_progress_processing import ProcessStatusResponseIngestProgressProcessing
39
+ from .processes_status_response import ProcessesStatusResponse
39
40
  from .processing_status import ProcessingStatus
40
41
  from .search_response import SearchResponse
41
42
  from .search_response_search import SearchResponseSearch
@@ -83,6 +84,7 @@ __all__ = [
83
84
  "ProcessStatusResponseIngestProgressComplete",
84
85
  "ProcessStatusResponseIngestProgressErrors",
85
86
  "ProcessStatusResponseIngestProgressProcessing",
87
+ "ProcessesStatusResponse",
86
88
  "ProcessingStatus",
87
89
  "SearchResponse",
88
90
  "SearchResponseSearch",
@@ -0,0 +1,6 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+ from .process_status_response import ProcessStatusResponse
5
+
6
+ ProcessesStatusResponse = typing.List[ProcessStatusResponse]
@@ -2,4 +2,6 @@
2
2
 
3
3
  import typing
4
4
 
5
- ProcessingStatus = typing.Union[typing.Literal["queued", "processing", "error", "complete", "cancelled"], typing.Any]
5
+ ProcessingStatus = typing.Union[
6
+ typing.Literal["queued", "processing", "error", "complete", "cancelled", "active", "inactive"], typing.Any
7
+ ]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: groundx
3
- Version: 2.2.0
3
+ Version: 2.2.2
4
4
  Summary:
5
5
  License: MIT
6
6
  Requires-Python: >=3.8,<4.0
@@ -1,15 +1,15 @@
1
- groundx/__init__.py,sha256=hl6bFr_FJ0R5Ux_bQErYlWDZQcOF10rkda_r3pah3NQ,3005
1
+ groundx/__init__.py,sha256=VU186jO87Zh7sclaszpq-ZzCIcHa7_exbXC6XMX2AfA,3065
2
2
  groundx/buckets/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
3
3
  groundx/buckets/client.py,sha256=4jlc9vfIult1mMJ4FZW4_KFJybZPStZt1FUplIgrxbU,23947
4
4
  groundx/client.py,sha256=dIW9OyrMyfC1N7HSxRrHh0w_8rJ8osNUOPdYD6ueQ6g,6515
5
5
  groundx/core/__init__.py,sha256=SQ85PF84B9MuKnBwHNHWemSGuy-g_515gFYNFhvEE0I,1438
6
6
  groundx/core/api_error.py,sha256=RE8LELok2QCjABadECTvtDp7qejA1VmINCh6TbqPwSE,426
7
- groundx/core/client_wrapper.py,sha256=_odv_JHUR_G1PLV_TqHwVQxMoC1kMp15YPAImZU5JUE,1802
7
+ groundx/core/client_wrapper.py,sha256=SzQXOHypGkDapwssRoWP05y1TS1LUkQutS0dqyqlxM8,1802
8
8
  groundx/core/datetime_utils.py,sha256=nBys2IsYrhPdszxGKCNRPSOCwa-5DWOHG95FB8G9PKo,1047
9
9
  groundx/core/file.py,sha256=d4NNbX8XvXP32z8KpK2Xovv33nFfruIrpz0QWxlgpZk,2663
10
- groundx/core/http_client.py,sha256=siUQ6UV0ARZALlxubqWSSAAPC9B4VW8y6MGlHStfaeo,19552
10
+ groundx/core/http_client.py,sha256=KL5RGa0y4n8nX0-07WRg4ZQUTq30sc-XJbWcP5vjBDg,19552
11
11
  groundx/core/jsonable_encoder.py,sha256=qaF1gtgH-kQZb4kJskETwcCsOPUof-NnYVdszHkb-dM,3656
12
- groundx/core/pydantic_utilities.py,sha256=Pj_AIcjRR-xc28URvV4t2XssDPjLvpN6HAcsY3MVLRM,11973
12
+ groundx/core/pydantic_utilities.py,sha256=UibVGGYmBDsV834x8CtckRDrTIL4lYJPMrcq9yvf7RM,11973
13
13
  groundx/core/query_encoder.py,sha256=ekulqNd0j8TgD7ox-Qbz7liqX8-KP9blvT9DsRCenYM,2144
14
14
  groundx/core/remove_none_from_dict.py,sha256=EU9SGgYidWq7SexuJbNs4-PZ-5Bl3Vppd864mS6vQZw,342
15
15
  groundx/core/request_options.py,sha256=h0QUNCFVdCW_7GclVySCAY2w4NhtXVBUCmHgmzaxpcg,1681
@@ -17,7 +17,7 @@ groundx/core/serialization.py,sha256=D9h_t-RQON3-CHWs1C4ESY9B-Yd5d-l5lnTLb_X896g
17
17
  groundx/customer/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
18
18
  groundx/customer/client.py,sha256=C_JANeDewRD1Kg-q7LPxdiOSWbYSTOiYlBYZLRYPI44,3467
19
19
  groundx/documents/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
20
- groundx/documents/client.py,sha256=JCPSsLoDcPv_OmFFKFS3kRZMpwh4btnCu4wdmwKN_mc,54741
20
+ groundx/documents/client.py,sha256=Vnyfs24KNbST9FnF8wP4dc7vX7DlUp9mEcqM_9zYjiE,58841
21
21
  groundx/environment.py,sha256=CInm1_DKtZ1mrxutmKb1qqv82P33r_S87hZD3Hc1VB0,159
22
22
  groundx/errors/__init__.py,sha256=-prNYsFd8xxM4va0vR1raZjcd10tllOJKyEWjX_pwdU,214
23
23
  groundx/errors/bad_request_error.py,sha256=_EbO8mWqN9kFZPvIap8qa1lL_EWkRcsZe1HKV9GDWJY,264
@@ -32,7 +32,7 @@ groundx/search/__init__.py,sha256=RagVzjShP33mDg9o4N3kGzV0egL1RYNjCpXPE8VzMYE,14
32
32
  groundx/search/client.py,sha256=zrrqFy0HowDUYPsMU4nfvDV2RgmkEQ4E8WYNktu3xcs,18684
33
33
  groundx/search/types/__init__.py,sha256=fNFXQloPa1PHHO8VZim6KQNMA9N5EZtfSkissdxtY_c,165
34
34
  groundx/search/types/search_content_request_id.py,sha256=us7mYdzR0qPur_wR5I9BhHaLEzC5nLBRna6-xq4M1ec,128
35
- groundx/types/__init__.py,sha256=GO3it8Adm7ZaxMnc8ZP_9CNZkKpZX7X36hUKi1NgYWA,3809
35
+ groundx/types/__init__.py,sha256=Jsc4HRDnSG5JhV37QeFpgGkDUFfVsYt5SD3-lCqPakk,3903
36
36
  groundx/types/bounding_box_detail.py,sha256=51qcen326NTHY2ZqH1cFXut0_MCmk39EbLoDAwotdq4,1832
37
37
  groundx/types/bucket_detail.py,sha256=bQjCvfyWydjItmzNNTvH-iWxNDOggd7R7X1alFZzlEY,1511
38
38
  groundx/types/bucket_list_response.py,sha256=jC0NBsLCYDSwQrBzuW0g3PWFycjtKl8YRkKhic_-1DA,650
@@ -69,7 +69,8 @@ groundx/types/process_status_response_ingest_progress_cancelled.py,sha256=PpvHXz
69
69
  groundx/types/process_status_response_ingest_progress_complete.py,sha256=6-UuZCHK28No15RPigumAJ4r_gAUjbElH3Brg7ED8pU,722
70
70
  groundx/types/process_status_response_ingest_progress_errors.py,sha256=aSpl99wXwcTFhtkB47BpBZATcqzQS6cXHssKLPdtnzQ,720
71
71
  groundx/types/process_status_response_ingest_progress_processing.py,sha256=rqaTkeki5Vf3SgeeZtuSRtioGqmj99JcbfKoeI-Hgos,724
72
- groundx/types/processing_status.py,sha256=d71n9cgs3gMH1Lyr-Wqq-iYJB6oMEE9yVRdJsmIb9Ws,198
72
+ groundx/types/processes_status_response.py,sha256=LSCEf3i1Gs3QDCYye2lw8zmZDWODtDMNu9aMf1YIfH8,200
73
+ groundx/types/processing_status.py,sha256=nUvsnKcDOFcT6NRDCTQ1vpm4KDNiKy8_b7PxaiKxnZM,226
73
74
  groundx/types/search_response.py,sha256=EUwAFEHfzEisHCSTxa5zAy7VWY-bebV5VLx0b7irNlI,633
74
75
  groundx/types/search_response_search.py,sha256=fhEbG9qQZHWlxpI_A9rLOHhm7VbzECrTLhicHkR2Xi0,1685
75
76
  groundx/types/search_result_item.py,sha256=ut1q-aSTnzfRCfEQ8sdrf2A20ix2NF5iisiah5vPaww,3083
@@ -79,7 +80,7 @@ groundx/types/subscription_detail.py,sha256=WNfUw2EMVECIvNYcV2s51zZ6T3Utc4zYXw63
79
80
  groundx/types/subscription_detail_meters.py,sha256=lBa8-1QlMVHjr5RLGqhiTKnD1KMM0AAHTWvz9TVtG8w,830
80
81
  groundx/types/website_source.py,sha256=3WeRCiilNKKBTfhwgjo3jbcVI3vLTeM-KxI6dVzpg9o,1578
81
82
  groundx/version.py,sha256=1yVogKaq260fQfckM2RYN2144SEw0QROsZW8ICtkG4U,74
82
- groundx-2.2.0.dist-info/LICENSE,sha256=dFE6nY1bHnSn6NqmdlghlU1gQqLqYNphrceGVehSa7o,1065
83
- groundx-2.2.0.dist-info/METADATA,sha256=lYgds-yvf22A7MdNyiQW4NlV7JW5AzTWuWmI3OP13jg,5052
84
- groundx-2.2.0.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
85
- groundx-2.2.0.dist-info/RECORD,,
83
+ groundx-2.2.2.dist-info/LICENSE,sha256=dFE6nY1bHnSn6NqmdlghlU1gQqLqYNphrceGVehSa7o,1065
84
+ groundx-2.2.2.dist-info/METADATA,sha256=xD3ouCct56X2GDLssMWwY7SZQpURQX6lJU_KMjqZReo,5052
85
+ groundx-2.2.2.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
86
+ groundx-2.2.2.dist-info/RECORD,,