groundx 2.7.9__py3-none-any.whl → 2.8.1__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.

Potentially problematic release.


This version of groundx might be problematic. Click here for more details.

@@ -14,10 +14,10 @@ class BaseClientWrapper:
14
14
 
15
15
  def get_headers(self) -> typing.Dict[str, str]:
16
16
  headers: typing.Dict[str, str] = {
17
- "User-Agent": "groundx/2.7.9",
17
+ "User-Agent": "groundx/2.8.1",
18
18
  "X-Fern-Language": "Python",
19
19
  "X-Fern-SDK-Name": "groundx",
20
- "X-Fern-SDK-Version": "2.7.9",
20
+ "X-Fern-SDK-Version": "2.8.1",
21
21
  }
22
22
  headers["X-API-Key"] = self.api_key
23
23
  return headers
groundx/ingest.py CHANGED
@@ -150,6 +150,7 @@ class GroundX(GroundXBase):
150
150
  upload_api: str = "https://api.eyelevel.ai/upload/file",
151
151
  callback_url: typing.Optional[str] = None,
152
152
  callback_data: typing.Optional[str] = None,
153
+ override_batch_size: typing.Optional[bool] = False,
153
154
  request_options: typing.Optional[RequestOptions] = None,
154
155
  ) -> IngestResponse:
155
156
  """
@@ -209,15 +210,17 @@ class GroundX(GroundXBase):
209
210
  if len(remote_documents) + len(local_documents) == 0:
210
211
  raise ValueError("No valid documents were provided")
211
212
 
213
+ max_n = MAX_BATCH_SIZE
214
+ if override_batch_size:
215
+ max_n = 1000
216
+
212
217
  if wait_for_complete:
213
218
  with tqdm(
214
219
  total=len(remote_documents) + len(local_documents),
215
220
  desc="Ingesting Files",
216
221
  unit="file",
217
222
  ) as pbar:
218
- n = max(
219
- MIN_BATCH_SIZE, min(batch_size or MIN_BATCH_SIZE, MAX_BATCH_SIZE)
220
- )
223
+ n = max(MIN_BATCH_SIZE, min(batch_size or MIN_BATCH_SIZE, max_n))
221
224
 
222
225
  remote_batch: typing.List[IngestRemoteDocument] = []
223
226
  ingest = IngestResponse(
@@ -299,7 +302,7 @@ class GroundX(GroundXBase):
299
302
  pbar.update(progress)
300
303
 
301
304
  return ingest
302
- elif len(remote_documents) + len(local_documents) > MAX_BATCH_SIZE:
305
+ elif len(remote_documents) + len(local_documents) > max_n:
303
306
  raise ValueError("You have sent too many documents in this request")
304
307
 
305
308
  up_docs, _ = self._process_local(local_documents, upload_api, 0, None)
@@ -321,6 +324,7 @@ class GroundX(GroundXBase):
321
324
  upload_api: str = "https://api.eyelevel.ai/upload/file",
322
325
  callback_url: typing.Optional[str] = None,
323
326
  callback_data: typing.Optional[str] = None,
327
+ override_batch_size: typing.Optional[bool] = False,
324
328
  request_options: typing.Optional[RequestOptions] = None,
325
329
  ):
326
330
  """
@@ -393,7 +397,11 @@ class GroundX(GroundXBase):
393
397
  current_batch: typing.List[Path] = []
394
398
  current_batch_size: int = 0
395
399
 
396
- n = max(MIN_BATCH_SIZE, min(batch_size or MIN_BATCH_SIZE, MAX_BATCH_SIZE))
400
+ max_n = MAX_BATCH_SIZE
401
+ if override_batch_size:
402
+ max_n = 1000
403
+
404
+ n = max(MIN_BATCH_SIZE, min(batch_size or MIN_BATCH_SIZE, max_n))
397
405
 
398
406
  with tqdm(total=len(files), desc="Ingesting Files", unit="file") as pbar:
399
407
  for file in files:
@@ -635,6 +643,7 @@ class AsyncGroundX(AsyncGroundXBase):
635
643
  upload_api: str = "https://api.eyelevel.ai/upload/file",
636
644
  callback_url: typing.Optional[str] = None,
637
645
  callback_data: typing.Optional[str] = None,
646
+ override_batch_size: typing.Optional[bool] = False,
638
647
  request_options: typing.Optional[RequestOptions] = None,
639
648
  ) -> IngestResponse:
640
649
  """
@@ -689,7 +698,11 @@ class AsyncGroundX(AsyncGroundXBase):
689
698
  """
690
699
  remote_documents, local_documents = prep_documents(documents)
691
700
 
692
- if len(remote_documents) + len(local_documents) > MAX_BATCH_SIZE:
701
+ max_n = MAX_BATCH_SIZE
702
+ if override_batch_size:
703
+ max_n = 1000
704
+
705
+ if len(remote_documents) + len(local_documents) > max_n:
693
706
  raise ValueError("You have sent too many documents in this request")
