groundx 2.3.3__py3-none-any.whl → 2.3.5__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 +2 -0
- groundx/buckets/__init__.py +2 -0
- groundx/buckets/client.py +47 -366
- groundx/buckets/raw_client.py +628 -0
- groundx/client.py +15 -17
- groundx/core/__init__.py +5 -0
- groundx/core/api_error.py +13 -5
- groundx/core/client_wrapper.py +4 -3
- groundx/core/force_multipart.py +16 -0
- groundx/core/http_client.py +70 -26
- groundx/core/http_response.py +55 -0
- groundx/core/jsonable_encoder.py +0 -1
- groundx/core/pydantic_utilities.py +69 -110
- groundx/core/serialization.py +7 -3
- groundx/customer/__init__.py +2 -0
- groundx/customer/client.py +31 -43
- groundx/customer/raw_client.py +91 -0
- groundx/documents/__init__.py +2 -0
- groundx/documents/client.py +100 -780
- groundx/documents/raw_client.py +1404 -0
- groundx/errors/__init__.py +2 -0
- groundx/errors/bad_request_error.py +4 -3
- groundx/errors/unauthorized_error.py +4 -3
- groundx/groups/__init__.py +2 -0
- groundx/groups/client.py +55 -520
- groundx/groups/raw_client.py +901 -0
- groundx/health/__init__.py +2 -0
- groundx/health/client.py +35 -101
- groundx/health/raw_client.py +193 -0
- groundx/search/__init__.py +2 -0
- groundx/search/client.py +64 -213
- groundx/search/raw_client.py +442 -0
- groundx/search/types/__init__.py +2 -0
- groundx/types/__init__.py +2 -0
- groundx/types/bounding_box_detail.py +4 -4
- groundx/types/bucket_detail.py +5 -5
- groundx/types/bucket_list_response.py +3 -3
- groundx/types/bucket_response.py +3 -3
- groundx/types/bucket_update_detail.py +4 -4
- groundx/types/bucket_update_response.py +3 -3
- groundx/types/customer_detail.py +2 -2
- groundx/types/customer_response.py +3 -3
- groundx/types/document.py +4 -4
- groundx/types/document_detail.py +4 -4
- groundx/types/document_list_response.py +4 -4
- groundx/types/document_local_ingest_request.py +1 -0
- groundx/types/document_lookup_response.py +3 -3
- groundx/types/document_response.py +3 -3
- groundx/types/group_detail.py +4 -4
- groundx/types/group_list_response.py +3 -3
- groundx/types/group_response.py +3 -3
- groundx/types/health_response.py +3 -3
- groundx/types/health_response_health.py +3 -3
- groundx/types/health_service.py +5 -5
- groundx/types/ingest_local_document.py +3 -3
- groundx/types/ingest_local_document_metadata.py +4 -4
- groundx/types/ingest_remote_document.py +4 -4
- groundx/types/ingest_response.py +3 -3
- groundx/types/ingest_status.py +3 -3
- groundx/types/ingest_status_light.py +3 -3
- groundx/types/ingest_status_progress.py +3 -3
- groundx/types/ingest_status_progress_cancelled.py +3 -3
- groundx/types/ingest_status_progress_complete.py +3 -3
- groundx/types/ingest_status_progress_errors.py +3 -3
- groundx/types/ingest_status_progress_processing.py +3 -3
- groundx/types/message_response.py +2 -2
- groundx/types/meter_detail.py +2 -2
- groundx/types/processes_status_response.py +3 -3
- groundx/types/search_response.py +3 -3
- groundx/types/search_response_search.py +3 -3
- groundx/types/search_result_item.py +5 -5
- groundx/types/subscription_detail.py +3 -3
- groundx/types/subscription_detail_meters.py +5 -5
- groundx/types/website_source.py +4 -4
- {groundx-2.3.3.dist-info → groundx-2.3.5.dist-info}/METADATA +1 -1
- groundx-2.3.5.dist-info/RECORD +95 -0
- groundx-2.3.3.dist-info/RECORD +0 -87
- {groundx-2.3.3.dist-info → groundx-2.3.5.dist-info}/LICENSE +0 -0
- {groundx-2.3.3.dist-info → groundx-2.3.5.dist-info}/WHEEL +0 -0
groundx/search/client.py
CHANGED
@@ -1,17 +1,12 @@
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
2
2
|
|
3
3
|
import typing
|
4
|
-
|
5
|
-
from .
|
4
|
+
|
5
|
+
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
6
6
|
from ..core.request_options import RequestOptions
|
7
7
|
from ..types.search_response import SearchResponse
|
8
|
-
from
|
9
|
-
from
|
10
|
-
from ..errors.bad_request_error import BadRequestError
|
11
|
-
from ..errors.unauthorized_error import UnauthorizedError
|
12
|
-
from json.decoder import JSONDecodeError
|
13
|
-
from ..core.api_error import ApiError
|
14
|
-
from ..core.client_wrapper import AsyncClientWrapper
|
8
|
+
from .raw_client import AsyncRawSearchClient, RawSearchClient
|
9
|
+
from .types.search_content_request_id import SearchContentRequestId
|
15
10
|
|
16
11
|
# this is used as the default value for optional parameters
|
17
12
|
OMIT = typing.cast(typing.Any, ...)
|
@@ -19,7 +14,18 @@ OMIT = typing.cast(typing.Any, ...)
|
|
19
14
|
|
20
15
|
class SearchClient:
|
21
16
|
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
22
|
-
self.
|
17
|
+
self._raw_client = RawSearchClient(client_wrapper=client_wrapper)
|
18
|
+
|
19
|
+
@property
|
20
|
+
def with_raw_response(self) -> RawSearchClient:
|
21
|
+
"""
|
22
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
23
|
+
|
24
|
+
Returns
|
25
|
+
-------
|
26
|
+
RawSearchClient
|
27
|
+
"""
|
28
|
+
return self._raw_client
|
23
29
|
|
24
30
|
def content(
|
25
31
|
self,
|
@@ -81,58 +87,17 @@ class SearchClient:
|
|
81
87
|
query="my search query",
|
82
88
|
)
|
83
89
|
"""
|
84
|
-
_response = self.
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
json={
|
93
|
-
"query": query,
|
94
|
-
"filter": filter,
|
95
|
-
"relevance": relevance,
|
96
|
-
},
|
97
|
-
headers={
|
98
|
-
"content-type": "application/json",
|
99
|
-
},
|
90
|
+
_response = self._raw_client.content(
|
91
|
+
id,
|
92
|
+
query=query,
|
93
|
+
n=n,
|
94
|
+
next_token=next_token,
|
95
|
+
verbosity=verbosity,
|
96
|
+
filter=filter,
|
97
|
+
relevance=relevance,
|
100
98
|
request_options=request_options,
|
101
|
-
omit=OMIT,
|
102
99
|
)
|
103
|
-
|
104
|
-
if 200 <= _response.status_code < 300:
|
105
|
-
return typing.cast(
|
106
|
-
SearchResponse,
|
107
|
-
parse_obj_as(
|
108
|
-
type_=SearchResponse, # type: ignore
|
109
|
-
object_=_response.json(),
|
110
|
-
),
|
111
|
-
)
|
112
|
-
if _response.status_code == 400:
|
113
|
-
raise BadRequestError(
|
114
|
-
typing.cast(
|
115
|
-
typing.Optional[typing.Any],
|
116
|
-
parse_obj_as(
|
117
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
118
|
-
object_=_response.json(),
|
119
|
-
),
|
120
|
-
)
|
121
|
-
)
|
122
|
-
if _response.status_code == 401:
|
123
|
-
raise UnauthorizedError(
|
124
|
-
typing.cast(
|
125
|
-
typing.Optional[typing.Any],
|
126
|
-
parse_obj_as(
|
127
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
128
|
-
object_=_response.json(),
|
129
|
-
),
|
130
|
-
)
|
131
|
-
)
|
132
|
-
_response_json = _response.json()
|
133
|
-
except JSONDecodeError:
|
134
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
135
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
100
|
+
return _response.data
|
136
101
|
|
137
102
|
def documents(
|
138
103
|
self,
|
@@ -194,64 +159,33 @@ class SearchClient:
|
|
194
159
|
document_ids=["docUUID1", "docUUID2"],
|
195
160
|
)
|
196
161
|
"""
|
197
|
-
_response = self.
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
json={
|
206
|
-
"query": query,
|
207
|
-
"documentIds": document_ids,
|
208
|
-
"filter": filter,
|
209
|
-
"relevance": relevance,
|
210
|
-
},
|
211
|
-
headers={
|
212
|
-
"content-type": "application/json",
|
213
|
-
},
|
162
|
+
_response = self._raw_client.documents(
|
163
|
+
query=query,
|
164
|
+
document_ids=document_ids,
|
165
|
+
n=n,
|
166
|
+
next_token=next_token,
|
167
|
+
verbosity=verbosity,
|
168
|
+
filter=filter,
|
169
|
+
relevance=relevance,
|
214
170
|
request_options=request_options,
|
215
|
-
omit=OMIT,
|
216
171
|
)
|
217
|
-
|
218
|
-
if 200 <= _response.status_code < 300:
|
219
|
-
return typing.cast(
|
220
|
-
SearchResponse,
|
221
|
-
parse_obj_as(
|
222
|
-
type_=SearchResponse, # type: ignore
|
223
|
-
object_=_response.json(),
|
224
|
-
),
|
225
|
-
)
|
226
|
-
if _response.status_code == 400:
|
227
|
-
raise BadRequestError(
|
228
|
-
typing.cast(
|
229
|
-
typing.Optional[typing.Any],
|
230
|
-
parse_obj_as(
|
231
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
232
|
-
object_=_response.json(),
|
233
|
-
),
|
234
|
-
)
|
235
|
-
)
|
236
|
-
if _response.status_code == 401:
|
237
|
-
raise UnauthorizedError(
|
238
|
-
typing.cast(
|
239
|
-
typing.Optional[typing.Any],
|
240
|
-
parse_obj_as(
|
241
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
242
|
-
object_=_response.json(),
|
243
|
-
),
|
244
|
-
)
|
245
|
-
)
|
246
|
-
_response_json = _response.json()
|
247
|
-
except JSONDecodeError:
|
248
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
249
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
172
|
+
return _response.data
|
250
173
|
|
251
174
|
|
252
175
|
class AsyncSearchClient:
|
253
176
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
254
|
-
self.
|
177
|
+
self._raw_client = AsyncRawSearchClient(client_wrapper=client_wrapper)
|
178
|
+
|
179
|
+
@property
|
180
|
+
def with_raw_response(self) -> AsyncRawSearchClient:
|
181
|
+
"""
|
182
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
183
|
+
|
184
|
+
Returns
|
185
|
+
-------
|
186
|
+
AsyncRawSearchClient
|
187
|
+
"""
|
188
|
+
return self._raw_client
|
255
189
|
|
256
190
|
async def content(
|
257
191
|
self,
|
@@ -321,58 +255,17 @@ class AsyncSearchClient:
|
|
321
255
|
|
322
256
|
asyncio.run(main())
|
323
257
|
"""
|
324
|
-
_response = await self.
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
json={
|
333
|
-
"query": query,
|
334
|
-
"filter": filter,
|
335
|
-
"relevance": relevance,
|
336
|
-
},
|
337
|
-
headers={
|
338
|
-
"content-type": "application/json",
|
339
|
-
},
|
258
|
+
_response = await self._raw_client.content(
|
259
|
+
id,
|
260
|
+
query=query,
|
261
|
+
n=n,
|
262
|
+
next_token=next_token,
|
263
|
+
verbosity=verbosity,
|
264
|
+
filter=filter,
|
265
|
+
relevance=relevance,
|
340
266
|
request_options=request_options,
|
341
|
-
omit=OMIT,
|
342
267
|
)
|
343
|
-
|
344
|
-
if 200 <= _response.status_code < 300:
|
345
|
-
return typing.cast(
|
346
|
-
SearchResponse,
|
347
|
-
parse_obj_as(
|
348
|
-
type_=SearchResponse, # type: ignore
|
349
|
-
object_=_response.json(),
|
350
|
-
),
|
351
|
-
)
|
352
|
-
if _response.status_code == 400:
|
353
|
-
raise BadRequestError(
|
354
|
-
typing.cast(
|
355
|
-
typing.Optional[typing.Any],
|
356
|
-
parse_obj_as(
|
357
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
358
|
-
object_=_response.json(),
|
359
|
-
),
|
360
|
-
)
|
361
|
-
)
|
362
|
-
if _response.status_code == 401:
|
363
|
-
raise UnauthorizedError(
|
364
|
-
typing.cast(
|
365
|
-
typing.Optional[typing.Any],
|
366
|
-
parse_obj_as(
|
367
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
368
|
-
object_=_response.json(),
|
369
|
-
),
|
370
|
-
)
|
371
|
-
)
|
372
|
-
_response_json = _response.json()
|
373
|
-
except JSONDecodeError:
|
374
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
375
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
268
|
+
return _response.data
|
376
269
|
|
377
270
|
async def documents(
|
378
271
|
self,
|
@@ -442,56 +335,14 @@ class AsyncSearchClient:
|
|
442
335
|
|
443
336
|
asyncio.run(main())
|
444
337
|
"""
|
445
|
-
_response = await self.
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
json={
|
454
|
-
"query": query,
|
455
|
-
"documentIds": document_ids,
|
456
|
-
"filter": filter,
|
457
|
-
"relevance": relevance,
|
458
|
-
},
|
459
|
-
headers={
|
460
|
-
"content-type": "application/json",
|
461
|
-
},
|
338
|
+
_response = await self._raw_client.documents(
|
339
|
+
query=query,
|
340
|
+
document_ids=document_ids,
|
341
|
+
n=n,
|
342
|
+
next_token=next_token,
|
343
|
+
verbosity=verbosity,
|
344
|
+
filter=filter,
|
345
|
+
relevance=relevance,
|
462
346
|
request_options=request_options,
|
463
|
-
omit=OMIT,
|
464
347
|
)
|
465
|
-
|
466
|
-
if 200 <= _response.status_code < 300:
|
467
|
-
return typing.cast(
|
468
|
-
SearchResponse,
|
469
|
-
parse_obj_as(
|
470
|
-
type_=SearchResponse, # type: ignore
|
471
|
-
object_=_response.json(),
|
472
|
-
),
|
473
|
-
)
|
474
|
-
if _response.status_code == 400:
|
475
|
-
raise BadRequestError(
|
476
|
-
typing.cast(
|
477
|
-
typing.Optional[typing.Any],
|
478
|
-
parse_obj_as(
|
479
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
480
|
-
object_=_response.json(),
|
481
|
-
),
|
482
|
-
)
|
483
|
-
)
|
484
|
-
if _response.status_code == 401:
|
485
|
-
raise UnauthorizedError(
|
486
|
-
typing.cast(
|
487
|
-
typing.Optional[typing.Any],
|
488
|
-
parse_obj_as(
|
489
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
490
|
-
object_=_response.json(),
|
491
|
-
),
|
492
|
-
)
|
493
|
-
)
|
494
|
-
_response_json = _response.json()
|
495
|
-
except JSONDecodeError:
|
496
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
497
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
348
|
+
return _response.data
|