groundx 2.9.2__tar.gz

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 (164) hide show
  1. groundx-2.9.2/LICENSE +21 -0
  2. groundx-2.9.2/PKG-INFO +205 -0
  3. groundx-2.9.2/README.md +155 -0
  4. groundx-2.9.2/pyproject.toml +149 -0
  5. groundx-2.9.2/src/groundx/__init__.py +161 -0
  6. groundx-2.9.2/src/groundx/buckets/__init__.py +4 -0
  7. groundx-2.9.2/src/groundx/buckets/client.py +428 -0
  8. groundx-2.9.2/src/groundx/buckets/raw_client.py +628 -0
  9. groundx-2.9.2/src/groundx/client.py +161 -0
  10. groundx-2.9.2/src/groundx/core/__init__.py +52 -0
  11. groundx-2.9.2/src/groundx/core/api_error.py +23 -0
  12. groundx-2.9.2/src/groundx/core/client_wrapper.py +55 -0
  13. groundx-2.9.2/src/groundx/core/datetime_utils.py +28 -0
  14. groundx-2.9.2/src/groundx/core/file.py +67 -0
  15. groundx-2.9.2/src/groundx/core/force_multipart.py +16 -0
  16. groundx-2.9.2/src/groundx/core/http_client.py +543 -0
  17. groundx-2.9.2/src/groundx/core/http_response.py +55 -0
  18. groundx-2.9.2/src/groundx/core/jsonable_encoder.py +100 -0
  19. groundx-2.9.2/src/groundx/core/pydantic_utilities.py +255 -0
  20. groundx-2.9.2/src/groundx/core/query_encoder.py +58 -0
  21. groundx-2.9.2/src/groundx/core/remove_none_from_dict.py +11 -0
  22. groundx-2.9.2/src/groundx/core/request_options.py +35 -0
  23. groundx-2.9.2/src/groundx/core/serialization.py +276 -0
  24. groundx-2.9.2/src/groundx/csv_splitter.py +64 -0
  25. groundx-2.9.2/src/groundx/customer/__init__.py +4 -0
  26. groundx-2.9.2/src/groundx/customer/client.py +100 -0
  27. groundx-2.9.2/src/groundx/customer/raw_client.py +91 -0
  28. groundx-2.9.2/src/groundx/documents/__init__.py +4 -0
  29. groundx-2.9.2/src/groundx/documents/client.py +1259 -0
  30. groundx-2.9.2/src/groundx/documents/raw_client.py +1690 -0
  31. groundx-2.9.2/src/groundx/environment.py +7 -0
  32. groundx-2.9.2/src/groundx/errors/__init__.py +8 -0
  33. groundx-2.9.2/src/groundx/errors/bad_request_error.py +10 -0
  34. groundx-2.9.2/src/groundx/errors/unauthorized_error.py +10 -0
  35. groundx-2.9.2/src/groundx/extract/__init__.py +56 -0
  36. groundx-2.9.2/src/groundx/extract/agents/__init__.py +7 -0
  37. groundx-2.9.2/src/groundx/extract/agents/agent.py +202 -0
  38. groundx-2.9.2/src/groundx/extract/classes/__init__.py +28 -0
  39. groundx-2.9.2/src/groundx/extract/classes/agent.py +23 -0
  40. groundx-2.9.2/src/groundx/extract/classes/api.py +15 -0
  41. groundx-2.9.2/src/groundx/extract/classes/document.py +358 -0
  42. groundx-2.9.2/src/groundx/extract/classes/element.py +8 -0
  43. groundx-2.9.2/src/groundx/extract/classes/field.py +171 -0
  44. groundx-2.9.2/src/groundx/extract/classes/groundx.py +147 -0
  45. groundx-2.9.2/src/groundx/extract/classes/group.py +152 -0
  46. groundx-2.9.2/src/groundx/extract/classes/prompt.py +49 -0
  47. groundx-2.9.2/src/groundx/extract/classes/test_document.py +117 -0
  48. groundx-2.9.2/src/groundx/extract/classes/test_field.py +57 -0
  49. groundx-2.9.2/src/groundx/extract/classes/test_groundx.py +223 -0
  50. groundx-2.9.2/src/groundx/extract/classes/test_group.py +91 -0
  51. groundx-2.9.2/src/groundx/extract/classes/test_prompt.py +69 -0
  52. groundx-2.9.2/src/groundx/extract/post_process/__init__.py +7 -0
  53. groundx-2.9.2/src/groundx/extract/post_process/post_process.py +33 -0
  54. groundx-2.9.2/src/groundx/extract/prompt/__init__.py +9 -0
  55. groundx-2.9.2/src/groundx/extract/prompt/manager.py +245 -0
  56. groundx-2.9.2/src/groundx/extract/prompt/object_store.py +46 -0
  57. groundx-2.9.2/src/groundx/extract/prompt/source.py +62 -0
  58. groundx-2.9.2/src/groundx/extract/prompt/test_manager.py +613 -0
  59. groundx-2.9.2/src/groundx/extract/prompt/utility.py +104 -0
  60. groundx-2.9.2/src/groundx/extract/services/.DS_Store +0 -0
  61. groundx-2.9.2/src/groundx/extract/services/__init__.py +14 -0
  62. groundx-2.9.2/src/groundx/extract/services/csv.py +76 -0
  63. groundx-2.9.2/src/groundx/extract/services/logger.py +126 -0
  64. groundx-2.9.2/src/groundx/extract/services/logging_cfg.py +53 -0
  65. groundx-2.9.2/src/groundx/extract/services/ratelimit.py +104 -0
  66. groundx-2.9.2/src/groundx/extract/services/sheets_client.py +160 -0
  67. groundx-2.9.2/src/groundx/extract/services/status.py +200 -0
  68. groundx-2.9.2/src/groundx/extract/services/upload.py +82 -0
  69. groundx-2.9.2/src/groundx/extract/services/upload_minio.py +173 -0
  70. groundx-2.9.2/src/groundx/extract/services/upload_s3.py +137 -0
  71. groundx-2.9.2/src/groundx/extract/services/utility.py +52 -0
  72. groundx-2.9.2/src/groundx/extract/settings/__init__.py +15 -0
  73. groundx-2.9.2/src/groundx/extract/settings/settings.py +213 -0
  74. groundx-2.9.2/src/groundx/extract/settings/test_settings.py +516 -0
  75. groundx-2.9.2/src/groundx/extract/tasks/__init__.py +6 -0
  76. groundx-2.9.2/src/groundx/extract/tasks/utility.py +27 -0
  77. groundx-2.9.2/src/groundx/extract/utility/__init__.py +11 -0
  78. groundx-2.9.2/src/groundx/extract/utility/test_utility.py +39 -0
  79. groundx-2.9.2/src/groundx/extract/utility/utility.py +155 -0
  80. groundx-2.9.2/src/groundx/groups/__init__.py +4 -0
  81. groundx-2.9.2/src/groundx/groups/client.py +611 -0
  82. groundx-2.9.2/src/groundx/groups/raw_client.py +901 -0
  83. groundx-2.9.2/src/groundx/health/__init__.py +4 -0
  84. groundx-2.9.2/src/groundx/health/client.py +170 -0
  85. groundx-2.9.2/src/groundx/health/raw_client.py +193 -0
  86. groundx-2.9.2/src/groundx/ingest.py +784 -0
  87. groundx-2.9.2/src/groundx/py.typed +0 -0
  88. groundx-2.9.2/src/groundx/search/__init__.py +7 -0
  89. groundx-2.9.2/src/groundx/search/client.py +356 -0
  90. groundx-2.9.2/src/groundx/search/raw_client.py +442 -0
  91. groundx-2.9.2/src/groundx/search/types/__init__.py +7 -0
  92. groundx-2.9.2/src/groundx/search/types/search_content_request_id.py +5 -0
  93. groundx-2.9.2/src/groundx/types/__init__.py +137 -0
  94. groundx-2.9.2/src/groundx/types/bounding_box_detail.py +54 -0
  95. groundx-2.9.2/src/groundx/types/bucket_detail.py +46 -0
  96. groundx-2.9.2/src/groundx/types/bucket_list_response.py +34 -0
  97. groundx-2.9.2/src/groundx/types/bucket_response.py +20 -0
  98. groundx-2.9.2/src/groundx/types/bucket_update_detail.py +22 -0
  99. groundx-2.9.2/src/groundx/types/bucket_update_response.py +20 -0
  100. groundx-2.9.2/src/groundx/types/customer_detail.py +39 -0
  101. groundx-2.9.2/src/groundx/types/customer_response.py +20 -0
  102. groundx-2.9.2/src/groundx/types/document.py +54 -0
  103. groundx-2.9.2/src/groundx/types/document_detail.py +78 -0
  104. groundx-2.9.2/src/groundx/types/document_list_response.py +23 -0
  105. groundx-2.9.2/src/groundx/types/document_local_ingest_request.py +7 -0
  106. groundx-2.9.2/src/groundx/types/document_lookup_response.py +37 -0
  107. groundx-2.9.2/src/groundx/types/document_response.py +20 -0
  108. groundx-2.9.2/src/groundx/types/document_type.py +27 -0
  109. groundx-2.9.2/src/groundx/types/group_detail.py +52 -0
  110. groundx-2.9.2/src/groundx/types/group_list_response.py +34 -0
  111. groundx-2.9.2/src/groundx/types/group_response.py +20 -0
  112. groundx-2.9.2/src/groundx/types/health_response.py +20 -0
  113. groundx-2.9.2/src/groundx/types/health_response_health.py +20 -0
  114. groundx-2.9.2/src/groundx/types/health_service.py +36 -0
  115. groundx-2.9.2/src/groundx/types/health_service_status.py +5 -0
  116. groundx-2.9.2/src/groundx/types/ingest_local_document.py +25 -0
  117. groundx-2.9.2/src/groundx/types/ingest_local_document_metadata.py +51 -0
  118. groundx-2.9.2/src/groundx/types/ingest_remote_document.py +54 -0
  119. groundx-2.9.2/src/groundx/types/ingest_response.py +20 -0
  120. groundx-2.9.2/src/groundx/types/ingest_status.py +27 -0
  121. groundx-2.9.2/src/groundx/types/ingest_status_light.py +25 -0
  122. groundx-2.9.2/src/groundx/types/ingest_status_progress.py +26 -0
  123. groundx-2.9.2/src/groundx/types/ingest_status_progress_cancelled.py +21 -0
  124. groundx-2.9.2/src/groundx/types/ingest_status_progress_complete.py +21 -0
  125. groundx-2.9.2/src/groundx/types/ingest_status_progress_errors.py +21 -0
  126. groundx-2.9.2/src/groundx/types/ingest_status_progress_processing.py +21 -0
  127. groundx-2.9.2/src/groundx/types/message_response.py +19 -0
  128. groundx-2.9.2/src/groundx/types/meter_detail.py +40 -0
  129. groundx-2.9.2/src/groundx/types/process_level.py +5 -0
  130. groundx-2.9.2/src/groundx/types/processes_status_response.py +23 -0
  131. groundx-2.9.2/src/groundx/types/processing_status.py +7 -0
  132. groundx-2.9.2/src/groundx/types/search_response.py +20 -0
  133. groundx-2.9.2/src/groundx/types/search_response_search.py +59 -0
  134. groundx-2.9.2/src/groundx/types/search_result_item.py +98 -0
  135. groundx-2.9.2/src/groundx/types/search_result_item_pages_item.py +41 -0
  136. groundx-2.9.2/src/groundx/types/sort.py +5 -0
  137. groundx-2.9.2/src/groundx/types/sort_order.py +5 -0
  138. groundx-2.9.2/src/groundx/types/subscription_detail.py +24 -0
  139. groundx-2.9.2/src/groundx/types/subscription_detail_meters.py +23 -0
  140. groundx-2.9.2/src/groundx/types/website_source.py +46 -0
  141. groundx-2.9.2/src/groundx/types/workflow_apply_request.py +24 -0
  142. groundx-2.9.2/src/groundx/types/workflow_detail.py +64 -0
  143. groundx-2.9.2/src/groundx/types/workflow_detail_chunk_strategy.py +5 -0
  144. groundx-2.9.2/src/groundx/types/workflow_detail_relationships.py +36 -0
  145. groundx-2.9.2/src/groundx/types/workflow_engine.py +58 -0
  146. groundx-2.9.2/src/groundx/types/workflow_engine_reasoning_effort.py +5 -0
  147. groundx-2.9.2/src/groundx/types/workflow_engine_service.py +7 -0
  148. groundx-2.9.2/src/groundx/types/workflow_prompt.py +37 -0
  149. groundx-2.9.2/src/groundx/types/workflow_prompt_group.py +25 -0
  150. groundx-2.9.2/src/groundx/types/workflow_prompt_role.py +5 -0
  151. groundx-2.9.2/src/groundx/types/workflow_request.py +36 -0
  152. groundx-2.9.2/src/groundx/types/workflow_request_chunk_strategy.py +5 -0
  153. groundx-2.9.2/src/groundx/types/workflow_response.py +20 -0
  154. groundx-2.9.2/src/groundx/types/workflow_step.py +33 -0
  155. groundx-2.9.2/src/groundx/types/workflow_step_config.py +33 -0
  156. groundx-2.9.2/src/groundx/types/workflow_step_config_field.py +8 -0
  157. groundx-2.9.2/src/groundx/types/workflow_steps.py +38 -0
  158. groundx-2.9.2/src/groundx/types/workflows_response.py +20 -0
  159. groundx-2.9.2/src/groundx/version.py +3 -0
  160. groundx-2.9.2/src/groundx/workflows/__init__.py +7 -0
  161. groundx-2.9.2/src/groundx/workflows/client.py +812 -0
  162. groundx-2.9.2/src/groundx/workflows/raw_client.py +931 -0
  163. groundx-2.9.2/src/groundx/workflows/types/__init__.py +7 -0
  164. groundx-2.9.2/src/groundx/workflows/types/workflows_get_request_id.py +5 -0
