vellum-ai 0.6.7__py3-none-any.whl → 0.6.8__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.
- vellum/core/client_wrapper.py +1 -1
- vellum/resources/document_indexes/client.py +120 -12
- {vellum_ai-0.6.7.dist-info → vellum_ai-0.6.8.dist-info}/METADATA +1 -1
- {vellum_ai-0.6.7.dist-info → vellum_ai-0.6.8.dist-info}/RECORD +6 -6
- {vellum_ai-0.6.7.dist-info → vellum_ai-0.6.8.dist-info}/LICENSE +0 -0
- {vellum_ai-0.6.7.dist-info → vellum_ai-0.6.8.dist-info}/WHEEL +0 -0
vellum/core/client_wrapper.py
CHANGED
@@ -256,10 +256,10 @@ class DocumentIndexesClient:
|
|
256
256
|
request_options: typing.Optional[RequestOptions] = None,
|
257
257
|
) -> DocumentIndexRead:
|
258
258
|
"""
|
259
|
-
Used to fully update a Document Index given its ID.
|
259
|
+
Used to fully update a Document Index given its ID or name.
|
260
260
|
|
261
261
|
Parameters:
|
262
|
-
- id: str.
|
262
|
+
- id: str. Either the Document Index's ID or its unique name
|
263
263
|
|
264
264
|
- label: str. A human-readable label for the document index
|
265
265
|
|
@@ -329,10 +329,10 @@ class DocumentIndexesClient:
|
|
329
329
|
|
330
330
|
def destroy(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
|
331
331
|
"""
|
332
|
-
Used to delete a Document Index given its ID.
|
332
|
+
Used to delete a Document Index given its ID or name.
|
333
333
|
|
334
334
|
Parameters:
|
335
|
-
- id: str.
|
335
|
+
- id: str. Either the Document Index's ID or its unique name
|
336
336
|
|
337
337
|
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
338
338
|
---
|
@@ -385,10 +385,10 @@ class DocumentIndexesClient:
|
|
385
385
|
request_options: typing.Optional[RequestOptions] = None,
|
386
386
|
) -> DocumentIndexRead:
|
387
387
|
"""
|
388
|
-
Used to partial update a Document Index given its ID.
|
388
|
+
Used to partial update a Document Index given its ID or name.
|
389
389
|
|
390
390
|
Parameters:
|
391
|
-
- id: str.
|
391
|
+
- id: str. Either the Document Index's ID or its unique name
|
392
392
|
|
393
393
|
- label: typing.Optional[str]. A human-readable label for the document index
|
394
394
|
|
@@ -458,6 +458,60 @@ class DocumentIndexesClient:
|
|
458
458
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
459
459
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
460
460
|
|
461
|
+
def remove_document(
|
462
|
+
self, document_id: str, id: str, *, request_options: typing.Optional[RequestOptions] = None
|
463
|
+
) -> None:
|
464
|
+
"""
|
465
|
+
Removes a Document from a Document Index without deleting the Document itself.
|
466
|
+
|
467
|
+
Parameters:
|
468
|
+
- document_id: str. Either the Vellum-generated ID or the originally supplied external_id that uniquely identifies the Document you'd like to remove.
|
469
|
+
|
470
|
+
- id: str. Either the Vellum-generated ID or the originally specified name that uniquely identifies the Document Index from which you'd like to remove a Document.
|
471
|
+
|
472
|
+
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
473
|
+
---
|
474
|
+
from vellum.client import Vellum
|
475
|
+
|
476
|
+
client = Vellum(
|
477
|
+
api_key="YOUR_API_KEY",
|
478
|
+
)
|
479
|
+
client.document_indexes.remove_document(
|
480
|
+
document_id="document_id",
|
481
|
+
id="id",
|
482
|
+
)
|
483
|
+
"""
|
484
|
+
_response = self._client_wrapper.httpx_client.request(
|
485
|
+
method="DELETE",
|
486
|
+
url=urllib.parse.urljoin(
|
487
|
+
f"{self._client_wrapper.get_environment().default}/",
|
488
|
+
f"v1/document-indexes/{jsonable_encoder(id)}/documents/{jsonable_encoder(document_id)}",
|
489
|
+
),
|
490
|
+
params=jsonable_encoder(
|
491
|
+
request_options.get("additional_query_parameters") if request_options is not None else None
|
492
|
+
),
|
493
|
+
headers=jsonable_encoder(
|
494
|
+
remove_none_from_dict(
|
495
|
+
{
|
496
|
+
**self._client_wrapper.get_headers(),
|
497
|
+
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
498
|
+
}
|
499
|
+
)
|
500
|
+
),
|
501
|
+
timeout=request_options.get("timeout_in_seconds")
|
502
|
+
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
503
|
+
else self._client_wrapper.get_timeout(),
|
504
|
+
retries=0,
|
505
|
+
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
506
|
+
)
|
507
|
+
if 200 <= _response.status_code < 300:
|
508
|
+
return
|
509
|
+
try:
|
510
|
+
_response_json = _response.json()
|
511
|
+
except JSONDecodeError:
|
512
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
513
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
514
|
+
|
461
515
|
|
462
516
|
class AsyncDocumentIndexesClient:
|
463
517
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
@@ -694,10 +748,10 @@ class AsyncDocumentIndexesClient:
|
|
694
748
|
request_options: typing.Optional[RequestOptions] = None,
|
695
749
|
) -> DocumentIndexRead:
|
696
750
|
"""
|
697
|
-
Used to fully update a Document Index given its ID.
|
751
|
+
Used to fully update a Document Index given its ID or name.
|
698
752
|
|
699
753
|
Parameters:
|
700
|
-
- id: str.
|
754
|
+
- id: str. Either the Document Index's ID or its unique name
|
701
755
|
|
702
756
|
- label: str. A human-readable label for the document index
|
703
757
|
|
@@ -767,10 +821,10 @@ class AsyncDocumentIndexesClient:
|
|
767
821
|
|
768
822
|
async def destroy(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
|
769
823
|
"""
|
770
|
-
Used to delete a Document Index given its ID.
|
824
|
+
Used to delete a Document Index given its ID or name.
|
771
825
|
|
772
826
|
Parameters:
|
773
|
-
- id: str.
|
827
|
+
- id: str. Either the Document Index's ID or its unique name
|
774
828
|
|
775
829
|
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
776
830
|
---
|
@@ -823,10 +877,10 @@ class AsyncDocumentIndexesClient:
|
|
823
877
|
request_options: typing.Optional[RequestOptions] = None,
|
824
878
|
) -> DocumentIndexRead:
|
825
879
|
"""
|
826
|
-
Used to partial update a Document Index given its ID.
|
880
|
+
Used to partial update a Document Index given its ID or name.
|
827
881
|
|
828
882
|
Parameters:
|
829
|
-
- id: str.
|
883
|
+
- id: str. Either the Document Index's ID or its unique name
|
830
884
|
|
831
885
|
- label: typing.Optional[str]. A human-readable label for the document index
|
832
886
|
|
@@ -895,3 +949,57 @@ class AsyncDocumentIndexesClient:
|
|
895
949
|
except JSONDecodeError:
|
896
950
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
897
951
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
952
|
+
|
953
|
+
async def remove_document(
|
954
|
+
self, document_id: str, id: str, *, request_options: typing.Optional[RequestOptions] = None
|
955
|
+
) -> None:
|
956
|
+
"""
|
957
|
+
Removes a Document from a Document Index without deleting the Document itself.
|
958
|
+
|
959
|
+
Parameters:
|
960
|
+
- document_id: str. Either the Vellum-generated ID or the originally supplied external_id that uniquely identifies the Document you'd like to remove.
|
961
|
+
|
962
|
+
- id: str. Either the Vellum-generated ID or the originally specified name that uniquely identifies the Document Index from which you'd like to remove a Document.
|
963
|
+
|
964
|
+
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
965
|
+
---
|
966
|
+
from vellum.client import AsyncVellum
|
967
|
+
|
968
|
+
client = AsyncVellum(
|
969
|
+
api_key="YOUR_API_KEY",
|
970
|
+
)
|
971
|
+
await client.document_indexes.remove_document(
|
972
|
+
document_id="document_id",
|
973
|
+
id="id",
|
974
|
+
)
|
975
|
+
"""
|
976
|
+
_response = await self._client_wrapper.httpx_client.request(
|
977
|
+
method="DELETE",
|
978
|
+
url=urllib.parse.urljoin(
|
979
|
+
f"{self._client_wrapper.get_environment().default}/",
|
980
|
+
f"v1/document-indexes/{jsonable_encoder(id)}/documents/{jsonable_encoder(document_id)}",
|
981
|
+
),
|
982
|
+
params=jsonable_encoder(
|
983
|
+
request_options.get("additional_query_parameters") if request_options is not None else None
|
984
|
+
),
|
985
|
+
headers=jsonable_encoder(
|
986
|
+
remove_none_from_dict(
|
987
|
+
{
|
988
|
+
**self._client_wrapper.get_headers(),
|
989
|
+
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
990
|
+
}
|
991
|
+
)
|
992
|
+
),
|
993
|
+
timeout=request_options.get("timeout_in_seconds")
|
994
|
+
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
995
|
+
else self._client_wrapper.get_timeout(),
|
996
|
+
retries=0,
|
997
|
+
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
998
|
+
)
|
999
|
+
if 200 <= _response.status_code < 300:
|
1000
|
+
return
|
1001
|
+
try:
|
1002
|
+
_response_json = _response.json()
|
1003
|
+
except JSONDecodeError:
|
1004
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
1005
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
@@ -2,7 +2,7 @@ vellum/__init__.py,sha256=G55NRop_hz8IpafXnIM326D0I9YSBsQJLtzBNgoVNDM,45651
|
|
2
2
|
vellum/client.py,sha256=FklbOzCaDTPP_EQn0HJXUq1_ZFOHuSePt6_nVQ_YLgY,97463
|
3
3
|
vellum/core/__init__.py,sha256=1pNSKkwyQvMl_F0wohBqmoQAITptg3zlvCwsoSSzy7c,853
|
4
4
|
vellum/core/api_error.py,sha256=RE8LELok2QCjABadECTvtDp7qejA1VmINCh6TbqPwSE,426
|
5
|
-
vellum/core/client_wrapper.py,sha256
|
5
|
+
vellum/core/client_wrapper.py,sha256=q4MSX71tkX6HJqK9iZFBghW2ykYtsMzuw8Vm2U6njxo,1697
|
6
6
|
vellum/core/datetime_utils.py,sha256=nBys2IsYrhPdszxGKCNRPSOCwa-5DWOHG95FB8G9PKo,1047
|
7
7
|
vellum/core/file.py,sha256=sy1RUGZ3aJYuw998bZytxxo6QdgKmlnlgBaMvwEKCGg,1480
|
8
8
|
vellum/core/http_client.py,sha256=5ok6hqgZDJhg57EHvMnr0BBaHdG50QxFPKaCZ9aVWTc,5059
|
@@ -32,7 +32,7 @@ vellum/resources/deployments/client.py,sha256=p-n2k6RQIwNBDm9dU-wE6pI0kRhNjQiARB
|
|
32
32
|
vellum/resources/deployments/types/__init__.py,sha256=IhwnmoXJ0r_QEhh1b2tBcaAm_x3fWMVuIhYmAapp_ZA,183
|
33
33
|
vellum/resources/deployments/types/deployments_list_request_status.py,sha256=CxlQD16KZXme7x31YYCe_3aAgEueutDTeJo5A4Au-aU,174
|
34
34
|
vellum/resources/document_indexes/__init__.py,sha256=YpOl_9IV7xOlH4OmusQxtAJB11kxQfCSMDyT1_UD0oM,165
|
35
|
-
vellum/resources/document_indexes/client.py,sha256=
|
35
|
+
vellum/resources/document_indexes/client.py,sha256=DgJn_ZpIt-WY8OR3P3sCQ_x7FVtQ5WVj_TR1t9PwDf0,45370
|
36
36
|
vellum/resources/document_indexes/types/__init__.py,sha256=IoFqKHN_VBdEhC7VL8_6Jbatrn0e0zuYEJAJUahcUR0,196
|
37
37
|
vellum/resources/document_indexes/types/document_indexes_list_request_status.py,sha256=sfUEB0cvOSmlE2iITqnMVyHv05Zy2fWP4QjCIYqMg0M,178
|
38
38
|
vellum/resources/documents/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
|
@@ -470,7 +470,7 @@ vellum/types/workflow_result_event_output_data_search_results.py,sha256=gazaUrC5
|
|
470
470
|
vellum/types/workflow_result_event_output_data_string.py,sha256=aVWIIGbLj4TJJhTTj6WzhbYXQkcZatKuhhNy8UYwXbw,1482
|
471
471
|
vellum/types/workflow_stream_event.py,sha256=KA6Bkk_XA6AIPWR-1vKnwF1A8l_Bm5y0arQCWWWRpsk,911
|
472
472
|
vellum/version.py,sha256=neLt8HBHHUtDF9M5fsyUzHT-pKooEPvceaLDqqIGb0s,77
|
473
|
-
vellum_ai-0.6.
|
474
|
-
vellum_ai-0.6.
|
475
|
-
vellum_ai-0.6.
|
476
|
-
vellum_ai-0.6.
|
473
|
+
vellum_ai-0.6.8.dist-info/LICENSE,sha256=CcaljEIoOBaU-wItPH4PmM_mDCGpyuUY0Er1BGu5Ti8,1073
|
474
|
+
vellum_ai-0.6.8.dist-info/METADATA,sha256=nJyQBLYfdBqx3TaaTf8QLuLHWsALydR2wN7U1Twez1o,3872
|
475
|
+
vellum_ai-0.6.8.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
|
476
|
+
vellum_ai-0.6.8.dist-info/RECORD,,
|
File without changes
|
File without changes
|