groundx 2.0.12__py3-none-any.whl → 2.0.13__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 +45 -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.13.dist-info}/METADATA +1 -1
- {groundx-2.0.12.dist-info → groundx-2.0.13.dist-info}/RECORD +10 -9
- {groundx-2.0.12.dist-info → groundx-2.0.13.dist-info}/LICENSE +0 -0
- {groundx-2.0.12.dist-info → groundx-2.0.13.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
|
@@ -120,7 +121,12 @@ class DocumentsClient:
|
|
120
121
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
121
122
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
122
123
|
|
123
|
-
def ingest_local(
|
124
|
+
def ingest_local(
|
125
|
+
self,
|
126
|
+
*,
|
127
|
+
files: typing.List[DocumentsIngestLocalRequestFilesItem],
|
128
|
+
request_options: typing.Optional[RequestOptions] = None,
|
129
|
+
) -> IngestResponse:
|
124
130
|
"""
|
125
131
|
Upload documents hosted on a local file system for ingestion into a GroundX bucket.
|
126
132
|
|
@@ -128,6 +134,8 @@ class DocumentsClient:
|
|
128
134
|
|
129
135
|
Parameters
|
130
136
|
----------
|
137
|
+
files : typing.List[DocumentsIngestLocalRequestFilesItem]
|
138
|
+
|
131
139
|
request_options : typing.Optional[RequestOptions]
|
132
140
|
Request-specific configuration.
|
133
141
|
|
@@ -139,16 +147,28 @@ class DocumentsClient:
|
|
139
147
|
Examples
|
140
148
|
--------
|
141
149
|
from groundx import GroundX
|
150
|
+
from groundx.documents import DocumentsIngestLocalRequestFilesItem
|
142
151
|
|
143
152
|
client = GroundX(
|
144
153
|
api_key="YOUR_API_KEY",
|
145
154
|
)
|
146
|
-
client.documents.ingest_local(
|
155
|
+
client.documents.ingest_local(
|
156
|
+
files=[
|
157
|
+
DocumentsIngestLocalRequestFilesItem(
|
158
|
+
bucket_id=1,
|
159
|
+
file_data="fileData",
|
160
|
+
file_name="fileName",
|
161
|
+
file_type="txt",
|
162
|
+
)
|
163
|
+
],
|
164
|
+
)
|
147
165
|
"""
|
148
166
|
_response = self._client_wrapper.httpx_client.request(
|
149
167
|
"v1/ingest/documents/local",
|
150
168
|
method="POST",
|
151
|
-
data={
|
169
|
+
data={
|
170
|
+
"files": files,
|
171
|
+
},
|
152
172
|
files={},
|
153
173
|
request_options=request_options,
|
154
174
|
omit=OMIT,
|
@@ -850,7 +870,12 @@ class AsyncDocumentsClient:
|
|
850
870
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
851
871
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
852
872
|
|
853
|
-
async def ingest_local(
|
873
|
+
async def ingest_local(
|
874
|
+
self,
|
875
|
+
*,
|
876
|
+
files: typing.List[DocumentsIngestLocalRequestFilesItem],
|
877
|
+
request_options: typing.Optional[RequestOptions] = None,
|
878
|
+
) -> IngestResponse:
|
854
879
|
"""
|
855
880
|
Upload documents hosted on a local file system for ingestion into a GroundX bucket.
|
856
881
|
|
@@ -858,6 +883,8 @@ class AsyncDocumentsClient:
|
|
858
883
|
|
859
884
|
Parameters
|
860
885
|
----------
|
886
|
+
files : typing.List[DocumentsIngestLocalRequestFilesItem]
|
887
|
+
|
861
888
|
request_options : typing.Optional[RequestOptions]
|
862
889
|
Request-specific configuration.
|
863
890
|
|
@@ -871,6 +898,7 @@ class AsyncDocumentsClient:
|
|
871
898
|
import asyncio
|
872
899
|
|
873
900
|
from groundx import AsyncGroundX
|
901
|
+
from groundx.documents import DocumentsIngestLocalRequestFilesItem
|
874
902
|
|
875
903
|
client = AsyncGroundX(
|
876
904
|
api_key="YOUR_API_KEY",
|
@@ -878,7 +906,16 @@ class AsyncDocumentsClient:
|
|
878
906
|
|
879
907
|
|
880
908
|
async def main() -> None:
|
881
|
-
await client.documents.ingest_local(
|
909
|
+
await client.documents.ingest_local(
|
910
|
+
files=[
|
911
|
+
DocumentsIngestLocalRequestFilesItem(
|
912
|
+
bucket_id=1,
|
913
|
+
file_data="fileData",
|
914
|
+
file_name="fileName",
|
915
|
+
file_type="txt",
|
916
|
+
)
|
917
|
+
],
|
918
|
+
)
|
882
919
|
|
883
920
|
|
884
921
|
asyncio.run(main())
|
@@ -886,7 +923,9 @@ class AsyncDocumentsClient:
|
|
886
923
|
_response = await self._client_wrapper.httpx_client.request(
|
887
924
|
"v1/ingest/documents/local",
|
888
925
|
method="POST",
|
889
|
-
data={
|
926
|
+
data={
|
927
|
+
"files": files,
|
928
|
+
},
|
890
929
|
files={},
|
891
930
|
request_options=request_options,
|
892
931
|
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
|
+
The actual 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,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=i0qvc0BaD5Rv4EK4VI6BX08eaNMa4_xNY8TJAVTiovA,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=6XLEcOUMxN5ZByBic_oBU_IpR-OPod_dsy9LjvLT4H4,59057
|
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=036fSQOj8DMPCMFVQSXqZwuS25IjW3lVnR8JAez9Bao,1621
|
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.13.dist-info/LICENSE,sha256=8dMPYAFBTA7O4DUxhrEKEks8CL2waCMYM6dHohW4xrI,1065
|
80
|
+
groundx-2.0.13.dist-info/METADATA,sha256=JwUuwvHoY3noQ3J-KT-r3Vq2CYspM6KlfhkdENZgEHg,5116
|
81
|
+
groundx-2.0.13.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
|
82
|
+
groundx-2.0.13.dist-info/RECORD,,
|
File without changes
|
File without changes
|