groundx 2.1.0__py3-none-any.whl → 2.2.1__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.
@@ -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.1.0",
19
+ "X-Fern-SDK-Version": "2.2.1",
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
@@ -204,6 +204,8 @@ class DocumentsClient:
204
204
  ) -> IngestResponse:
205
205
  """
206
206
  Upload the content of a publicly accessible website for ingestion into a GroundX bucket. This is done by following links within a specified URL, recursively, up to a specified depth or number of pages.
207
+ Note1: This endpoint is currently not supported for on-prem deployments.
208
+ Note2: The `source_url` must include the protocol, http:// or https://.
207
209
 
208
210
  Parameters
209
211
  ----------
@@ -746,6 +748,84 @@ class DocumentsClient:
746
748
  raise ApiError(status_code=_response.status_code, body=_response.text)
747
749
  raise ApiError(status_code=_response.status_code, body=_response_json)
748
750
 
751
+ def document_get_processing_status(
752
+ self,
753
+ *,
754
+ n: typing.Optional[int] = None,
755
+ status: typing.Optional[ProcessingStatus] = None,
756
+ request_options: typing.Optional[RequestOptions] = None,
757
+ ) -> DocumentResponse:
758
+ """
759
+ Get the current status of ingest processes, sorted from most recent to least.
760
+
761
+ Parameters
762
+ ----------
763
+ n : typing.Optional[int]
764
+ The maximum number of returned processes. Accepts 1-100 with a default of 20.
765
+
766
+ status : typing.Optional[ProcessingStatus]
767
+ A status filter on the processing status. If this value is set, then only processes with this status will be returned in the results.
768
+
769
+ request_options : typing.Optional[RequestOptions]
770
+ Request-specific configuration.
771
+
772
+ Returns
773
+ -------
774
+ DocumentResponse
775
+ Look up success
776
+
777
+ Examples
778
+ --------
779
+ from groundx import GroundX
780
+
781
+ client = GroundX(
782
+ api_key="YOUR_API_KEY",
783
+ )
784
+ client.documents.document_get_processing_status()
785
+ """
786
+ _response = self._client_wrapper.httpx_client.request(
787
+ "v1/ingest",
788
+ method="GET",
789
+ params={
790
+ "n": n,
791
+ "status": status,
792
+ },
793
+ request_options=request_options,
794
+ )
795
+ try:
796
+ if 200 <= _response.status_code < 300:
797
+ return typing.cast(
798
+ DocumentResponse,
799
+ parse_obj_as(
800
+ type_=DocumentResponse, # type: ignore
801
+ object_=_response.json(),
802
+ ),
803
+ )
804
+ if _response.status_code == 400:
805
+ raise BadRequestError(
806
+ typing.cast(
807
+ typing.Optional[typing.Any],
808
+ parse_obj_as(
809
+ type_=typing.Optional[typing.Any], # type: ignore
810
+ object_=_response.json(),
811
+ ),
812
+ )
813
+ )
814
+ if _response.status_code == 401:
815
+ raise UnauthorizedError(
816
+ typing.cast(
817
+ typing.Optional[typing.Any],
818
+ parse_obj_as(
819
+ type_=typing.Optional[typing.Any], # type: ignore
820
+ object_=_response.json(),
821
+ ),
822
+ )
823
+ )
824
+ _response_json = _response.json()
825
+ except JSONDecodeError:
826
+ raise ApiError(status_code=_response.status_code, body=_response.text)
827
+ raise ApiError(status_code=_response.status_code, body=_response_json)
828
+
749
829
 
750
830
  class AsyncDocumentsClient:
751
831
  def __init__(self, *, client_wrapper: AsyncClientWrapper):
@@ -944,6 +1024,8 @@ class AsyncDocumentsClient:
944
1024
  ) -> IngestResponse:
945
1025
  """
946
1026
  Upload the content of a publicly accessible website for ingestion into a GroundX bucket. This is done by following links within a specified URL, recursively, up to a specified depth or number of pages.
1027
+ Note1: This endpoint is currently not supported for on-prem deployments.
1028
+ Note2: The `source_url` must include the protocol, http:// or https://.
947
1029
 
948
1030
  Parameters
949
1031
  ----------
@@ -1543,3 +1625,89 @@ class AsyncDocumentsClient:
1543
1625
  except JSONDecodeError:
1544
1626
  raise ApiError(status_code=_response.status_code, body=_response.text)
1545
1627
  raise ApiError(status_code=_response.status_code, body=_response_json)
