groundx 2.0.20__py3-none-any.whl → 2.0.21__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/types/__init__.py CHANGED
@@ -8,9 +8,9 @@ from .bucket_update_detail import BucketUpdateDetail
8
8
  from .bucket_update_response import BucketUpdateResponse
9
9
  from .customer_detail import CustomerDetail
10
10
  from .customer_response import CustomerResponse
11
- from .document import Document
12
11
  from .document_detail import DocumentDetail
13
12
  from .document_list_response import DocumentListResponse
13
+ from .document_local_ingest_request import DocumentLocalIngestRequest
14
14
  from .document_lookup_response import DocumentLookupResponse
15
15
  from .document_response import DocumentResponse
16
16
  from .document_type import DocumentType
@@ -22,6 +22,7 @@ from .health_response_health import HealthResponseHealth
22
22
  from .health_service import HealthService
23
23
  from .health_service_status import HealthServiceStatus
24
24
  from .ingest_local_document import IngestLocalDocument
25
+ from .ingest_local_document_metadata import IngestLocalDocumentMetadata
25
26
  from .ingest_remote_document import IngestRemoteDocument
26
27
  from .ingest_response import IngestResponse
27
28
  from .ingest_response_ingest import IngestResponseIngest
@@ -53,9 +54,9 @@ __all__ = [
53
54
  "BucketUpdateResponse",
54
55
  "CustomerDetail",
55
56
  "CustomerResponse",
56
- "Document",
57
57
  "DocumentDetail",
58
58
  "DocumentListResponse",
59
+ "DocumentLocalIngestRequest",
59
60
  "DocumentLookupResponse",
60
61
  "DocumentResponse",
61
62
  "DocumentType",
@@ -67,6 +68,7 @@ __all__ = [
67
68
  "HealthService",
68
69
  "HealthServiceStatus",
69
70
  "IngestLocalDocument",
71
+ "IngestLocalDocumentMetadata",
70
72
  "IngestRemoteDocument",
71
73
  "IngestResponse",
72
74
  "IngestResponseIngest",
@@ -0,0 +1,6 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+ from .ingest_local_document import IngestLocalDocument
5
+
6
+ DocumentLocalIngestRequest = typing.List[IngestLocalDocument]
@@ -1,37 +1,19 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
3
  from ..core.pydantic_utilities import UniversalBaseModel
4
- import typing_extensions
5
- from ..core.serialization import FieldMetadata
6
4
  import pydantic
7
- from .document_type import DocumentType
8
- import typing
5
+ from .ingest_local_document_metadata import IngestLocalDocumentMetadata
9
6
  from ..core.pydantic_utilities import IS_PYDANTIC_V2
7
+ import typing
10
8
 
11
9
 
12
10
  class IngestLocalDocument(UniversalBaseModel):
13
- bucket_id: typing_extensions.Annotated[int, FieldMetadata(alias="bucketId")] = pydantic.Field()
14
- """
15
- the bucketId of the bucket which this local file will be ingested to.
16
- """
17
-
18
- file_data: typing_extensions.Annotated[str, FieldMetadata(alias="fileData")] = pydantic.Field()
11
+ blob: str = pydantic.Field()
19
12
  """
20
- Binary data for the file being ingested.
13
+ The binary file data being ingested.
21
14
  """
22
15
 
23
- file_name: typing_extensions.Annotated[str, FieldMetadata(alias="fileName")] = pydantic.Field()
24
- """
25
- The name of the file being ingested
26
- """
27
-
28
- file_type: typing_extensions.Annotated[DocumentType, FieldMetadata(alias="fileType")]
29
- search_data: typing_extensions.Annotated[
30
- typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]], FieldMetadata(alias="searchData")
31
- ] = pydantic.Field(default=None)
32
- """
33
- Custom metadata which can be used to influence GroundX's search functionality. This data can be used to further hone GroundX search.
34
- """
16
+ metadata: IngestLocalDocumentMetadata
35
17
 
36
18
  if IS_PYDANTIC_V2:
37
19
  model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
@@ -2,17 +2,19 @@
2
2
 
3
3
  from ..core.pydantic_utilities import UniversalBaseModel
4
4
  import typing_extensions
5
+ import typing
5
6
  from ..core.serialization import FieldMetadata
6
7
  import pydantic
7
- import typing
8
8
  from .document_type import DocumentType
9
9
  from ..core.pydantic_utilities import IS_PYDANTIC_V2
10
10
 
11
11
 
