groundx 2.0.11__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.
Files changed (80) hide show
  1. groundx/__init__.py +107 -0
  2. groundx/buckets/__init__.py +2 -0
  3. groundx/buckets/client.py +761 -0
  4. groundx/client.py +160 -0
  5. groundx/core/__init__.py +47 -0
  6. groundx/core/api_error.py +15 -0
  7. groundx/core/client_wrapper.py +54 -0
  8. groundx/core/datetime_utils.py +28 -0
  9. groundx/core/file.py +67 -0
  10. groundx/core/http_client.py +499 -0
  11. groundx/core/jsonable_encoder.py +101 -0
  12. groundx/core/pydantic_utilities.py +296 -0
  13. groundx/core/query_encoder.py +58 -0
  14. groundx/core/remove_none_from_dict.py +11 -0
  15. groundx/core/request_options.py +35 -0
  16. groundx/core/serialization.py +272 -0
  17. groundx/customer/__init__.py +2 -0
  18. groundx/customer/client.py +112 -0
  19. groundx/documents/__init__.py +5 -0
  20. groundx/documents/client.py +1544 -0
  21. groundx/documents/types/__init__.py +6 -0
  22. groundx/documents/types/document_remote_ingest_request_documents_item.py +45 -0
  23. groundx/documents/types/website_crawl_request_websites_item.py +46 -0
  24. groundx/environment.py +7 -0
  25. groundx/errors/__init__.py +6 -0
  26. groundx/errors/bad_request_error.py +9 -0
  27. groundx/errors/unauthorized_error.py +9 -0
  28. groundx/groups/__init__.py +2 -0
  29. groundx/groups/client.py +1098 -0
  30. groundx/health/__init__.py +2 -0
  31. groundx/health/client.py +236 -0
  32. groundx/py.typed +0 -0
  33. groundx/search/__init__.py +5 -0
  34. groundx/search/client.py +489 -0
  35. groundx/search/types/__init__.py +5 -0
  36. groundx/search/types/search_content_request_id.py +5 -0
  37. groundx/types/__init__.py +83 -0
  38. groundx/types/bounding_box_detail.py +54 -0
  39. groundx/types/bucket_detail.py +46 -0
  40. groundx/types/bucket_list_response.py +20 -0
  41. groundx/types/bucket_response.py +20 -0
  42. groundx/types/bucket_update_detail.py +22 -0
  43. groundx/types/bucket_update_response.py +20 -0
  44. groundx/types/customer_detail.py +39 -0
  45. groundx/types/customer_response.py +20 -0
  46. groundx/types/document_detail.py +62 -0
  47. groundx/types/document_list_response.py +23 -0
  48. groundx/types/document_lookup_response.py +32 -0
  49. groundx/types/document_response.py +20 -0
  50. groundx/types/document_type.py +7 -0
  51. groundx/types/group_detail.py +52 -0
  52. groundx/types/group_list_response.py +20 -0
  53. groundx/types/group_response.py +20 -0
  54. groundx/types/health_response.py +20 -0
  55. groundx/types/health_response_health.py +20 -0
  56. groundx/types/health_service.py +36 -0
  57. groundx/types/health_service_status.py +5 -0
  58. groundx/types/ingest_response.py +20 -0
  59. groundx/types/ingest_response_ingest.py +23 -0
  60. groundx/types/message_response.py +19 -0
  61. groundx/types/meter_detail.py +40 -0
  62. groundx/types/process_status_response.py +20 -0
  63. groundx/types/process_status_response_ingest.py +26 -0
  64. groundx/types/process_status_response_ingest_progress.py +26 -0
  65. groundx/types/process_status_response_ingest_progress_cancelled.py +21 -0
  66. groundx/types/process_status_response_ingest_progress_complete.py +21 -0
  67. groundx/types/process_status_response_ingest_progress_errors.py +21 -0
  68. groundx/types/process_status_response_ingest_progress_processing.py +21 -0
  69. groundx/types/processing_status.py +5 -0
  70. groundx/types/search_response.py +20 -0
  71. groundx/types/search_response_search.py +59 -0
  72. groundx/types/search_result_item.py +96 -0
  73. groundx/types/sort.py +5 -0
  74. groundx/types/sort_order.py +5 -0
  75. groundx/types/subscription_detail.py +24 -0
  76. groundx/types/subscription_detail_meters.py +23 -0
  77. groundx/version.py +3 -0
  78. groundx-2.0.11.dist-info/METADATA +177 -0
  79. groundx-2.0.11.dist-info/RECORD +80 -0
  80. groundx-2.0.11.dist-info/WHEEL +4 -0