1628
+
1629
+ async def document_get_processing_status(
1630
+ self,
1631
+ *,
1632
+ n: typing.Optional[int] = None,
1633
+ status: typing.Optional[ProcessingStatus] = None,
1634
+ request_options: typing.Optional[RequestOptions] = None,
1635
+ ) -> DocumentResponse:
1636
+ """
1637
+ Get the current status of ingest processes, sorted from most recent to least.
1638
+
1639
+ Parameters
1640
+ ----------
1641
+ n : typing.Optional[int]
1642
+ The maximum number of returned processes. Accepts 1-100 with a default of 20.
1643
+
1644
+ status : typing.Optional[ProcessingStatus]
1645
+ A status filter on the processing status. If this value is set, then only processes with this status will be returned in the results.
1646
+
1647
+ request_options : typing.Optional[RequestOptions]
1648
+ Request-specific configuration.
1649
+
1650
+ Returns
1651
+ -------
1652
+ DocumentResponse
1653
+ Look up success
1654
+
1655
+ Examples
1656
+ --------
1657
+ import asyncio
1658
+
1659
+ from groundx import AsyncGroundX
1660
+
1661
+ client = AsyncGroundX(
1662
+ api_key="YOUR_API_KEY",
1663
+ )
1664
+
1665
+
1666
+ async def main() -> None:
1667
+ await client.documents.document_get_processing_status()
1668
+
1669
+
1670
+ asyncio.run(main())
1671
+ """
1672
+ _response = await self._client_wrapper.httpx_client.request(
1673
+ "v1/ingest",
1674
+ method="GET",
1675
+ params={
1676
+ "n": n,
1677
+ "status": status,
1678
+ },
1679
+ request_options=request_options,
1680
+ )
1681
+ try:
1682
+ if 200 <= _response.status_code < 300:
1683
+ return typing.cast(
1684
+ DocumentResponse,
1685
+ parse_obj_as(
1686
+ type_=DocumentResponse, # type: ignore
1687
+ object_=_response.json(),
1688
+ ),
1689
+ )
1690
+ if _response.status_code == 400:
1691
+ raise BadRequestError(
1692
+ typing.cast(
1693
+ typing.Optional[typing.Any],
1694
+ parse_obj_as(
1695
+ type_=typing.Optional[typing.Any], # type: ignore
1696
+ object_=_response.json(),
1697
+ ),
1698
+ )
1699
+ )
1700
+ if _response.status_code == 401:
1701
+ raise UnauthorizedError(
1702
+ typing.cast(
1703
+ typing.Optional[typing.Any],
1704
+ parse_obj_as(
1705
+ type_=typing.Optional[typing.Any], # type: ignore
1706
+ object_=_response.json(),
1707
+ ),
1708
+ )
1709
+ )
1710
+ _response_json = _response.json()
1711
+ except JSONDecodeError:
1712
+ raise ApiError(status_code=_response.status_code, body=_response.text)
1713
+ raise ApiError(status_code=_response.status_code, body=_response_json)
@@ -3,5 +3,25 @@
3
3
  import typing
4
4
 
5
5
  DocumentType = typing.Union[
6
- typing.Literal["txt", "docx", "pptx", "xlsx", "pdf", "png", "jpg", "csv", "tsv", "json"], typing.Any
6
+ typing.Literal[
7
+ "bmp",
8
+ "csv",
9
+ "docx",
10
+ "gif",
11
+ "heif",
12
+ "hwp",
13
+ "ico",
14
+ "jpg",
15
+ "json",
16
+ "pdf",
17
+ "png",
18
+ "pptx",
19
+ "svg",
20
+ "tiff",
21
+ "tsv",
22
+ "txt",
23
+ "xlsx",
24
+ "webp",
25
+ ],
26
+ typing.Any,
7
27
  ]
@@ -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
  MIT License
2
2
 
3
- Copyright (c) 2024 Eyelevel.
3
+ Copyright (c) 2025 Eyelevel.
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: groundx
3
- Version: 2.1.0
3
+ Version: 2.2.1
4
4
  Summary:
5
5
  License: MIT
6
6
  Requires-Python: >=3.8,<4.0
@@ -37,7 +37,7 @@ The GroundX Python library provides convenient access to the GroundX API from Py
37
37
 
38
38
  ## Documentation
39
39
 