12
- class Document(UniversalBaseModel):
13
- bucket_id: typing_extensions.Annotated[int, FieldMetadata(alias="bucketId")] = pydantic.Field()
12
+ class IngestLocalDocumentMetadata(UniversalBaseModel):
13
+ bucket_id: typing_extensions.Annotated[typing.Optional[int], FieldMetadata(alias="bucketId")] = pydantic.Field(
14
+ default=None
15
+ )
14
16
  """
15
- the bucketId of the bucket which this remote file will be ingested to.
17
+ The bucketId of the bucket which this local file will be ingested to.
16
18
  """
17
19
 
18
20
  file_name: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="fileName")] = pydantic.Field(
@@ -22,11 +24,6 @@ class Document(UniversalBaseModel):
22
24
  The name of the file being ingested
23
25
  """
24
26
 
25
- file_path: typing_extensions.Annotated[str, FieldMetadata(alias="filePath")] = pydantic.Field()
26
- """
27
- The local file path or remote URL of the document being ingested by GroundX.
28
- """
29
-
30
27
  file_type: typing_extensions.Annotated[typing.Optional[DocumentType], FieldMetadata(alias="fileType")] = None
31
28
  search_data: typing_extensions.Annotated[
32
29
  typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]], FieldMetadata(alias="searchData")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: groundx
3
- Version: 2.0.20
3
+ Version: 2.0.21
4
4
  Summary:
5
5
  License: MIT
6
6
  Requires-Python: >=3.8,<4.0
@@ -52,26 +52,19 @@ A full reference for this library is available [here](./reference.md).
52
52
  Instantiate and use the client with the following:
53
53
 
54
54
  ```python
55
- from groundx import Document, GroundX
55
+ from groundx import GroundX, IngestRemoteDocument
56
56
 
57
57
  client = GroundX(
58
58
  api_key="YOUR_API_KEY",
59
59
  )
60
- client.documents.ingest(
60
+ client.documents.ingest_remote(
61
61
  documents=[
62
- Document(
62
+ IngestRemoteDocument(
63
63
  bucket_id=1234,
64
64
  file_name="my_file1.txt",
65
- file_path="https://my.source.url.com/file1.txt",
66
65
  file_type="txt",
67
- search_data={"key": "value"},
68
- ),
69
- Document(
70
- bucket_id=1234,
71
- file_name="my_file2.pdf",
72
- file_path="/local/path/file2.pdf",
73
- file_type="pdf",
74
- ),
66
+ source_url="https://my.source.url.com/file1.txt",
67
+ )
75
68
  ],
76
69
  )
77
70
  ```
@@ -83,7 +76,7 @@ The SDK also exports an `async` client so that you can make non-blocking calls t
83
76
  ```python
84
77
  import asyncio
85
78
 
86
- from groundx import AsyncGroundX, Document
79
+ from groundx import AsyncGroundX, IngestRemoteDocument
87
80
 
88
81
  client = AsyncGroundX(
89
82
  api_key="YOUR_API_KEY",
@@ -91,21 +84,14 @@ client = AsyncGroundX(
91
84
 
92
85
 
93
86
  async def main() -> None:
94
- await client.documents.ingest(
87
+ await client.documents.ingest_remote(
95
88
  documents=[
96
- Document(
89
+ IngestRemoteDocument(
97
90
  bucket_id=1234,
98
91
  file_name="my_file1.txt",
99
- file_path="https://my.source.url.com/file1.txt",
100
92
  file_type="txt",
101
- search_data={"key": "value"},
102
- ),
103
- Document(
104
- bucket_id=1234,
105
- file_name="my_file2.pdf",
106
- file_path="/local/path/file2.pdf",
107
- file_type="pdf",
108
- ),
93
+ source_url="https://my.source.url.com/file1.txt",
94
+ )
109
95
  ],
110
96
  )
111
97
 
@@ -122,7 +108,7 @@ will be thrown.
122
108
  from groundx.core.api_error import ApiError
123
109
 
124
110
  try:
125
- client.documents.ingest(...)
111
+ client.documents.ingest_remote(...)
126
112
  except ApiError as e:
127
113
  print(e.status_code)
128
114
  print(e.body)
@@ -145,7 +131,7 @@ A request is deemed retriable when any of the following HTTP status codes is ret
145
131
  Use the `max_retries` request option to configure this behavior.
146
132
 
147
133
  ```python
148
- client.documents.ingest(..., request_options={
134
+ client.documents.ingest_remote(..., request_options={
149
135
  "max_retries": 1
150
136
  })
151
137
  ```
@@ -165,7 +151,7 @@ client = GroundX(
165
151
 
166
152
 
167
153
  # Override timeout for a specific method
168
- client.documents.ingest(..., request_options={
154
+ client.documents.ingest_remote(..., request_options={
169
155
  "timeout_in_seconds": 1
170
156
  })
171
157
  ```
@@ -1,10 +1,10 @@
1
- groundx/__init__.py,sha256=2Y4vdNS7OptGTx8PNJ_qeKmTNn8CLwFTPLyGJ-pcMfI,2871
1
+ groundx/__init__.py,sha256=_IGBowwyPGd2Yc8c-X8b4FRu5rNA_SoTj4e3bhtB69Y,2975
2
2
  groundx/buckets/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
3
3
  groundx/buckets/client.py,sha256=TofNrkej1AC_-FU5rf_y8KG8ubFUpHtLa8PQ7rqax6E,26537
4
4
  groundx/client.py,sha256=Q1Kw0z6K-z-ShhNyuuPe5fYonM9M2I_55-ukUrUWk1U,6507
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=T6AlQ_t_YWnf52XrIQ5Tmv36AxaJQ0LuLIXcq7IZSno,1803
7
+ groundx/core/client_wrapper.py,sha256=ZCThAGYPgh2zcfTO99ZP-m7Fdgqktuyv7kfz-Y1Q6FY,1803
8
8
  groundx/core/datetime_utils.py,sha256=nBys2IsYrhPdszxGKCNRPSOCwa-5DWOHG95FB8G9PKo,1047
9
9
  groundx/core/file.py,sha256=d4NNbX8XvXP32z8KpK2Xovv33nFfruIrpz0QWxlgpZk,2663
10
10
  groundx/core/http_client.py,sha256=siUQ6UV0ARZALlxubqWSSAAPC9B4VW8y6MGlHStfaeo,19552
@@ -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=XWAATHLbU3FV3L7YEQ5ftQu_fn-iILJzXdQogrvgMh8,64975
20
+ groundx/documents/client.py,sha256=94t45T3Z9RHj4OBh454qYbjke8HdW1ad_-TPiocPmeE,58853
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
@@ -31,7 +31,7 @@ groundx/search/__init__.py,sha256=RagVzjShP33mDg9o4N3kGzV0egL1RYNjCpXPE8VzMYE,14
31
31
  groundx/search/client.py,sha256=10ifg9GyIwIZF13ULfCXF8iFIydq6H6QRDrGPDjpanw,19756
32
32
  groundx/search/types/__init__.py,sha256=fNFXQloPa1PHHO8VZim6KQNMA9N5EZtfSkissdxtY_c,165
33
33
  groundx/search/types/search_content_request_id.py,sha256=us7mYdzR0qPur_wR5I9BhHaLEzC5nLBRna6-xq4M1ec,128
34
- groundx/types/__init__.py,sha256=xKjmTkCby1yXYF0Nk4XR-NMBKMrh3ayvlNmeTWiB6o8,3598
34
+ groundx/types/__init__.py,sha256=ViqDRA9l-OWZP4_Zl7nVOvd_EZKpTFFvyYkxdHB9vco,3762
35
35
  groundx/types/bounding_box_detail.py,sha256=51qcen326NTHY2ZqH1cFXut0_MCmk39EbLoDAwotdq4,1832
36
36
  groundx/types/bucket_detail.py,sha256=bQjCvfyWydjItmzNNTvH-iWxNDOggd7R7X1alFZzlEY,1511
37
37
  groundx/types/bucket_list_response.py,sha256=jC0NBsLCYDSwQrBzuW0g3PWFycjtKl8YRkKhic_-1DA,650
@@ -40,9 +40,9 @@ groundx/types/bucket_update_detail.py,sha256=B4atQMDSXEdx7otcDbvgsrAHtXNz9swMnOs
40
40
  groundx/types/bucket_update_response.py,sha256=h5RJTEpc4WPI_C4sPvsJZo7IxKppnPR-I9VGEQryRlc,633
41
41
  groundx/types/customer_detail.py,sha256=RNm0qXvKx6YvVmkVJZeCNIz7n8_siFMXJ_AGtH3i5Z0,1094
42
42
  groundx/types/customer_response.py,sha256=_RbuanXhCWQkCeQ0dkwPgsjNBoBgNpixiNfRpXcMew8,618
43
- groundx/types/document.py,sha256=NxhkpwlW9jskS6RyhLNPrgrgZBAj4Ag8wGAa7jThuMw,1695
44
43
  groundx/types/document_detail.py,sha256=i1UfcQAGYo9v1HwrrpzQPw_O0qA7IOXwOUuPV1yU8nI,2323
45
44
  groundx/types/document_list_response.py,sha256=Z0Hm5VBwI0qatbSp6nYHh0RrGwJN3Gqh2D72FfDseZk,839
45
+ groundx/types/document_local_ingest_request.py,sha256=zqaT_QgYcEc8AfVwZm-O5jLTEiYSsO-i3VVgZ_7xl7w,197
46
46
  groundx/types/document_lookup_response.py,sha256=hZBwUO2pI6xFfeh7DmX_l1xRoh-5oaVNgUVxd00ml14,1097
47
47
  groundx/types/document_response.py,sha256=EBDrYhTYoA3Q3ZpqwFEYmTgE3tY86TScFPhBnc3_ItI,642
48
48
  groundx/types/document_type.py,sha256=NgsbSUXopTkzkut1AwXgthxWjsFzlKNnUhyfYqU_IM4,216
@@ -53,7 +53,8 @@ groundx/types/health_response.py,sha256=3UpYL2IZb56tTo-fOpSU-0OTRyWgpYiB3pMU3sfj
53
53
  groundx/types/health_response_health.py,sha256=I0QeEljFp6l5LCJbCTArW031Om84egePgnGdtE6WXlI,632
54
54
  groundx/types/health_service.py,sha256=M1-h1EJSpAXw-j3pY-09_g_WKkO0spdj8e7pgPzSGf0,1083
55
55
  groundx/types/health_service_status.py,sha256=ugKJXlx8QGi83n_J6s1frFrW1hYfOn3Dlb_pPNexwMA,185
56
- groundx/types/ingest_local_document.py,sha256=2T1HXR2a-BDj5LEOTM98Sl4sgjVMWbVShQLn8MTR6QA,1602
56
+ groundx/types/ingest_local_document.py,sha256=am6TPgHu40S4Lzo9hMkDRauYnc-AWBuYL0Lgk85Fseg,753
57
+ groundx/types/ingest_local_document_metadata.py,sha256=I4CSafx8kLSHLbU5_TkU6igy2plevkzUzdsR7vhovHg,1558
57
58
  groundx/types/ingest_remote_document.py,sha256=xlPA4SYoUgoGXpxZhyORdezxIPGmr4wneav2ZEVmmOY,1683
58
59
  groundx/types/ingest_response.py,sha256=139rn8wpT44jlUzYXiy0r8XzN2U_OtdLltpSbRU0TyA,633
59
60
  groundx/types/ingest_response_ingest.py,sha256=8FKApYNvS6KFxEKm05pKpKJ0BAagxoE0cWeTt-qjm1g,781
@@ -76,7 +77,7 @@ groundx/types/subscription_detail.py,sha256=WNfUw2EMVECIvNYcV2s51zZ6T3Utc4zYXw63
76
77
  groundx/types/subscription_detail_meters.py,sha256=lBa8-1QlMVHjr5RLGqhiTKnD1KMM0AAHTWvz9TVtG8w,830
77
78
  groundx/types/website_source.py,sha256=0TYZqyR16bUO9dfVrNwmph-ICmRzgje02aim1M17x7k,1576
78
79
  groundx/version.py,sha256=1yVogKaq260fQfckM2RYN2144SEw0QROsZW8ICtkG4U,74
79
- groundx-2.0.20.dist-info/LICENSE,sha256=8dMPYAFBTA7O4DUxhrEKEks8CL2waCMYM6dHohW4xrI,1065
80
- groundx-2.0.20.dist-info/METADATA,sha256=5w2zG2q5tkHlBjww5M4H1b7gvC8z-QCes56_-Z3MKfM,5493
81
- groundx-2.0.20.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
82
- groundx-2.0.20.dist-info/RECORD,,
80
+ groundx-2.0.21.dist-info/LICENSE,sha256=8dMPYAFBTA7O4DUxhrEKEks8CL2waCMYM6dHohW4xrI,1065
81
+ groundx-2.0.21.dist-info/METADATA,sha256=4SvJFYtth9J6AYAv5SuzIsB-KGtAaLYVGiqCv_CZD90,5122
82
+ groundx-2.0.21.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
83
+ groundx-2.0.21.dist-info/RECORD,,