groundx 2.3.0__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 +16 -16
- 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 +122 -789
- 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/ingest.py +2 -2
- groundx/search/__init__.py +2 -0
- groundx/search/client.py +82 -211
- groundx/search/raw_client.py +442 -0
- groundx/search/types/__init__.py +2 -0
- groundx/types/__init__.py +16 -16
- groundx/types/bounding_box_detail.py +4 -4
- groundx/types/bucket_detail.py +5 -5
- groundx/types/bucket_list_response.py +17 -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 +9 -4
- groundx/types/document_list_response.py +4 -4
- groundx/types/document_local_ingest_request.py +1 -0
- groundx/types/document_lookup_response.py +8 -3
- groundx/types/document_response.py +3 -3
- groundx/types/group_detail.py +4 -4
- groundx/types/group_list_response.py +17 -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 +9 -4
- groundx/types/ingest_remote_document.py +10 -5
- groundx/types/ingest_response.py +4 -4
- groundx/types/{process_status_response_ingest.py → ingest_status.py} +8 -7
- groundx/types/{ingest_response_ingest.py → ingest_status_light.py} +7 -5
- groundx/types/ingest_status_progress.py +26 -0
- groundx/types/{process_status_response_ingest_progress_errors.py → ingest_status_progress_cancelled.py} +4 -4
- groundx/types/{process_status_response_ingest_progress_complete.py → ingest_status_progress_complete.py} +4 -4
- groundx/types/{process_status_response_ingest_progress_cancelled.py → ingest_status_progress_errors.py} +4 -4
- groundx/types/{process_status_response_ingest_progress_processing.py → ingest_status_progress_processing.py} +4 -4
- groundx/types/message_response.py +2 -2
- groundx/types/meter_detail.py +2 -2
- groundx/types/processes_status_response.py +19 -2
- 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.0.dist-info → groundx-2.3.5.dist-info}/METADATA +1 -1
- groundx-2.3.5.dist-info/RECORD +95 -0
- groundx/types/process_status_response.py +0 -20
- groundx/types/process_status_response_ingest_progress.py +0 -26
- groundx-2.3.0.dist-info/RECORD +0 -88
- {groundx-2.3.0.dist-info → groundx-2.3.5.dist-info}/LICENSE +0 -0
- {groundx-2.3.0.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,
|
@@ -29,6 +35,7 @@ class SearchClient:
|
|
29
35
|
n: typing.Optional[int] = None,
|
30
36
|
next_token: typing.Optional[str] = None,
|
31
37
|
verbosity: typing.Optional[int] = None,
|
38
|
+
filter: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
|
32
39
|
relevance: typing.Optional[float] = OMIT,
|
33
40
|
request_options: typing.Optional[RequestOptions] = None,
|
34
41
|
) -> SearchResponse:
|
@@ -39,7 +46,7 @@ class SearchClient:
|
|
39
46
|
Parameters
|
40
47
|
----------
|
41
48
|
id : SearchContentRequestId
|
42
|
-
The bucketId, groupId,
|
49
|
+
The bucketId, groupId, or documentId to be searched. The document or documents within the specified container will be compared to the query, and relevant information will be extracted.
|
43
50
|
|
44
51
|
query : str
|
45
52
|
The search query to be used to find relevant documentation.
|
@@ -53,6 +60,9 @@ class SearchClient:
|
|
53
60
|
verbosity : typing.Optional[int]
|
54
61
|
The amount of data returned with each search result. 0 == no search results, only the recommended context. 1 == search results but no searchData. 2 == search results and searchData.
|
55
62
|
|
63
|
+
filter : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
|
64
|
+
A dictionary of key-value pairs that can be used to pre-filter documents prior to a search.
|
65
|
+
|
56
66
|
relevance : typing.Optional[float]
|
57
67
|
The minimum search relevance score required to include the result. By default, this is 10.0.
|
58
68
|
|
@@ -77,57 +87,17 @@ class SearchClient:
|
|
77
87
|
query="my search query",
|
78
88
|
)
|
79
89
|
"""
|
80
|
-
_response = self.
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
json={
|
89
|
-
"query": query,
|
90
|
-
"relevance": relevance,
|
91
|
-
},
|
92
|
-
headers={
|
93
|
-
"content-type": "application/json",
|
94
|
-
},
|
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,
|
95
98
|
request_options=request_options,
|
96
|
-
omit=OMIT,
|
97
99
|
)
|
98
|
-
|
99
|
-
if 200 <= _response.status_code < 300:
|
100
|
-
return typing.cast(
|
101
|
-
SearchResponse,
|
102
|
-
parse_obj_as(
|
103
|
-
type_=SearchResponse, # type: ignore
|
104
|
-
object_=_response.json(),
|
105
|
-
),
|
106
|
-
)
|
107
|
-
if _response.status_code == 400:
|
108
|
-
raise BadRequestError(
|
109
|
-
typing.cast(
|
110
|
-
typing.Optional[typing.Any],
|
111
|
-
parse_obj_as(
|
112
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
113
|
-
object_=_response.json(),
|
114
|
-
),
|
115
|
-
)
|
116
|
-
)
|
117
|
-
if _response.status_code == 401:
|
118
|
-
raise UnauthorizedError(
|
119
|
-
typing.cast(
|
120
|
-
typing.Optional[typing.Any],
|
121
|
-
parse_obj_as(
|
122
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
123
|
-
object_=_response.json(),
|
124
|
-
),
|
125
|
-
)
|
126
|
-
)
|
127
|
-
_response_json = _response.json()
|
128
|
-
except JSONDecodeError:
|
129
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
130
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
100
|
+
return _response.data
|
131
101
|
|
132
102
|
def documents(
|
133
103
|
self,
|
@@ -137,6 +107,7 @@ class SearchClient:
|
|
137
107
|
n: typing.Optional[int] = None,
|
138
108
|
next_token: typing.Optional[str] = None,
|
139
109
|
verbosity: typing.Optional[int] = None,
|
110
|
+
filter: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
|
140
111
|
relevance: typing.Optional[float] = OMIT,
|
141
112
|
request_options: typing.Optional[RequestOptions] = None,
|
142
113
|
) -> SearchResponse:
|
@@ -161,6 +132,9 @@ class SearchClient:
|
|
161
132
|
verbosity : typing.Optional[int]
|
162
133
|
The amount of data returned with each search result. 0 == no search results, only the recommended context. 1 == search results but no searchData. 2 == search results and searchData.
|
163
134
|
|
135
|
+
filter : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
|
136
|
+
A dictionary of key-value pairs that can be used to pre-filter documents prior to a search.
|
137
|
+
|
164
138
|
relevance : typing.Optional[float]
|
165
139
|
The minimum search relevance score required to include the result. By default, this is 10.0.
|
166
140
|
|
@@ -185,63 +159,33 @@ class SearchClient:
|
|
185
159
|
document_ids=["docUUID1", "docUUID2"],
|
186
160
|
)
|
187
161
|
"""
|
188
|
-
_response = self.
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
json={
|
197
|
-
"query": query,
|
198
|
-
"documentIds": document_ids,
|
199
|
-
"relevance": relevance,
|
200
|
-
},
|
201
|
-
headers={
|
202
|
-
"content-type": "application/json",
|
203
|
-
},
|
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,
|
204
170
|
request_options=request_options,
|
205
|
-
omit=OMIT,
|
206
171
|
)
|
207
|
-
|
208
|
-
if 200 <= _response.status_code < 300:
|
209
|
-
return typing.cast(
|
210
|
-
SearchResponse,
|
211
|
-
parse_obj_as(
|
212
|
-
type_=SearchResponse, # type: ignore
|
213
|
-
object_=_response.json(),
|
214
|
-
),
|
215
|
-
)
|
216
|
-
if _response.status_code == 400:
|
217
|
-
raise BadRequestError(
|
218
|
-
typing.cast(
|
219
|
-
typing.Optional[typing.Any],
|
220
|
-
parse_obj_as(
|
221
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
222
|
-
object_=_response.json(),
|
223
|
-
),
|
224
|
-
)
|
225
|
-
)
|
226
|
-
if _response.status_code == 401:
|
227
|
-
raise UnauthorizedError(
|
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
|
-
_response_json = _response.json()
|
237
|
-
except JSONDecodeError:
|
238
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
239
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
172
|
+
return _response.data
|
240
173
|
|
241
174
|
|
242
175
|
class AsyncSearchClient:
|
243
176
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
244
|
-
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
|
245
189
|
|
246
190
|
async def content(
|
247
191
|
self,
|
@@ -251,6 +195,7 @@ class AsyncSearchClient:
|
|
251
195
|
n: typing.Optional[int] = None,
|
252
196
|
next_token: typing.Optional[str] = None,
|
253
197
|
verbosity: typing.Optional[int] = None,
|
198
|
+
filter: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
|
254
199
|
relevance: typing.Optional[float] = OMIT,
|
255
200
|
request_options: typing.Optional[RequestOptions] = None,
|
256
201
|
) -> SearchResponse:
|
@@ -261,7 +206,7 @@ class AsyncSearchClient:
|
|
261
206
|
Parameters
|
262
207
|
----------
|
263
208
|
id : SearchContentRequestId
|
264
|
-
The bucketId, groupId,
|
209
|
+
The bucketId, groupId, or documentId to be searched. The document or documents within the specified container will be compared to the query, and relevant information will be extracted.
|
265
210
|
|
266
211
|
query : str
|
267
212
|
The search query to be used to find relevant documentation.
|
@@ -275,6 +220,9 @@ class AsyncSearchClient:
|
|
275
220
|
verbosity : typing.Optional[int]
|
276
221
|
The amount of data returned with each search result. 0 == no search results, only the recommended context. 1 == search results but no searchData. 2 == search results and searchData.
|
277
222
|
|
223
|
+
filter : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
|
224
|
+
A dictionary of key-value pairs that can be used to pre-filter documents prior to a search.
|
225
|
+
|
278
226
|
relevance : typing.Optional[float]
|
279
227
|
The minimum search relevance score required to include the result. By default, this is 10.0.
|
280
228
|
|
@@ -307,57 +255,17 @@ class AsyncSearchClient:
|
|
307
255
|
|
308
256
|
asyncio.run(main())
|
309
257
|
"""
|
310
|
-
_response = await self.
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
json={
|
319
|
-
"query": query,
|
320
|
-
"relevance": relevance,
|
321
|
-
},
|
322
|
-
headers={
|
323
|
-
"content-type": "application/json",
|
324
|
-
},
|
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,
|
325
266
|
request_options=request_options,
|
326
|
-
omit=OMIT,
|
327
267
|
)
|
328
|
-
|
329
|
-
if 200 <= _response.status_code < 300:
|
330
|
-
return typing.cast(
|
331
|
-
SearchResponse,
|
332
|
-
parse_obj_as(
|
333
|
-
type_=SearchResponse, # type: ignore
|
334
|
-
object_=_response.json(),
|
335
|
-
),
|
336
|
-
)
|
337
|
-
if _response.status_code == 400:
|
338
|
-
raise BadRequestError(
|
339
|
-
typing.cast(
|
340
|
-
typing.Optional[typing.Any],
|
341
|
-
parse_obj_as(
|
342
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
343
|
-
object_=_response.json(),
|
344
|
-
),
|
345
|
-
)
|
346
|
-
)
|
347
|
-
if _response.status_code == 401:
|
348
|
-
raise UnauthorizedError(
|
349
|
-
typing.cast(
|
350
|
-
typing.Optional[typing.Any],
|
351
|
-
parse_obj_as(
|
352
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
353
|
-
object_=_response.json(),
|
354
|
-
),
|
355
|
-
)
|
356
|
-
)
|
357
|
-
_response_json = _response.json()
|
358
|
-
except JSONDecodeError:
|
359
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
360
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
268
|
+
return _response.data
|
361
269
|
|
362
270
|
async def documents(
|
363
271
|
self,
|
@@ -367,6 +275,7 @@ class AsyncSearchClient:
|
|
367
275
|
n: typing.Optional[int] = None,
|
368
276
|
next_token: typing.Optional[str] = None,
|
369
277
|
verbosity: typing.Optional[int] = None,
|
278
|
+
filter: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
|
370
279
|
relevance: typing.Optional[float] = OMIT,
|
371
280
|
request_options: typing.Optional[RequestOptions] = None,
|
372
281
|
) -> SearchResponse:
|
@@ -391,6 +300,9 @@ class AsyncSearchClient:
|
|
391
300
|
verbosity : typing.Optional[int]
|
392
301
|
The amount of data returned with each search result. 0 == no search results, only the recommended context. 1 == search results but no searchData. 2 == search results and searchData.
|
393
302
|
|
303
|
+
filter : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
|
304
|
+
A dictionary of key-value pairs that can be used to pre-filter documents prior to a search.
|
305
|
+
|
394
306
|
relevance : typing.Optional[float]
|
395
307
|
The minimum search relevance score required to include the result. By default, this is 10.0.
|
396
308
|
|
@@ -423,55 +335,14 @@ class AsyncSearchClient:
|
|
423
335
|
|
424
336
|
asyncio.run(main())
|
425
337
|
"""
|
426
|
-
_response = await self.
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
json={
|
435
|
-
"query": query,
|
436
|
-
"documentIds": document_ids,
|
437
|
-
"relevance": relevance,
|
438
|
-
},
|
439
|
-
headers={
|
440
|
-
"content-type": "application/json",
|
441
|
-
},
|
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,
|
442
346
|
request_options=request_options,
|
443
|
-
omit=OMIT,
|
444
347
|
)
|
445
|
-
|
446
|
-
if 200 <= _response.status_code < 300:
|
447
|
-
return typing.cast(
|
448
|
-
SearchResponse,
|
449
|
-
parse_obj_as(
|
450
|
-
type_=SearchResponse, # type: ignore
|
451
|
-
object_=_response.json(),
|
452
|
-
),
|
453
|
-
)
|
454
|
-
if _response.status_code == 400:
|
455
|
-
raise BadRequestError(
|
456
|
-
typing.cast(
|
457
|
-
typing.Optional[typing.Any],
|
458
|
-
parse_obj_as(
|
459
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
460
|
-
object_=_response.json(),
|
461
|
-
),
|
462
|
-
)
|
463
|
-
)
|
464
|
-
if _response.status_code == 401:
|
465
|
-
raise UnauthorizedError(
|
466
|
-
typing.cast(
|
467
|
-
typing.Optional[typing.Any],
|
468
|
-
parse_obj_as(
|
469
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
470
|
-
object_=_response.json(),
|
471
|
-
),
|
472
|
-
)
|
473
|
-
)
|
474
|
-
_response_json = _response.json()
|
475
|
-
except JSONDecodeError:
|
476
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
477
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
348
|
+
return _response.data
|