40
- API reference documentation is available [here](https://docs.groundx.ai/reference).
40
+ API reference documentation is available [here](https://docs.eyelevel.ai/reference).
41
41
 
42
42
  ## Installation
43
43
 
@@ -4,12 +4,12 @@ groundx/buckets/client.py,sha256=4jlc9vfIult1mMJ4FZW4_KFJybZPStZt1FUplIgrxbU,239
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=y8onqbSUErX8E-86o2ZOvLGnwI4mzGnG87L-FUdLWHo,1802
7
+ groundx/core/client_wrapper.py,sha256=G63B6-bZ4H-eGq_Aixd23XGthfNL7M0DN1eOfFhGBGk,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=Jz8Kc7Z7fPjAAaiXfNhjo0GhvcwXyjGoCH2Jldd4ycM,54419
20
+ groundx/documents/client.py,sha256=mxmRGO8phbIqxxBpkMttOqMHXc9wfwWIGWACGL4XY4c,60393
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
@@ -47,7 +47,7 @@ groundx/types/document_list_response.py,sha256=Z0Hm5VBwI0qatbSp6nYHh0RrGwJN3Gqh2
47
47
  groundx/types/document_local_ingest_request.py,sha256=zqaT_QgYcEc8AfVwZm-O5jLTEiYSsO-i3VVgZ_7xl7w,197
48
48
  groundx/types/document_lookup_response.py,sha256=hZBwUO2pI6xFfeh7DmX_l1xRoh-5oaVNgUVxd00ml14,1097
49
49
  groundx/types/document_response.py,sha256=EBDrYhTYoA3Q3ZpqwFEYmTgE3tY86TScFPhBnc3_ItI,642
50
- groundx/types/document_type.py,sha256=NgsbSUXopTkzkut1AwXgthxWjsFzlKNnUhyfYqU_IM4,216
50
+ groundx/types/document_type.py,sha256=JQiwb7ZQOCKHPyCR71RYBue3akPsEQj3C2T-FMDolb8,431
51
51
  groundx/types/group_detail.py,sha256=ms8iEEE1d88PTNwJOHeSiyoXn0hKdMrjJhkM2tlMdMs,1754
52
52
  groundx/types/group_list_response.py,sha256=mDIDaW8uWo4Wd-sk8_SzaZeUD1EC4ZqcJpbieQLRszc,645
53
53
  groundx/types/group_response.py,sha256=SGqaQYPV9jaA4ET3x2adhkgL9NQQB9XwolXTuBQ1Xx0,603
@@ -69,7 +69,7 @@ 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/processing_status.py,sha256=nUvsnKcDOFcT6NRDCTQ1vpm4KDNiKy8_b7PxaiKxnZM,226
73
73
  groundx/types/search_response.py,sha256=EUwAFEHfzEisHCSTxa5zAy7VWY-bebV5VLx0b7irNlI,633
74
74
  groundx/types/search_response_search.py,sha256=fhEbG9qQZHWlxpI_A9rLOHhm7VbzECrTLhicHkR2Xi0,1685
75
75
  groundx/types/search_result_item.py,sha256=ut1q-aSTnzfRCfEQ8sdrf2A20ix2NF5iisiah5vPaww,3083
@@ -79,7 +79,7 @@ groundx/types/subscription_detail.py,sha256=WNfUw2EMVECIvNYcV2s51zZ6T3Utc4zYXw63
79
79
  groundx/types/subscription_detail_meters.py,sha256=lBa8-1QlMVHjr5RLGqhiTKnD1KMM0AAHTWvz9TVtG8w,830
80
80
  groundx/types/website_source.py,sha256=3WeRCiilNKKBTfhwgjo3jbcVI3vLTeM-KxI6dVzpg9o,1578
81
81
  groundx/version.py,sha256=1yVogKaq260fQfckM2RYN2144SEw0QROsZW8ICtkG4U,74
82
- groundx-2.1.0.dist-info/LICENSE,sha256=8dMPYAFBTA7O4DUxhrEKEks8CL2waCMYM6dHohW4xrI,1065
83
- groundx-2.1.0.dist-info/METADATA,sha256=pGPjHDleNTPidtKmZBOR6bVoJivWzbdLn5fhhlQPTVo,5051
84
- groundx-2.1.0.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
85
- groundx-2.1.0.dist-info/RECORD,,
82
+ groundx-2.2.1.dist-info/LICENSE,sha256=dFE6nY1bHnSn6NqmdlghlU1gQqLqYNphrceGVehSa7o,1065
83
+ groundx-2.2.1.dist-info/METADATA,sha256=VzAQTqH0vCRVzsc8nna6Z-r8kAsVIt3X2d9TWDpdGeY,5052
84
+ groundx-2.2.1.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
85
+ groundx-2.2.1.dist-info/RECORD,,