@@ -0,0 +1,2 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
@@ -0,0 +1,236 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ from ..core.client_wrapper import SyncClientWrapper
4
+ import typing
5
+ from ..core.request_options import RequestOptions
6
+ from ..types.health_response import HealthResponse
7
+ from ..core.pydantic_utilities import parse_obj_as
8
+ from json.decoder import JSONDecodeError
9
+ from ..core.api_error import ApiError
10
+ from ..core.jsonable_encoder import jsonable_encoder
11
+ from ..errors.bad_request_error import BadRequestError
12
+ from ..core.client_wrapper import AsyncClientWrapper
13
+
14
+
15
+ class HealthClient:
16
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
17
+ self._client_wrapper = client_wrapper
18
+
19
+ def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> HealthResponse:
20
+ """
21
+ List the current health status of all services. Statuses update every 5 minutes.
22
+
23
+ Parameters
24
+ ----------
25
+ request_options : typing.Optional[RequestOptions]
26
+ Request-specific configuration.
27
+
28
+ Returns
29
+ -------
30
+ HealthResponse
31
+ Look up success
32
+
33
+ Examples
34
+ --------
35
+ from groundx import GroundX
36
+
37
+ client = GroundX(
38
+ api_key="YOUR_API_KEY",
39
+ )
40
+ client.health.list()
41
+ """
42
+ _response = self._client_wrapper.httpx_client.request(
43
+ "v1/health",
44
+ method="GET",
45
+ request_options=request_options,
46
+ )
47
+ try:
48
+ if 200 <= _response.status_code < 300:
49
+ return typing.cast(
50
+ HealthResponse,
51
+ parse_obj_as(
52
+ type_=HealthResponse, # type: ignore
53
+ object_=_response.json(),
54
+ ),
55
+ )
56
+ _response_json = _response.json()
57
+ except JSONDecodeError:
58
+ raise ApiError(status_code=_response.status_code, body=_response.text)
59
+ raise ApiError(status_code=_response.status_code, body=_response_json)
60
+
61
+ def get(self, service: str, *, request_options: typing.Optional[RequestOptions] = None) -> HealthResponse:
62
+ """
63
+ Look up the current health status of a specific service. Statuses update every 5 minutes.
64
+
65
+ Parameters
66
+ ----------
67
+ service : str
68
+ The name of the service to look up.
69
+
70
+ request_options : typing.Optional[RequestOptions]
71
+ Request-specific configuration.
72
+
73
+ Returns
74
+ -------
75
+ HealthResponse
76
+ Look up success
77
+
78
+ Examples
79
+ --------
80
+ from groundx import GroundX
81
+
82
+ client = GroundX(
83
+ api_key="YOUR_API_KEY",
84
+ )
85
+ client.health.get(
86
+ service="search",
87
+ )
88
+ """
89
+ _response = self._client_wrapper.httpx_client.request(
90
+ f"v1/health/{jsonable_encoder(service)}",
91
+ method="GET",
92
+ request_options=request_options,
93
+ )
94
+ try:
95
+ if 200 <= _response.status_code < 300:
96
+ return typing.cast(
97
+ HealthResponse,
98
+ parse_obj_as(
99
+ type_=HealthResponse, # type: ignore
100
+ object_=_response.json(),
101
+ ),
102
+ )
103
+ if _response.status_code == 400:
104
+ raise BadRequestError(
105
+ typing.cast(
106
+ typing.Optional[typing.Any],
107
+ parse_obj_as(
108
+ type_=typing.Optional[typing.Any], # type: ignore
109
+ object_=_response.json(),
110
+ ),
111
+ )
112
+ )
113
+ _response_json = _response.json()
114
+ except JSONDecodeError:
115
+ raise ApiError(status_code=_response.status_code, body=_response.text)
116
+ raise ApiError(status_code=_response.status_code, body=_response_json)
117
+
118
+
119
+ class AsyncHealthClient:
120
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
121
+ self._client_wrapper = client_wrapper
122
+
123
+ async def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> HealthResponse:
124
+ """
125
+ List the current health status of all services. Statuses update every 5 minutes.
126
+
127
+ Parameters
128
+ ----------
129
+ request_options : typing.Optional[RequestOptions]
130
+ Request-specific configuration.
131
+
132
+ Returns
133
+ -------
134
+ HealthResponse
135
+ Look up success
136
+
137
+ Examples
138
+ --------
139
+ import asyncio
140
+
141
+ from groundx import AsyncGroundX
142
+
143
+ client = AsyncGroundX(
144
+ api_key="YOUR_API_KEY",
145
+ )
146
+
147
+
148
+ async def main() -> None:
149
+ await client.health.list()
150
+
151
+
152
+ asyncio.run(main())
153
+ """
154
+ _response = await self._client_wrapper.httpx_client.request(
155
+ "v1/health",
156
+ method="GET",
157
+ request_options=request_options,
158
+ )
159
+ try:
160
+ if 200 <= _response.status_code < 300:
161
+ return typing.cast(
162
+ HealthResponse,
163
+ parse_obj_as(
164
+ type_=HealthResponse, # type: ignore
165
+ object_=_response.json(),
166
+ ),
167
+ )
168
+ _response_json = _response.json()
169
+ except JSONDecodeError:
170
+ raise ApiError(status_code=_response.status_code, body=_response.text)
171
+ raise ApiError(status_code=_response.status_code, body=_response_json)
172
+
173
+ async def get(self, service: str, *, request_options: typing.Optional[RequestOptions] = None) -> HealthResponse:
174
+ """
175
+ Look up the current health status of a specific service. Statuses update every 5 minutes.
176
+
177
+ Parameters
178
+ ----------
179
+ service : str
180
+ The name of the service to look up.
181
+
182
+ request_options : typing.Optional[RequestOptions]
183
+ Request-specific configuration.
184
+
185
+ Returns
186
+ -------
187
+ HealthResponse
188
+ Look up success
189
+
190
+ Examples
191
+ --------
192
+ import asyncio
193
+
194
+ from groundx import AsyncGroundX
195
+
196
+ client = AsyncGroundX(
197
+ api_key="YOUR_API_KEY",
198
+ )
199
+
200
+
201
+ async def main() -> None:
202
+ await client.health.get(
203
+ service="search",
204
+ )
205
+
206
+
207
+ asyncio.run(main())
208
+ """
209
+ _response = await self._client_wrapper.httpx_client.request(
210
+ f"v1/health/{jsonable_encoder(service)}",
211
+ method="GET",
212
+ request_options=request_options,
213
+ )
214
+ try:
215
+ if 200 <= _response.status_code < 300:
216
+ return typing.cast(
217
+ HealthResponse,
218
+ parse_obj_as(
219
+ type_=HealthResponse, # type: ignore
220
+ object_=_response.json(),
221
+ ),
222
+ )
223
+ if _response.status_code == 400:
224
+ raise BadRequestError(
225
+ typing.cast(
226
+ typing.Optional[typing.Any],
227
+ parse_obj_as(
228
+ type_=typing.Optional[typing.Any], # type: ignore
229
+ object_=_response.json(),
230
+ ),
231
+ )
232
+ )
233
+ _response_json = _response.json()
234
+ except JSONDecodeError:
235
+ raise ApiError(status_code=_response.status_code, body=_response.text)
236
+ raise ApiError(status_code=_response.status_code, body=_response_json)
groundx/py.typed ADDED
File without changes
@@ -0,0 +1,5 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ from .types import SearchContentRequestId
4
+
5
+ __all__ = ["SearchContentRequestId"]