694
707
 
695
708
  if len(remote_documents) + len(local_documents) == 0:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: groundx
3
- Version: 2.7.9
3
+ Version: 2.8.1
4
4
  Summary:
5
5
  License: MIT
6
6
  Requires-Python: >=3.8,<4.0
@@ -5,7 +5,7 @@ groundx/buckets/raw_client.py,sha256=T2Ty5obN7eHbaxHGAimzjM8MGOmSOQEckhciyZkzcjE
5
5
  groundx/client.py,sha256=PksVIgU2pXup9Ewkl7NcLPvQOIhg_Do3cJVGgXqqQjE,6641
6
6
  groundx/core/__init__.py,sha256=lTcqUPXcx4112yLDd70RAPeqq6tu3eFMe1pKOqkW9JQ,1562
7
7
  groundx/core/api_error.py,sha256=44vPoTyWN59gonCIZMdzw7M1uspygiLnr3GNFOoVL2Q,614
8
- groundx/core/client_wrapper.py,sha256=uA5vNnHm7aJWmMP4jvmkwEJe-LcdgVLXkkfs7oYAI8k,1822
8
+ groundx/core/client_wrapper.py,sha256=VA-cLr2yd-RbQDV2m_aWA1UmUDA9IvqW0hclBR2eFvg,1822
9
9
  groundx/core/datetime_utils.py,sha256=nBys2IsYrhPdszxGKCNRPSOCwa-5DWOHG95FB8G9PKo,1047
10
10
  groundx/core/file.py,sha256=d4NNbX8XvXP32z8KpK2Xovv33nFfruIrpz0QWxlgpZk,2663
11
11
  groundx/core/force_multipart.py,sha256=awxh5MtcRYe74ehY8U76jzv6fYM_w_D3Rur7KQQzSDk,429
@@ -70,7 +70,7 @@ groundx/groups/raw_client.py,sha256=nP9yFh7MexjDUQU8TtB5j-HAmZJjQWOd78hu-KeMnRs,
70
70
  groundx/health/__init__.py,sha256=_VhToAyIt_5axN6CLJwtxg3-CO7THa_23pbUzqhXJa4,85
71
71
  groundx/health/client.py,sha256=kcGIlqCEzBl6fuwJaf3x-obOagXxyAlEFaPRH3qgdDs,4566
72
72
  groundx/health/raw_client.py,sha256=_TDa-O13PtC0RYCAq4bx5FESz1oLDLp9WExyOKjsIjs,7430
73
- groundx/ingest.py,sha256=QTwsLUdzL6CIvwCb0jep4zHGQebpKbS-cwgG4i9QgiQ,26283
73
+ groundx/ingest.py,sha256=jI9OTvNtto2BQjvi_E_sAYRM7w4jRJRstDzyABUfkyU,26656
74
74
  groundx/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
75
75
  groundx/search/__init__.py,sha256=Y1EKHPBEh-ebo1YOikCHTHU9E8kBP2s7K4J_kZGzcOA,165
76
76
  groundx/search/client.py,sha256=ArfAbcQGS6eCWuMU5Ld-AQ8nB0Vh-4Jec3tt05QJtuM,13783
@@ -149,7 +149,7 @@ groundx/workflows/client.py,sha256=-aAqa43LQMx62iwcH4QEEHPSOeT2cNj9334SBZMGy4s,1
149
149
  groundx/workflows/raw_client.py,sha256=eoIedOkJtF01d4VC8W0q3eH9TgU5Qi40XwEbQl7MQsA,31368
150
150
  groundx/workflows/types/__init__.py,sha256=r-3IiPgf480gPstg62dFXecJQNOoTaJzcqul0_8_8DM,182
151
151
  groundx/workflows/types/workflows_get_request_id.py,sha256=pGcBQwEQYDxoxBGpACdy3zf1Qc2rjcN3zv-TZXHu9p0,127
152
- groundx-2.7.9.dist-info/LICENSE,sha256=dFE6nY1bHnSn6NqmdlghlU1gQqLqYNphrceGVehSa7o,1065
153
- groundx-2.7.9.dist-info/METADATA,sha256=cIz_KXFm3esfR0a-fxWeENRi8LG24r3MfiKsyWgXtrg,5919
154
- groundx-2.7.9.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
155
- groundx-2.7.9.dist-info/RECORD,,
152
+ groundx-2.8.1.dist-info/LICENSE,sha256=dFE6nY1bHnSn6NqmdlghlU1gQqLqYNphrceGVehSa7o,1065
153
+ groundx-2.8.1.dist-info/METADATA,sha256=0Q9TQ16674AKzPIJT4a4_F_5wHMtL3g68kNYWpc08f0,5919
154
+ groundx-2.8.1.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
155
+ groundx-2.8.1.dist-info/RECORD,,