groundx-2.9.2/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Eyelevel.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
groundx-2.9.2/PKG-INFO ADDED
@@ -0,0 +1,205 @@
1
+ Metadata-Version: 2.1
2
+ Name: groundx
3
+ Version: 2.9.2
4
+ Summary:
5
+ License: MIT
6
+ Requires-Python: >=3.8,<4.0
7
+ Classifier: Intended Audience :: Developers
8
+ Classifier: License :: OSI Approved :: MIT License
9
+ Classifier: Operating System :: MacOS
10
+ Classifier: Operating System :: Microsoft :: Windows
11
+ Classifier: Operating System :: OS Independent
12
+ Classifier: Operating System :: POSIX
13
+ Classifier: Operating System :: POSIX :: Linux
14
+ Classifier: Programming Language :: Python
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.8
17
+ Classifier: Programming Language :: Python :: 3.9
18
+ Classifier: Programming Language :: Python :: 3.10
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
22
+ Classifier: Typing :: Typed
23
+ Provides-Extra: extract
24
+ Requires-Dist: aiohttp (>=3.8.0)
25
+ Requires-Dist: boto3 ; extra == "extract"
26
+ Requires-Dist: celery ; extra == "extract"
27
+ Requires-Dist: celery-types ; extra == "extract"
28
+ Requires-Dist: dateparser ; extra == "extract"
29
+ Requires-Dist: fastapi ; extra == "extract"
30
+ Requires-Dist: google-api-python-client ; extra == "extract"
31
+ Requires-Dist: google-api-python-client-stubs ; extra == "extract"
32
+ Requires-Dist: google-auth-stubs ; extra == "extract"
33
+ Requires-Dist: gspread ; extra == "extract"
34
+ Requires-Dist: httpx (>=0.21.2)
35
+ Requires-Dist: minio ; extra == "extract"
36
+ Requires-Dist: pillow ; extra == "extract"
37
+ Requires-Dist: pydantic (>=1.9.2)
38
+ Requires-Dist: pydantic-core (>=2.18.2,<3.0.0)
39
+ Requires-Dist: pytest ; extra == "extract"
40
+ Requires-Dist: redis ; extra == "extract"
41
+ Requires-Dist: requests (>=2.4.0)
42
+ Requires-Dist: tqdm (>=4.60.0)
43
+ Requires-Dist: types-PyYAML ; extra == "extract"
44
+ Requires-Dist: types-boto3 ; extra == "extract"
45
+ Requires-Dist: types-dateparser ; extra == "extract"
46
+ Requires-Dist: types-tqdm (>=4.60.0)
47
+ Requires-Dist: typing_extensions (>=4.0.0)
48
+ Description-Content-Type: text/markdown
49
+
50
+ # GroundX Python Library
51
+
52
+ [![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2Feyelevelai%2Fgroundx-python)
53
+ [![pypi](https://img.shields.io/pypi/v/groundx)](https://pypi.python.org/pypi/groundx)
54
+
55
+ The GroundX Python library provides convenient access to the GroundX API from Python.
56
+
57
+ ## Documentation
58
+
59
+ API reference documentation is available [here](https://docs.eyelevel.ai/reference).
60
+
61
+ ## Installation
62
+
63
+ ```sh
64
+ pip install groundx
65
+ ```
66
+
67
+ ## Reference
68
+
69
+ A full reference for this library is available [here](https://github.com/eyelevelai/groundx-python/blob/main/reference.md).
70
+
71
+ ## Usage
72
+
73
+ Instantiate and use the client with the following:
74
+
75
+ ```python
76
+ from groundx import Document, GroundX
77
+
78
+ client = GroundX(
79
+ api_key="YOUR_API_KEY",
80
+ )
81
+
82
+ client.ingest(
83
+ documents=[
84
+ Document(
85
+ bucket_id=1234,
86
+ file_name="my_file1.txt",
87
+ file_type="txt",
88
+ source_url="https://my.source.url.com/file1.txt",
89
+ )
90
+ ],
91
+ )
92
+ ```
93
+
94
+ ## Async Client
95
+
96
+ The SDK also exports an `async` client so that you can make non-blocking calls to our API.
97
+
98
+ ```python
99
+ import asyncio
100
+
101
+ from groundx import AsyncGroundX, Document
102
+
103
+ client = AsyncGroundX(
104
+ api_key="YOUR_API_KEY",
105
+ )
106
+
107
+ async def main() -> None:
108
+ await client.ingest(
109
+ documents=[
110
+ Document(
111
+ bucket_id=1234,
112
+ file_name="my_file1.txt",
113
+ file_type="txt",
114
+ source_url="https://my.source.url.com/file1.txt",
115
+ )
116
+ ],
117
+ )
118
+
119
+ asyncio.run(main())
120
+ ```
121
+
122
+ ## Exception Handling
123
+
124
+ When the API returns a non-success status code (4xx or 5xx response), a subclass of the following error
125
+ will be thrown.
126
+
127
+ ```python
128
+ from groundx.core.api_error import ApiError
129
+
130
+ try:
131
+ client.ingest(...)
132
+ except ApiError as e:
133
+ print(e.status_code)
134
+ print(e.body)
135
+ ```
136
+
137
+ ## Advanced
138
+
139
+ ### Retries
140
+
141
+ The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long
142
+ as the request is deemed retriable and the number of retry attempts has not grown larger than the configured
143
+ retry limit (default: 2).
144
+
145
+ A request is deemed retriable when any of the following HTTP status codes is returned:
146
+
147
+ - [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
148
+ - [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
149
+ - [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500) (Internal Server Errors)
150
+
151
+ Use the `max_retries` request option to configure this behavior.
152
+
153
+ ```python
154
+ client.ingest(..., request_options={
155
+ "max_retries": 1
156
+ })
157
+ ```
158
+
159
+ ### Timeouts
160
+
161
+ The SDK defaults to a 60 second timeout. You can configure this with a timeout option at the client or request level.
162
+
163
+ ```python
164
+
165
+ from groundx import GroundX
166
+
167
+ client = GroundX(
168
+ ...,
169
+ timeout=20.0,
170
+ )
171
+
172
+
173
+ # Override timeout for a specific method
174
+ client.ingest(..., request_options={
175
+ "timeout_in_seconds": 1
176
+ })
177
+ ```
178
+
179
+ ### Custom Client
180
+
181
+ You can override the `httpx` client to customize it for your use-case. Some common use-cases include support for proxies
182
+ and transports.
183
+ ```python
184
+ import httpx
185
+ from groundx import GroundX
186
+
187
+ client = GroundX(
188
+ ...,
189
+ httpx_client=httpx.Client(
190
+ proxies="http://my.test.proxy.example.com",
191
+ transport=httpx.HTTPTransport(local_address="0.0.0.0"),
192
+ ),
193
+ )
194
+ ```
195
+
196
+ ## Contributing
197
+
198
+ While we value open-source contributions to this SDK, this library is generated programmatically.
199
+ Additions made directly to this library would have to be moved over to our generation code,
200
+ otherwise they would be overwritten upon the next generated release. Feel free to open a PR as
201
+ a proof of concept, but know that we will not be able to merge it as-is. We suggest opening
202
+ an issue first to discuss with us!
203
+
204
+ On the other hand, contributions to the README are always very welcome!
205
+
@@ -0,0 +1,155 @@
1
+ # GroundX Python Library
2
+
3
+ [![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2Feyelevelai%2Fgroundx-python)
4
+ [![pypi](https://img.shields.io/pypi/v/groundx)](https://pypi.python.org/pypi/groundx)
5
+
6
+ The GroundX Python library provides convenient access to the GroundX API from Python.
7
+
8
+ ## Documentation
9
+
10
+ API reference documentation is available [here](https://docs.eyelevel.ai/reference).
11
+
12
+ ## Installation
13
+
14
+ ```sh
15
+ pip install groundx
16
+ ```
17
+
18
+ ## Reference
19
+
20
+ A full reference for this library is available [here](https://github.com/eyelevelai/groundx-python/blob/main/reference.md).
21
+
22
+ ## Usage
23
+
24
+ Instantiate and use the client with the following:
25
+
26
+ ```python
27
+ from groundx import Document, GroundX
28
+
29
+ client = GroundX(
30
+ api_key="YOUR_API_KEY",
31
+ )
32
+
33
+ client.ingest(
34
+ documents=[
35
+ Document(
36
+ bucket_id=1234,
37
+ file_name="my_file1.txt",
38
+ file_type="txt",
39
+ source_url="https://my.source.url.com/file1.txt",
40
+ )
41
+ ],
42
+ )
43
+ ```
44
+
45
+ ## Async Client
46
+
47
+ The SDK also exports an `async` client so that you can make non-blocking calls to our API.
48
+
49
+ ```python
50
+ import asyncio
51
+
52
+ from groundx import AsyncGroundX, Document
53
+
54
+ client = AsyncGroundX(
55
+ api_key="YOUR_API_KEY",
56
+ )
57
+
58
+ async def main() -> None:
59
+ await client.ingest(
60
+ documents=[
61
+ Document(
62
+ bucket_id=1234,
63
+ file_name="my_file1.txt",
64
+ file_type="txt",
65
+ source_url="https://my.source.url.com/file1.txt",
66
+ )
67
+ ],
68
+ )
69
+
70
+ asyncio.run(main())
71
+ ```
72
+
73
+ ## Exception Handling
74
+
75
+ When the API returns a non-success status code (4xx or 5xx response), a subclass of the following error
76
+ will be thrown.
77
+
78
+ ```python
79
+ from groundx.core.api_error import ApiError
80
+
81
+ try:
82
+ client.ingest(...)
83
+ except ApiError as e:
84
+ print(e.status_code)
85
+ print(e.body)
86
+ ```
87
+
88
+ ## Advanced
89
+
90
+ ### Retries
91
+
92
+ The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long
93
+ as the request is deemed retriable and the number of retry attempts has not grown larger than the configured
94
+ retry limit (default: 2).
95
+
96
+ A request is deemed retriable when any of the following HTTP status codes is returned:
97
+
98
+ - [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
99
+ - [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
100
+ - [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500) (Internal Server Errors)
101
+
102
+ Use the `max_retries` request option to configure this behavior.
103
+
104
+ ```python
105
+ client.ingest(..., request_options={
106
+ "max_retries": 1
107
+ })
108
+ ```
109
+
110
+ ### Timeouts
111
+
112
+ The SDK defaults to a 60 second timeout. You can configure this with a timeout option at the client or request level.
113
+
114
+ ```python
115
+
116
+ from groundx import GroundX
117
+
118
+ client = GroundX(
119
+ ...,
120
+ timeout=20.0,
121
+ )
122
+
123
+
124
+ # Override timeout for a specific method
125
+ client.ingest(..., request_options={
126
+ "timeout_in_seconds": 1
127
+ })
128
+ ```
129
+
130
+ ### Custom Client
131
+
132
+ You can override the `httpx` client to customize it for your use-case. Some common use-cases include support for proxies
133
+ and transports.
134
+ ```python
135
+ import httpx
136
+ from groundx import GroundX
137
+
138
+ client = GroundX(
139
+ ...,
140
+ httpx_client=httpx.Client(
141
+ proxies="http://my.test.proxy.example.com",
142
+ transport=httpx.HTTPTransport(local_address="0.0.0.0"),
143
+ ),
144
+ )
145
+ ```
146
+
147
+ ## Contributing
148
+
149
+ While we value open-source contributions to this SDK, this library is generated programmatically.
150
+ Additions made directly to this library would have to be moved over to our generation code,
151
+ otherwise they would be overwritten upon the next generated release. Feel free to open a PR as
152
+ a proof of concept, but know that we will not be able to merge it as-is. We suggest opening
153
+ an issue first to discuss with us!
154
+
155
+ On the other hand, contributions to the README are always very welcome!
@@ -0,0 +1,149 @@
1
+ [project]
2
+ name = "groundx"
3
+
4
+ [tool.poetry]
5
+ name = "groundx"
6
+ version = "2.9.2"
7
+ description = ""
8
+ readme = "README.md"
9
+ authors = []
10
+ keywords = []
11
+ license = "MIT"
12
+ classifiers = [
13
+ "Intended Audience :: Developers",
14
+ "Programming Language :: Python",
15
+ "Programming Language :: Python :: 3",
16
+ "Programming Language :: Python :: 3.8",
17
+ "Programming Language :: Python :: 3.9",
18
+ "Programming Language :: Python :: 3.10",
19
+ "Programming Language :: Python :: 3.11",
20
+ "Programming Language :: Python :: 3.12",
21
+ "Operating System :: OS Independent",
22
+ "Operating System :: POSIX",
23
+ "Operating System :: MacOS",
24
+ "Operating System :: POSIX :: Linux",
25
+ "Operating System :: Microsoft :: Windows",
26
+ "Topic :: Software Development :: Libraries :: Python Modules",
27
+ "Typing :: Typed",
28
+ "License :: OSI Approved :: MIT License"
29
+ ]
30
+ packages = [
31
+ { include = "groundx", from = "src"}
32
+ ]
33
+
34
+ [project.urls]
35
+ Repository = 'https://github.com/eyelevelai/groundx-python'
36
+
37
+ [tool.poetry.dependencies]
38
+ python = "^3.8"
39
+ aiohttp = ">=3.8.0"
40
+ boto3 = { version = "*", optional = true}
41
+ celery = { version = "*", optional = true}
42
+ celery-types = { version = "*", optional = true}
43
+ dateparser = { version = "*", optional = true}
44
+ fastapi = { version = "*", optional = true}
45
+ google-api-python-client = { version = "*", optional = true}
46
+ google-api-python-client-stubs = { version = "*", optional = true}
47
+ google-auth-stubs = { version = "*", optional = true}
48
+ gspread = { version = "*", optional = true}
49
+ httpx = ">=0.21.2"
50
+ minio = { version = "*", optional = true}
51
+ pillow = { version = "*", optional = true}
52
+ pydantic = ">= 1.9.2"
53
+ pydantic-core = "^2.18.2"
54
+ pytest = { version = "*", optional = true}
55
+ redis = { version = "*", optional = true}
56
+ requests = ">=2.4.0"
57
+ tqdm = ">=4.60.0"
58
+ types-PyYAML = { version = "*", optional = true}
59
+ types-boto3 = { version = "*", optional = true}
60
+ types-dateparser = { version = "*", optional = true}
61
+ types-tqdm = ">=4.60.0"
62
+ typing_extensions = ">= 4.0.0"
63
+
64
+ [tool.poetry.group.dev.dependencies]
65
+ mypy = "==1.13.0"
66
+ pytest = "^7.4.0"
67
+ pytest-asyncio = "^0.23.5"
68
+ python-dateutil = "^2.9.0"
69
+ types-python-dateutil = "^2.9.0.20240316"
70
+ ruff = "==0.11.5"
71
+ types-requests = ">=2.0.0"
72
+
73
+ [tool.pytest.ini_options]
74
+ testpaths = [ "tests" ]
75
+ asyncio_mode = "auto"
76
+
77
+ [tool.mypy]
78
+ plugins = ["pydantic.mypy"]
79
+
80
+ [tool.ruff]
81
+ line-length = 120
82
+
83
+ [tool.ruff.lint]
84
+ select = [
85
+ "E", # pycodestyle errors
86
+ "F", # pyflakes
87
+ "I", # isort
88
+ ]
89
+ ignore = [
90
+ "E402", # Module level import not at top of file
91
+ "E501", # Line too long
92
+ "E711", # Comparison to `None` should be `cond is not None`
93
+ "E712", # Avoid equality comparisons to `True`; use `if ...:` checks
94
+ "E721", # Use `is` and `is not` for type comparisons, or `isinstance()` for insinstance checks
95
+ "E722", # Do not use bare `except`
96
+ "E731", # Do not assign a `lambda` expression, use a `def`
97
+ "F821", # Undefined name
98
+ "F841" # Local variable ... is assigned to but never used
99
+ ]
100
+
101
+ [tool.ruff.lint.isort]
102
+ section-order = ["future", "standard-library", "third-party", "first-party"]
103
+
104
+ [build-system]
105
+ requires = ["poetry-core"]
106
+ build-backend = "poetry.core.masonry.api"
107
+
108
+ [tool.poetry.extras]
109
+ extract=["boto3", "celery", "celery-types", "dateparser", "fastapi", "google-api-python-client", "google-api-python-client-stubs", "google-auth-stubs", "gspread", "minio", "pillow", "pytest", "redis", "types-boto3", "types-dateparser", "types-PyYAML"]
110
+
111
+ [[tool.mypy.overrides]]
112
+ module = ["dateparser.*"]
113
+ ignore_missing_imports = true
114
+
115
+ [[tool.mypy.overrides]]
116
+ module = ["boto3.*", "botocore.*"]
117
+ ignore_missing_imports = true
118
+
119
+ [[tool.mypy.overrides]]
120
+ module = ["fastapi.*", "starlette.*", "redis.*"]
121
+ ignore_missing_imports = true
122
+
123
+ [[tool.mypy.overrides]]
124
+ module = ["google.*", "googleapiclient.*", "gspread.*"]
125
+ ignore_missing_imports = true
126
+
127
+ [[tool.mypy.overrides]]
128
+ module = ["minio.*"]
129
+ ignore_missing_imports = true
130
+
131
+ [[tool.mypy.overrides]]
132
+ module = ["PIL.*"]
133
+ ignore_missing_imports = true
134
+
135
+ [[tool.mypy.overrides]]
136
+ module = ["smolagents.*"]
137
+ ignore_missing_imports = true
138
+
139
+ [[tool.mypy.overrides]]
140
+ module = ["yaml.*"]
141
+ ignore_missing_imports = true
142
+
143
+ [[tool.mypy.overrides]]
144
+ module = ["groundx.extract.classes.document"]
145
+ disable_error_code = ["call-arg"]
146
+
147
+ [[tool.mypy.overrides]]
148
+ module = ["groundx.extract.tasks.utility"]
149
+ disable_error_code = ["call-arg"]
@@ -0,0 +1,161 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ # isort: skip_file
4
+
5
+ from .types import (
6
+ BoundingBoxDetail,
7
+ BucketDetail,
8
+ BucketListResponse,
9
+ BucketResponse,
10
+ BucketUpdateDetail,
11
+ BucketUpdateResponse,
12
+ CustomerDetail,
13
+ CustomerResponse,
14
+ Document,
15
+ DocumentDetail,
16
+ DocumentListResponse,
17
+ DocumentLocalIngestRequest,
18
+ DocumentLookupResponse,
19
+ DocumentResponse,
20
+ DocumentType,
21
+ GroupDetail,
22
+ GroupListResponse,
23
+ GroupResponse,
24
+ HealthResponse,
25
+ HealthResponseHealth,
26
+ HealthService,
27
+ HealthServiceStatus,
28
+ IngestLocalDocument,
29
+ IngestLocalDocumentMetadata,
30
+ IngestRemoteDocument,
31
+ IngestResponse,
32
+ IngestStatus,
33
+ IngestStatusLight,
34
+ IngestStatusProgress,
35
+ IngestStatusProgressCancelled,
36
+ IngestStatusProgressComplete,
37
+ IngestStatusProgressErrors,
38
+ IngestStatusProgressProcessing,
39
+ MessageResponse,
40
+ MeterDetail,
41
+ ProcessLevel,
42
+ ProcessesStatusResponse,
43
+ ProcessingStatus,
44
+ SearchResponse,
45
+ SearchResponseSearch,
46
+ SearchResultItem,
47
+ SearchResultItemPagesItem,
48
+ Sort,
49
+ SortOrder,
50
+ SubscriptionDetail,
51
+ SubscriptionDetailMeters,
52
+ WebsiteSource,
53
+ WorkflowApplyRequest,
54
+ WorkflowDetail,
55
+ WorkflowDetailChunkStrategy,
56
+ WorkflowDetailRelationships,
57
+ WorkflowEngine,
58
+ WorkflowEngineReasoningEffort,
59
+ WorkflowEngineService,
60
+ WorkflowPrompt,
61
+ WorkflowPromptGroup,
62
+ WorkflowPromptRole,
63
+ WorkflowRequest,
64
+ WorkflowRequestChunkStrategy,
65
+ WorkflowResponse,
66
+ WorkflowStep,
67
+ WorkflowStepConfig,
68
+ WorkflowStepConfigField,
69
+ WorkflowSteps,
70
+ WorkflowsResponse,
71
+ )
72
+ from .errors import BadRequestError, UnauthorizedError
73
+ from . import buckets, customer, documents, groups, health, search, workflows
74
+ from .environment import GroundXEnvironment
75
+ from .ingest import AsyncGroundX, GroundX
76
+ from .search import SearchContentRequestId
77
+ from .version import __version__
78
+ from .workflows import WorkflowsGetRequestId
79
+
80
+ __all__ = [
81
+ "AsyncGroundX",
82
+ "BadRequestError",
83
+ "BoundingBoxDetail",
84
+ "BucketDetail",
85
+ "BucketListResponse",
86
+ "BucketResponse",
87
+ "BucketUpdateDetail",
88
+ "BucketUpdateResponse",
89
+ "CustomerDetail",
90
+ "CustomerResponse",
91
+ "Document",
92
+ "DocumentDetail",
93
+ "DocumentListResponse",
94
+ "DocumentLocalIngestRequest",
95
+ "DocumentLookupResponse",
96
+ "DocumentResponse",
97
+ "DocumentType",
98
+ "GroundX",
99
+ "GroundXEnvironment",
100
+ "GroupDetail",
101
+ "GroupListResponse",
102
+ "GroupResponse",
103
+ "HealthResponse",
104
+ "HealthResponseHealth",
105
+ "HealthService",
106
+ "HealthServiceStatus",
107
+ "IngestLocalDocument",
108
+ "IngestLocalDocumentMetadata",
109
+ "IngestRemoteDocument",
110
+ "IngestResponse",
111
+ "IngestStatus",
112
+ "IngestStatusLight",
113
+ "IngestStatusProgress",
114
+ "IngestStatusProgressCancelled",
115
+ "IngestStatusProgressComplete",
116
+ "IngestStatusProgressErrors",
117
+ "IngestStatusProgressProcessing",
118
+ "MessageResponse",
119
+ "MeterDetail",
120
+ "ProcessLevel",
121
+ "ProcessesStatusResponse",
122
+ "ProcessingStatus",
123
+ "SearchContentRequestId",
124
+ "SearchResponse",
125
+ "SearchResponseSearch",
126
+ "SearchResultItem",
127
+ "SearchResultItemPagesItem",
128
+ "Sort",
129
+ "SortOrder",
130
+ "SubscriptionDetail",
131
+ "SubscriptionDetailMeters",
132
+ "UnauthorizedError",
133
+ "WebsiteSource",
134
+ "WorkflowApplyRequest",
135
+ "WorkflowDetail",
136
+ "WorkflowDetailChunkStrategy",
137
+ "WorkflowDetailRelationships",
138
+ "WorkflowEngine",
139
+ "WorkflowEngineReasoningEffort",
140
+ "WorkflowEngineService",
141
+ "WorkflowPrompt",
142
+ "WorkflowPromptGroup",
143
+ "WorkflowPromptRole",
144
+ "WorkflowRequest",
145
+ "WorkflowRequestChunkStrategy",
146
+ "WorkflowResponse",
147
+ "WorkflowStep",
148
+ "WorkflowStepConfig",
149
+ "WorkflowStepConfigField",
150
+ "WorkflowSteps",
151
+ "WorkflowsGetRequestId",
152
+ "WorkflowsResponse",
153
+ "__version__",
154
+ "buckets",
155
+ "customer",
156
+ "documents",
157
+ "groups",
158
+ "health",
159
+ "search",
160
+ "workflows",
161
+ ]
@@ -0,0 +1,4 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ # isort: skip_file
4
+