groundx 2.0.12__py3-none-any.whl → 2.0.14__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 +6 -1
- groundx/core/client_wrapper.py +1 -1
- groundx/documents/__init__.py +10 -2
- groundx/documents/client.py +51 -6
- groundx/documents/types/__init__.py +6 -1
- groundx/documents/types/documents_ingest_local_request_files_item.py +43 -0
- {groundx-2.0.12.dist-info → groundx-2.0.14.dist-info}/METADATA +7 -1
- {groundx-2.0.12.dist-info → groundx-2.0.14.dist-info}/RECORD +10 -9
- {groundx-2.0.12.dist-info → groundx-2.0.14.dist-info}/LICENSE +0 -0
- {groundx-2.0.12.dist-info → groundx-2.0.14.dist-info}/WHEEL +0 -0
groundx/__init__.py
CHANGED
@@ -44,7 +44,11 @@ from .types import (
|
|
44
44
|
from .errors import BadRequestError, UnauthorizedError
|
45
45
|
from . import buckets, customer, documents, groups, health, search
|
46
46
|
from .client import AsyncGroundX, GroundX
|
47
|
-
from .documents import
|
47
|
+
from .documents import (
|
48
|
+
DocumentRemoteIngestRequestDocumentsItem,
|
49
|
+
DocumentsIngestLocalRequestFilesItem,
|
50
|
+
WebsiteCrawlRequestWebsitesItem,
|
51
|
+
)
|
48
52
|
from .environment import GroundXEnvironment
|
49
53
|
from .search import SearchContentRequestId
|
50
54
|
from .version import __version__
|
@@ -66,6 +70,7 @@ __all__ = [
|
|
66
70
|
"DocumentRemoteIngestRequestDocumentsItem",
|
67
71
|
"DocumentResponse",
|
68
72
|
"DocumentType",
|
73
|
+
"DocumentsIngestLocalRequestFilesItem",
|
69
74
|
"GroundX",
|
70
75
|
"GroundXEnvironment",
|
71
76
|
"GroupDetail",
|
groundx/core/client_wrapper.py
CHANGED
groundx/documents/__init__.py
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
2
2
|
|
3
|
-
from .types import
|
3
|
+
from .types import (
|
4
|
+
DocumentRemoteIngestRequestDocumentsItem,
|
5
|
+
DocumentsIngestLocalRequestFilesItem,
|
6
|
+
WebsiteCrawlRequestWebsitesItem,
|
7
|
+
)
|
4
8
|
|
5
|
-
__all__ = [
|
9
|
+
__all__ = [
|
10
|
+
"DocumentRemoteIngestRequestDocumentsItem",
|
11
|
+
"DocumentsIngestLocalRequestFilesItem",
|
12
|
+
"WebsiteCrawlRequestWebsitesItem",
|
13
|
+
]
|
groundx/documents/client.py
CHANGED
@@ -11,6 +11,7 @@ from ..errors.bad_request_error import BadRequestError
|
|
11
11
|
from ..errors.unauthorized_error import UnauthorizedError
|
12
12
|
from json.decoder import JSONDecodeError
|
13
13
|
from ..core.api_error import ApiError
|
14
|
+
from .types.documents_ingest_local_request_files_item import DocumentsIngestLocalRequestFilesItem
|
14
15
|
from .types.website_crawl_request_websites_item import WebsiteCrawlRequestWebsitesItem
|
15
16
|
from ..types.process_status_response import ProcessStatusResponse
|
16
17
|
from ..core.jsonable_encoder import jsonable_encoder
|
@@ -65,6 +66,9 @@ class DocumentsClient:
|
|
65
66
|
documents=[
|
66
67
|
DocumentRemoteIngestRequestDocumentsItem(
|
67
68
|
bucket_id=1234,
|
69
|
+
file_name="my_file.txt",
|
70
|
+
file_type="txt",
|
71
|
+
search_data={"key": "value"},
|
68
72
|
source_url="https://my.source.url.com/file.txt",
|
69
73
|
)
|
70
74
|
],
|
@@ -120,7 +124,12 @@ class DocumentsClient:
|
|
120
124
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
121
125
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
122
126
|
|
123
|
-
def ingest_local(
|
127
|
+
def ingest_local(
|
128
|
+
self,
|
129
|
+
*,
|
130
|
+
files: typing.List[DocumentsIngestLocalRequestFilesItem],
|
131
|
+
request_options: typing.Optional[RequestOptions] = None,
|
132
|
+
) -> IngestResponse:
|
124
133
|
"""
|
125
134
|
Upload documents hosted on a local file system for ingestion into a GroundX bucket.
|
126
135
|
|
@@ -128,6 +137,8 @@ class DocumentsClient:
|
|
128
137
|
|
129
138
|
Parameters
|
130
139
|
----------
|
140
|
+
files : typing.List[DocumentsIngestLocalRequestFilesItem]
|
141
|
+
|
131
142
|
request_options : typing.Optional[RequestOptions]
|
132
143
|
Request-specific configuration.
|
133
144
|
|
@@ -139,16 +150,28 @@ class DocumentsClient:
|
|
139
150
|
Examples
|
140
151
|
--------
|
141
152
|
from groundx import GroundX
|
153
|
+
from groundx.documents import DocumentsIngestLocalRequestFilesItem
|
142
154
|
|
143
155
|
client = GroundX(
|
144
156
|
api_key="YOUR_API_KEY",
|
145
157
|
)
|
146
|
-
client.documents.ingest_local(
|
158
|
+
client.documents.ingest_local(
|
159
|
+
files=[
|
160
|
+
DocumentsIngestLocalRequestFilesItem(
|
161
|
+
bucket_id=1,
|
162
|
+
file_data="fileData",
|
163
|
+
file_name="fileName",
|
164
|
+
file_type="txt",
|
165
|
+
)
|
166
|
+
],
|
167
|
+
)
|
147
168
|
"""
|
148
169
|
_response = self._client_wrapper.httpx_client.request(
|
149
170
|
"v1/ingest/documents/local",
|
150
171
|
method="POST",
|
151
|
-
data={
|
172
|
+
data={
|
173
|
+
"files": files,
|
174
|
+
},
|
152
175
|
files={},
|
153
176
|
request_options=request_options,
|
154
177
|
omit=OMIT,
|
@@ -792,6 +815,9 @@ class AsyncDocumentsClient:
|
|
792
815
|
documents=[
|
793
816
|
DocumentRemoteIngestRequestDocumentsItem(
|
794
817
|
bucket_id=1234,
|
818
|
+
file_name="my_file.txt",
|
819
|
+
file_type="txt",
|
820
|
+
search_data={"key": "value"},
|
795
821
|
source_url="https://my.source.url.com/file.txt",
|
796
822
|
)
|
797
823
|
],
|
@@ -850,7 +876,12 @@ class AsyncDocumentsClient:
|
|
850
876
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
851
877
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
852
878
|
|
853
|
-
async def ingest_local(
|
879
|
+
async def ingest_local(
|
880
|
+
self,
|
881
|
+
*,
|
882
|
+
files: typing.List[DocumentsIngestLocalRequestFilesItem],
|
883
|
+
request_options: typing.Optional[RequestOptions] = None,
|
884
|
+
) -> IngestResponse:
|
854
885
|
"""
|
855
886
|
Upload documents hosted on a local file system for ingestion into a GroundX bucket.
|
856
887
|
|
@@ -858,6 +889,8 @@ class AsyncDocumentsClient:
|
|
858
889
|
|
859
890
|
Parameters
|
860
891
|
----------
|
892
|
+
files : typing.List[DocumentsIngestLocalRequestFilesItem]
|
893
|
+
|
861
894
|
request_options : typing.Optional[RequestOptions]
|
862
895
|
Request-specific configuration.
|
863
896
|
|
@@ -871,6 +904,7 @@ class AsyncDocumentsClient:
|
|
871
904
|
import asyncio
|
872
905
|
|
873
906
|
from groundx import AsyncGroundX
|
907
|
+
from groundx.documents import DocumentsIngestLocalRequestFilesItem
|
874
908
|
|
875
909
|
client = AsyncGroundX(
|
876
910
|
api_key="YOUR_API_KEY",
|
@@ -878,7 +912,16 @@ class AsyncDocumentsClient:
|
|
878
912
|
|
879
913
|
|
880
914
|
async def main() -> None:
|
881
|
-
await client.documents.ingest_local(
|
915
|
+
await client.documents.ingest_local(
|
916
|
+
files=[
|
917
|
+
DocumentsIngestLocalRequestFilesItem(
|
918
|
+
bucket_id=1,
|
919
|
+
file_data="fileData",
|
920
|
+
file_name="fileName",
|
921
|
+
file_type="txt",
|
922
|
+
)
|
923
|
+
],
|
924
|
+
)
|
882
925
|
|
883
926
|
|
884
927
|
asyncio.run(main())
|
@@ -886,7 +929,9 @@ class AsyncDocumentsClient:
|
|
886
929
|
_response = await self._client_wrapper.httpx_client.request(
|
887
930
|
"v1/ingest/documents/local",
|
888
931
|
method="POST",
|
889
|
-
data={
|
932
|
+
data={
|
933
|
+
"files": files,
|
934
|
+
},
|
890
935
|
files={},
|
891
936
|
request_options=request_options,
|
892
937
|
omit=OMIT,
|
@@ -1,6 +1,11 @@
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
2
2
|
|
3
3
|
from .document_remote_ingest_request_documents_item import DocumentRemoteIngestRequestDocumentsItem
|
4
|
+
from .documents_ingest_local_request_files_item import DocumentsIngestLocalRequestFilesItem
|
4
5
|
from .website_crawl_request_websites_item import WebsiteCrawlRequestWebsitesItem
|
5
6
|
|
6
|
-
__all__ = [
|
7
|
+
__all__ = [
|
8
|
+
"DocumentRemoteIngestRequestDocumentsItem",
|
9
|
+
"DocumentsIngestLocalRequestFilesItem",
|
10
|
+
"WebsiteCrawlRequestWebsitesItem",
|
11
|
+
]
|
@@ -0,0 +1,43 @@
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
2
|
+
|
3
|
+
from ...core.pydantic_utilities import UniversalBaseModel
|
4
|
+
import typing_extensions
|
5
|
+
from ...core.serialization import FieldMetadata
|
6
|
+
import pydantic
|
7
|
+
from ...types.document_type import DocumentType
|
8
|
+
import typing
|
9
|
+
from ...core.pydantic_utilities import IS_PYDANTIC_V2
|
10
|
+
|
11
|
+
|
12
|
+
class DocumentsIngestLocalRequestFilesItem(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()
|
19
|
+
"""
|
20
|
+
Binary data for the file being ingested.
|
21
|
+
"""
|
22
|
+
|
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
|
+
"""
|
35
|
+
|
36
|
+
if IS_PYDANTIC_V2:
|
37
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
38
|
+
else:
|
39
|
+
|
40
|
+
class Config:
|
41
|
+
frozen = True
|
42
|
+
smart_union = True
|
43
|
+
extra = pydantic.Extra.allow
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: groundx
|
3
|
-
Version: 2.0.
|
3
|
+
Version: 2.0.14
|
4
4
|
Summary:
|
5
5
|
License: MIT
|
6
6
|
Requires-Python: >=3.8,<4.0
|
@@ -62,6 +62,9 @@ client.documents.ingest_remote(
|
|
62
62
|
documents=[
|
63
63
|
DocumentRemoteIngestRequestDocumentsItem(
|
64
64
|
bucket_id=1234,
|
65
|
+
file_name="my_file.txt",
|
66
|
+
file_type="txt",
|
67
|
+
search_data={"key": "value"},
|
65
68
|
source_url="https://my.source.url.com/file.txt",
|
66
69
|
)
|
67
70
|
],
|
@@ -88,6 +91,9 @@ async def main() -> None:
|
|
88
91
|
documents=[
|
89
92
|
DocumentRemoteIngestRequestDocumentsItem(
|
90
93
|
bucket_id=1234,
|
94
|
+
file_name="my_file.txt",
|
95
|
+
file_type="txt",
|
96
|
+
search_data={"key": "value"},
|
91
97
|
source_url="https://my.source.url.com/file.txt",
|
92
98
|
)
|
93
99
|
],
|
@@ -1,10 +1,10 @@
|
|
1
|
-
groundx/__init__.py,sha256=
|
1
|
+
groundx/__init__.py,sha256=LoqXol72hAjLcTlZd2VfzvZJ_BVWAUPHqub4fwkY0pE,2978
|
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=
|
7
|
+
groundx/core/client_wrapper.py,sha256=tGKKsvVuRWrBfZBKCMnZ8-HLxQceh8itn0sJcf9G4Y8,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
|
@@ -16,10 +16,11 @@ groundx/core/request_options.py,sha256=h0QUNCFVdCW_7GclVySCAY2w4NhtXVBUCmHgmzaxp
|
|
16
16
|
groundx/core/serialization.py,sha256=D9h_t-RQON3-CHWs1C4ESY9B-Yd5d-l5lnTLb_X896g,9601
|
17
17
|
groundx/customer/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
|
18
18
|
groundx/customer/client.py,sha256=C_JANeDewRD1Kg-q7LPxdiOSWbYSTOiYlBYZLRYPI44,3467
|
19
|
-
groundx/documents/__init__.py,sha256=
|
20
|
-
groundx/documents/client.py,sha256=
|
21
|
-
groundx/documents/types/__init__.py,sha256=
|
19
|
+
groundx/documents/__init__.py,sha256=H7q_UJJyRsjDdapoH7WeMtB89eUL6G3Pq3UQLCbvqgc,359
|
20
|
+
groundx/documents/client.py,sha256=eNQxQQAof1eYv2qQ0uY0B81LdF9U1zJdLm2jtlZppwY,59333
|
21
|
+
groundx/documents/types/__init__.py,sha256=2hClhaZpkoWywGLA1VeO9Ht81soK1x3bdFg74jQFZfo,484
|
22
22
|
groundx/documents/types/document_remote_ingest_request_documents_item.py,sha256=IjZu1L3MGUxW2qydZlns5_DsMgOLNyAWDvKpy9VL6iE,1714
|
23
|
+
groundx/documents/types/documents_ingest_local_request_files_item.py,sha256=EpD7TE1us1DAXdcPvI1li-AGUNpEy_f13bBXidmCAL8,1630
|
23
24
|
groundx/documents/types/website_crawl_request_websites_item.py,sha256=6So4stWecfZYPbiQWg6-FgsfIqV4g2ujFXXgn70evNI,1597
|
24
25
|
groundx/environment.py,sha256=CInm1_DKtZ1mrxutmKb1qqv82P33r_S87hZD3Hc1VB0,159
|
25
26
|
groundx/errors/__init__.py,sha256=-prNYsFd8xxM4va0vR1raZjcd10tllOJKyEWjX_pwdU,214
|
@@ -75,7 +76,7 @@ groundx/types/sort_order.py,sha256=hfJkStz6zHf3iWQFaVLkNCZPdyj5JS7TsQlN4Ij8Q5A,1
|
|
75
76
|
groundx/types/subscription_detail.py,sha256=WNfUw2EMVECIvNYcV2s51zZ6T3Utc4zYXw63bPaeM6U,768
|
76
77
|
groundx/types/subscription_detail_meters.py,sha256=lBa8-1QlMVHjr5RLGqhiTKnD1KMM0AAHTWvz9TVtG8w,830
|
77
78
|
groundx/version.py,sha256=1yVogKaq260fQfckM2RYN2144SEw0QROsZW8ICtkG4U,74
|
78
|
-
groundx-2.0.
|
79
|
-
groundx-2.0.
|
80
|
-
groundx-2.0.
|
81
|
-
groundx-2.0.
|
79
|
+
groundx-2.0.14.dist-info/LICENSE,sha256=8dMPYAFBTA7O4DUxhrEKEks8CL2waCMYM6dHohW4xrI,1065
|
80
|
+
groundx-2.0.14.dist-info/METADATA,sha256=17yAs5nZtJR8qqezCNlXAfPBUTwMaUYWjgzM90Af0Kk,5344
|
81
|
+
groundx-2.0.14.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
|
82
|
+
groundx-2.0.14.dist-info/RECORD,,
|
File without changes
|
File without changes
|