usecortex-ai 0.3.6__py3-none-any.whl → 0.5.0__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.
- usecortex_ai/__init__.py +82 -70
- usecortex_ai/client.py +25 -23
- usecortex_ai/dashboard/client.py +448 -0
- usecortex_ai/{user_memory → dashboard}/raw_client.py +371 -530
- usecortex_ai/embeddings/client.py +229 -102
- usecortex_ai/embeddings/raw_client.py +323 -211
- usecortex_ai/errors/__init__.py +2 -0
- usecortex_ai/errors/bad_request_error.py +1 -2
- usecortex_ai/errors/forbidden_error.py +1 -2
- usecortex_ai/errors/internal_server_error.py +1 -2
- usecortex_ai/errors/not_found_error.py +1 -2
- usecortex_ai/errors/service_unavailable_error.py +1 -2
- usecortex_ai/errors/too_many_requests_error.py +11 -0
- usecortex_ai/errors/unauthorized_error.py +1 -2
- usecortex_ai/fetch/client.py +350 -29
- usecortex_ai/fetch/raw_client.py +919 -65
- usecortex_ai/raw_client.py +8 -2
- usecortex_ai/search/client.py +313 -257
- usecortex_ai/search/raw_client.py +463 -344
- usecortex_ai/search/types/alpha.py +1 -1
- usecortex_ai/sources/client.py +29 -216
- usecortex_ai/sources/raw_client.py +51 -589
- usecortex_ai/tenant/client.py +155 -118
- usecortex_ai/tenant/raw_client.py +227 -350
- usecortex_ai/types/__init__.py +76 -66
- usecortex_ai/types/add_memory_response.py +39 -0
- usecortex_ai/types/{scored_triplet_response.py → api_key_info.py} +16 -12
- usecortex_ai/types/app_sources_upload_data.py +15 -6
- usecortex_ai/types/{file_upload_result.py → collection_stats.py} +5 -5
- usecortex_ai/types/custom_property_definition.py +75 -0
- usecortex_ai/types/dashboard_apis_response.py +33 -0
- usecortex_ai/types/dashboard_sources_response.py +33 -0
- usecortex_ai/types/dashboard_tenants_response.py +33 -0
- usecortex_ai/types/{list_sources_response.py → delete_result.py} +10 -7
- usecortex_ai/types/delete_user_memory_response.py +1 -1
- usecortex_ai/types/entity.py +4 -4
- usecortex_ai/types/fetch_mode.py +5 -0
- usecortex_ai/types/{relations.py → forceful_relations_payload.py} +4 -4
- usecortex_ai/types/graph_context.py +26 -0
- usecortex_ai/types/{delete_sources.py → infra.py} +4 -3
- usecortex_ai/types/{fetch_content_data.py → insert_result.py} +12 -8
- usecortex_ai/types/memory_item.py +88 -0
- usecortex_ai/types/memory_result_item.py +47 -0
- usecortex_ai/types/milvus_data_type.py +21 -0
- usecortex_ai/types/path_triplet.py +3 -18
- usecortex_ai/types/processing_status.py +3 -2
- usecortex_ai/types/processing_status_indexing_status.py +7 -0
- usecortex_ai/types/qn_a_search_response.py +49 -0
- usecortex_ai/types/{retrieve_response.py → raw_embedding_document.py} +11 -8
- usecortex_ai/types/raw_embedding_search_result.py +47 -0
- usecortex_ai/types/{user_memory.py → raw_embedding_vector.py} +6 -6
- usecortex_ai/types/relation_evidence.py +24 -5
- usecortex_ai/types/retrieval_result.py +30 -0
- usecortex_ai/types/scored_path_response.py +5 -19
- usecortex_ai/types/search_mode.py +5 -0
- usecortex_ai/types/{batch_upload_data.py → source_delete_response.py} +8 -8
- usecortex_ai/types/{list_user_memories_response.py → source_delete_result_item.py} +11 -7
- usecortex_ai/types/source_fetch_response.py +70 -0
- usecortex_ai/types/{graph_relations_response.py → source_graph_relations_response.py} +3 -3
- usecortex_ai/types/{single_upload_data.py → source_list_response.py} +7 -10
- usecortex_ai/types/source_model.py +11 -1
- usecortex_ai/types/source_status.py +5 -0
- usecortex_ai/types/source_upload_response.py +35 -0
- usecortex_ai/types/source_upload_result_item.py +38 -0
- usecortex_ai/types/supported_llm_providers.py +5 -0
- usecortex_ai/types/{embeddings_create_collection_data.py → tenant_create_response.py} +9 -7
- usecortex_ai/types/{webpage_scrape_request.py → tenant_info.py} +10 -5
- usecortex_ai/types/tenant_metadata_schema_info.py +36 -0
- usecortex_ai/types/{tenant_create_data.py → tenant_stats_response.py} +9 -8
- usecortex_ai/types/{triple_with_evidence.py → triplet_with_evidence.py} +5 -1
- usecortex_ai/types/user_assistant_pair.py +4 -0
- usecortex_ai/types/{search_chunk.py → vector_store_chunk.py} +5 -11
- usecortex_ai/upload/__init__.py +3 -0
- usecortex_ai/upload/client.py +233 -1937
- usecortex_ai/upload/raw_client.py +364 -4401
- usecortex_ai/upload/types/__init__.py +7 -0
- usecortex_ai/upload/types/body_upload_app_ingestion_upload_app_post_app_sources.py +7 -0
- {usecortex_ai-0.3.6.dist-info → usecortex_ai-0.5.0.dist-info}/METADATA +2 -2
- usecortex_ai-0.5.0.dist-info/RECORD +114 -0
- {usecortex_ai-0.3.6.dist-info → usecortex_ai-0.5.0.dist-info}/WHEEL +1 -1
- {usecortex_ai-0.3.6.dist-info → usecortex_ai-0.5.0.dist-info}/licenses/LICENSE +21 -21
- {usecortex_ai-0.3.6.dist-info → usecortex_ai-0.5.0.dist-info}/top_level.txt +0 -0
- usecortex_ai/document/client.py +0 -139
- usecortex_ai/document/raw_client.py +0 -312
- usecortex_ai/types/add_user_memory_response.py +0 -41
- usecortex_ai/types/body_scrape_webpage_upload_scrape_webpage_post.py +0 -17
- usecortex_ai/types/body_update_scrape_job_upload_update_webpage_patch.py +0 -17
- usecortex_ai/types/chunk_graph_relations_response.py +0 -33
- usecortex_ai/types/delete_memory_request.py +0 -32
- usecortex_ai/types/delete_sub_tenant_data.py +0 -42
- usecortex_ai/types/embeddings_delete_data.py +0 -37
- usecortex_ai/types/embeddings_get_data.py +0 -37
- usecortex_ai/types/embeddings_search_data.py +0 -37
- usecortex_ai/types/extended_context.py +0 -17
- usecortex_ai/types/markdown_upload_request.py +0 -41
- usecortex_ai/types/related_chunk.py +0 -22
- usecortex_ai/types/retrieve_user_memory_response.py +0 -38
- usecortex_ai/types/source.py +0 -52
- usecortex_ai/types/sub_tenant_ids_data.py +0 -47
- usecortex_ai/types/tenant_stats.py +0 -42
- usecortex_ai/user/__init__.py +0 -4
- usecortex_ai/user/client.py +0 -145
- usecortex_ai/user/raw_client.py +0 -316
- usecortex_ai/user_memory/__init__.py +0 -4
- usecortex_ai/user_memory/client.py +0 -515
- usecortex_ai-0.3.6.dist-info/RECORD +0 -112
- /usecortex_ai/{document → dashboard}/__init__.py +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: usecortex-ai
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.5.0
|
|
4
4
|
Summary: The official Python SDK for the Cortex AI platform.
|
|
5
|
-
Author-email:
|
|
5
|
+
Author-email: Soham Ratnaparkhi <soham@usecortex.ai>
|
|
6
6
|
License: Copyright (c) 2024 Cortex AI
|
|
7
7
|
|
|
8
8
|
All Rights Reserved.
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
usecortex_ai/__init__.py,sha256=rD8U2JdJeww4oRS58yQT7E4ELKnphMrH-CmRKT1MjRU,3735
|
|
2
|
+
usecortex_ai/client.py,sha256=Q5pukJ7vnwW9DlVptgmBe9PRh-PHL_y0OP8ikvo7MGI,9633
|
|
3
|
+
usecortex_ai/environment.py,sha256=IZ0X7CTz4V0TzNaMrw6E5GJklcTLxGJmrWEyH-LtYsc,162
|
|
4
|
+
usecortex_ai/raw_client.py,sha256=XHaTjauK7dktQzjz0zapU6EM32vCi4h3g1bb6oVLwZE,3700
|
|
5
|
+
usecortex_ai/core/__init__.py,sha256=lTcqUPXcx4112yLDd70RAPeqq6tu3eFMe1pKOqkW9JQ,1562
|
|
6
|
+
usecortex_ai/core/api_error.py,sha256=44vPoTyWN59gonCIZMdzw7M1uspygiLnr3GNFOoVL2Q,614
|
|
7
|
+
usecortex_ai/core/client_wrapper.py,sha256=50sko9nNjHmtUmiWiGjJZ3cT9RITCKzfOgvJ55QlwQQ,2681
|
|
8
|
+
usecortex_ai/core/datetime_utils.py,sha256=nBys2IsYrhPdszxGKCNRPSOCwa-5DWOHG95FB8G9PKo,1047
|
|
9
|
+
usecortex_ai/core/file.py,sha256=d4NNbX8XvXP32z8KpK2Xovv33nFfruIrpz0QWxlgpZk,2663
|
|
10
|
+
usecortex_ai/core/force_multipart.py,sha256=cH981xLy0kZVKiZZkFoeUjgJ2Zuq7KXB2aRAnmHzRDc,477
|
|
11
|
+
usecortex_ai/core/http_client.py,sha256=QurkBvCZZz2Z1d8znp4M2YbOXebBUPcPXRhPIS84Wvk,21214
|
|
12
|
+
usecortex_ai/core/http_response.py,sha256=A6URkoTBCiryctAA-m9EiDWOsHgM5oYAlcYVc_YOiiI,1330
|
|
13
|
+
usecortex_ai/core/jsonable_encoder.py,sha256=hGgcEEeX11sqxxsll7h15pO3pTNVxk_n79Kcn0laoWA,3655
|
|
14
|
+
usecortex_ai/core/pydantic_utilities.py,sha256=alHZbJORJ1RxtFlr4Aohw47_QAtCeMbcGPgCvxKsfPM,10830
|
|
15
|
+
usecortex_ai/core/query_encoder.py,sha256=ekulqNd0j8TgD7ox-Qbz7liqX8-KP9blvT9DsRCenYM,2144
|
|
16
|
+
usecortex_ai/core/remove_none_from_dict.py,sha256=EU9SGgYidWq7SexuJbNs4-PZ-5Bl3Vppd864mS6vQZw,342
|
|
17
|
+
usecortex_ai/core/request_options.py,sha256=h0QUNCFVdCW_7GclVySCAY2w4NhtXVBUCmHgmzaxpcg,1681
|
|
18
|
+
usecortex_ai/core/serialization.py,sha256=ECL3bvv_0i7U4uvPidZCNel--MUbA0iq0aGcNKi3kws,9818
|
|
19
|
+
usecortex_ai/dashboard/__init__.py,sha256=_VhToAyIt_5axN6CLJwtxg3-CO7THa_23pbUzqhXJa4,85
|
|
20
|
+
usecortex_ai/dashboard/client.py,sha256=0VaVuVlWJ0zqY0VcPIcXuFI3SIo1oQidhAMPmT4DKoY,13319
|
|
21
|
+
usecortex_ai/dashboard/raw_client.py,sha256=8hbt5ZfSN0DnDMFl5-s1WbrSK8jtPb4-jlxiXTgTQCE,43641
|
|
22
|
+
usecortex_ai/embeddings/__init__.py,sha256=_VhToAyIt_5axN6CLJwtxg3-CO7THa_23pbUzqhXJa4,85
|
|
23
|
+
usecortex_ai/embeddings/client.py,sha256=0QDo8jYbMWYQstI8RmzkiL7gXbb_XaaedbqrnG9Rjl0,18999
|
|
24
|
+
usecortex_ai/embeddings/raw_client.py,sha256=apZktTJoUNbs-I65Mc_kIQPYMR8GIt7vE7NC5ZmLero,50951
|
|
25
|
+
usecortex_ai/errors/__init__.py,sha256=UCxF9Stci6y9oYV8HsEf_gF37PBNXbhEyP5BejOcqTs,734
|
|
26
|
+
usecortex_ai/errors/bad_request_error.py,sha256=PnE3v3kETCXm9E3LiNcHLNtjPEUvpe98-r59q-kQb78,338
|
|
27
|
+
usecortex_ai/errors/forbidden_error.py,sha256=JhKThpM90vF0BEmaBn-8P_0NVYmgJ2BE9kvWmLxU_nA,337
|
|
28
|
+
usecortex_ai/errors/internal_server_error.py,sha256=t1-kpoDC2biEuoE-Ne8v1kuQswvsIEwt_xPPoBmGG00,342
|
|
29
|
+
usecortex_ai/errors/not_found_error.py,sha256=YrqVM0oc3qkQbFbmmm6xr300VGfUNxMSy1UQUp2IOE8,336
|
|
30
|
+
usecortex_ai/errors/service_unavailable_error.py,sha256=MIoOqruDBRDJtJJFK45O4_Xwjcwh4diwKbpHlqNQ-ZI,346
|
|
31
|
+
usecortex_ai/errors/too_many_requests_error.py,sha256=U9YgxaSDjP2m7X0blwAbQaH6yEpfRAsQGjvoEcMIY_8,397
|
|
32
|
+
usecortex_ai/errors/unauthorized_error.py,sha256=mryinHCAaknn5St2VF17R9XybZUcWRRYWEjxg63dQSA,340
|
|
33
|
+
usecortex_ai/errors/unprocessable_entity_error.py,sha256=JqxtzIhvjkpQDqbT9Q-go1n-gyv9PsYqq0ng_ZYyBMo,347
|
|
34
|
+
usecortex_ai/fetch/__init__.py,sha256=_VhToAyIt_5axN6CLJwtxg3-CO7THa_23pbUzqhXJa4,85
|
|
35
|
+
usecortex_ai/fetch/client.py,sha256=tbiCVuM_wjL67jkHIWar7H_SaHns3vVLtGWp4kHrSho,15476
|
|
36
|
+
usecortex_ai/fetch/raw_client.py,sha256=9A2hndWmMkBjdUae-LuktiH-gavGUaJ_GaW28WLJlLc,47167
|
|
37
|
+
usecortex_ai/search/__init__.py,sha256=iA8ksy3OzGPGNq_g8cVXsEiZuWyAEAnKI6fHUFWEE-A,131
|
|
38
|
+
usecortex_ai/search/client.py,sha256=PAvX90mAUaR4M74Cj3gHBcZ8z3hOXbmyqIkcdm9ez4I,23580
|
|
39
|
+
usecortex_ai/search/raw_client.py,sha256=bXWnUllxhzjmV3wT7P1nYSBqz0qnuGp3i3M-80nVUsk,50891
|
|
40
|
+
usecortex_ai/search/types/__init__.py,sha256=T0zQrrDzfvgmw2Deo_iYanUoxcVhZ9jDO_fS3CpSU9M,131
|
|
41
|
+
usecortex_ai/search/types/alpha.py,sha256=ajQv7MA-jeqjZNfX7p4zx8VcPSBu8vHj-btZ_NIK2a4,113
|
|
42
|
+
usecortex_ai/sources/__init__.py,sha256=_VhToAyIt_5axN6CLJwtxg3-CO7THa_23pbUzqhXJa4,85
|
|
43
|
+
usecortex_ai/sources/client.py,sha256=A5MX_ZOQc_ZAzEZ53PlT20jghwDPuIth_edQwYJ63S8,4310
|
|
44
|
+
usecortex_ai/sources/raw_client.py,sha256=Pz8q9bSzMmUSPHofHA5FyS8xisaDdkEK_CANl-pvOZI,12266
|
|
45
|
+
usecortex_ai/tenant/__init__.py,sha256=_VhToAyIt_5axN6CLJwtxg3-CO7THa_23pbUzqhXJa4,85
|
|
46
|
+
usecortex_ai/tenant/client.py,sha256=ZtNt7-ODnzc2wALqXvfF9uYmetucg96MrWdIpKOh_G4,10992
|
|
47
|
+
usecortex_ai/tenant/raw_client.py,sha256=wQtQ4iDcUrXM1BGL88cyRF_xxrk93RIQqNGCmP8aVJg,27306
|
|
48
|
+
usecortex_ai/types/__init__.py,sha256=VemryNPm7-iFi7IGSyOGUQswcMtsYM8ER8JtncJFVfg,4353
|
|
49
|
+
usecortex_ai/types/actual_error_response.py,sha256=EBit_JO3u0FQrVAXDg0UXQktlULLPLtX8FF8J9mZSvY,580
|
|
50
|
+
usecortex_ai/types/add_memory_response.py,sha256=OdU5jKhjzznhUCkNTTyr_f0HlDAv-QixHP1ArDK9dqI,1133
|
|
51
|
+
usecortex_ai/types/api_key_info.py,sha256=spbHgc87xD5S2SChMa4Is7z1ZIdTP8aDA3YeQXENhyA,998
|
|
52
|
+
usecortex_ai/types/app_sources_upload_data.py,sha256=mn4yguv8lip1Emeh6yHuwjObgShImnPOsuzb_-FbO18,1152
|
|
53
|
+
usecortex_ai/types/attachment_model.py,sha256=gyIlSbj2fz8VJ6fo03-2FntXd0zZ5w53Ij-LN3PhjYg,1600
|
|
54
|
+
usecortex_ai/types/bm_25_operator_type.py,sha256=wiromvB4YjgxKQcS1-1BNBZ7MqKP1JzBEbY1R8K-wq4,153
|
|
55
|
+
usecortex_ai/types/collection_stats.py,sha256=rY87NzGGIIYxLpsHTivB68N5X2TSSVz2mUF8FsZMmEo,698
|
|
56
|
+
usecortex_ai/types/content_model.py,sha256=7KsEMncTZK90gWsjjVfrmOxOndM2HODIOUHclQU6ysE,1738
|
|
57
|
+
usecortex_ai/types/custom_property_definition.py,sha256=_3jlwXA63iFf3Qe5q_nY-fYS0pugC1qnig-HZSFF6pk,2598
|
|
58
|
+
usecortex_ai/types/dashboard_apis_response.py,sha256=k3PeI7Ee_wBRGtEOOxaQyRHaVZkYqsF4FaUKfP7fkHo,857
|
|
59
|
+
usecortex_ai/types/dashboard_sources_response.py,sha256=NfFKP-Rr1KgeeE2rdbmu_c26BL7tQfqZJHH4H4yPutM,859
|
|
60
|
+
usecortex_ai/types/dashboard_tenants_response.py,sha256=0qzekJDd1wFb6pyNS9dDth6KQf8ENbY9Q4wTQgcQ_8s,856
|
|
61
|
+
usecortex_ai/types/delete_result.py,sha256=27hEVC8FZWrX6GANrCH1ANR7ayaaIrmWCRHko3AJHEM,864
|
|
62
|
+
usecortex_ai/types/delete_user_memory_response.py,sha256=A3AkQUBrbcpjx_y6oSJgiHF7KPQ2xg2WwB1lp5dgmzE,862
|
|
63
|
+
usecortex_ai/types/entity.py,sha256=gMOML5b06-oDAqp8Ql9kzd4__4rnquemVSm9mF8x9Fo,1053
|
|
64
|
+
usecortex_ai/types/error_response.py,sha256=7_MuOTWE3zj6kg6UptuYBFMAhV3KZGEkpsyirFvHJzA,633
|
|
65
|
+
usecortex_ai/types/fetch_mode.py,sha256=9Mfz10_iyUNgvNYYm7TrpOT0hrOb01DDdulEMa9GzVM,159
|
|
66
|
+
usecortex_ai/types/forceful_relations_payload.py,sha256=gA8H4QiMA_64sAAFrFIFoCsVrnmAqudoenJkuq6vZyE,875
|
|
67
|
+
usecortex_ai/types/graph_context.py,sha256=3EnA98Aj7s583d43Nu7t9XvB7G-HOZiK0gmMs6g5KqU,890
|
|
68
|
+
usecortex_ai/types/http_validation_error.py,sha256=NNTK9AbbHXm0n9m1YcsG5zEaSn1n6RghohUX5R8LGzw,623
|
|
69
|
+
usecortex_ai/types/infra.py,sha256=Fa-Dck9ndGmiqztyYszIon5nGeZ806sF223zoR13Mps,613
|
|
70
|
+
usecortex_ai/types/insert_result.py,sha256=0znvjKKAZlyzdaKB4xF0cuwghO3Z1wX7TdHUEOGsiwc,981
|
|
71
|
+
usecortex_ai/types/memory_item.py,sha256=SYyrb1oo38EJe3QJRL5Vd5D6Gu3T38nGPymjhp2Td2A,2926
|
|
72
|
+
usecortex_ai/types/memory_result_item.py,sha256=FVsWLemKSQUPiFFmUQ06KXWrYzTeDWNVy75Z1MJNMd4,1204
|
|
73
|
+
usecortex_ai/types/milvus_data_type.py,sha256=1PwgQNQGx2Ti1KgFSfpIbx5P9tprTk3hMncGbA-28Sk,381
|
|
74
|
+
usecortex_ai/types/path_triplet.py,sha256=Yik6VXD7PI5C8mvEmcmib1nSJg3AhEu9b0UPvTua_yY,648
|
|
75
|
+
usecortex_ai/types/processing_status.py,sha256=C6vDVfLVee_6SL4NFdDmaPqVlDUBFtUXX9jnWFPDyFg,1422
|
|
76
|
+
usecortex_ai/types/processing_status_indexing_status.py,sha256=nS1HfHz6eAXF2CFEoe1NcCcbwvIEXu_Mi2g9fUeuXsA,237
|
|
77
|
+
usecortex_ai/types/qn_a_search_response.py,sha256=xGKi5pkBPQZd-pJKi9t65tGhaTta_IgQF13tAqvQAPk,1432
|
|
78
|
+
usecortex_ai/types/raw_embedding_document.py,sha256=HorAQZpXX3sHegfscd_IHHvhUswQWJ-tgH1i52zybjU,1024
|
|
79
|
+
usecortex_ai/types/raw_embedding_search_result.py,sha256=nrvvBkNF9zN13dKjhxqfAJJHT4sxEavtQ02hd-1QFjM,1243
|
|
80
|
+
usecortex_ai/types/raw_embedding_vector.py,sha256=iujHus3NeEKS3oFd7h02M7cJKJQeWBiiB6kajSHC7no,773
|
|
81
|
+
usecortex_ai/types/relation_evidence.py,sha256=MahpZicfR31USMG-PI3eXSWFCgOOKcR73d0sVt3rfCw,2052
|
|
82
|
+
usecortex_ai/types/retrieval_result.py,sha256=lOxMSuunI5Cx5_iv-kBvNaclX11eopowDgGuOJnemSA,1098
|
|
83
|
+
usecortex_ai/types/retrieve_mode.py,sha256=s2nGRBzRRCu5OPIdXi5hhPZ18qBTVz6_T4qU8PoGJr4,156
|
|
84
|
+
usecortex_ai/types/scored_path_response.py,sha256=VXAzT5KKWGQr5qjArxu85tZxZrvvQV0fGsery-Lf_E4,805
|
|
85
|
+
usecortex_ai/types/search_mode.py,sha256=utxMfGgisoxvHQwIo0y3hf0W0jFlQVnGCUuVpBEEd4k,157
|
|
86
|
+
usecortex_ai/types/source_delete_response.py,sha256=t8vd8PUPZUqtKyTAdSwYbCOXzS9bWVMtI9NorHpZop8,899
|
|
87
|
+
usecortex_ai/types/source_delete_result_item.py,sha256=33fs2KbIF9iCRAe_OAIQe9BK2AuFDaesmxkRPWiIS-c,882
|
|
88
|
+
usecortex_ai/types/source_fetch_response.py,sha256=xFCD_38mWPRD-hN7vc2GsgQJGV6Nn0tRnWBF_hJ7Og0,1845
|
|
89
|
+
usecortex_ai/types/source_graph_relations_response.py,sha256=IA6ssWkqOTyoP7YSOgSaySR3BbWkzvB9VUzfopSgyww,975
|
|
90
|
+
usecortex_ai/types/source_list_response.py,sha256=3_dCPsLJyEi83c1KzXhZ0HLG1HoBdf25k_B6IUPWMuI,792
|
|
91
|
+
usecortex_ai/types/source_model.py,sha256=CI802nMeBtL0_PpzHhFEv7w6FrCBO4w4E-IhAABG9N0,3160
|
|
92
|
+
usecortex_ai/types/source_status.py,sha256=2h-GX25oPb_Xe-aZ0qTAuDIl7x0u_P4rspQhYmzgNu4,183
|
|
93
|
+
usecortex_ai/types/source_upload_response.py,sha256=LVIiMzRqh4f-iyvQjdECXmv8V3oPmoAkd5N8tNPEL6I,1078
|
|
94
|
+
usecortex_ai/types/source_upload_result_item.py,sha256=k0cjElxr4kQi4RN0XFiFqwfVtp9EqIl_bCCTeGdHaHc,1010
|
|
95
|
+
usecortex_ai/types/supported_llm_providers.py,sha256=P42QQdoErm6GChsg7xdn0ItcpOtTCVRlXTe0tjl2Ndw,198
|
|
96
|
+
usecortex_ai/types/tenant_create_response.py,sha256=C6cyT0vSTazqZ_L2l2Kh0PE01vQSg2wALWI3EG5Tpnc,1036
|
|
97
|
+
usecortex_ai/types/tenant_info.py,sha256=fbQNjaVY52civI85_bPF0-aDnzl6gkVNlR-ippTzTk8,742
|
|
98
|
+
usecortex_ai/types/tenant_metadata_schema_info.py,sha256=q4N_rGnguDK-CX-EiYP8bHvvWpfzp4mEwWQ0lEt0I38,1038
|
|
99
|
+
usecortex_ai/types/tenant_stats_response.py,sha256=3i2ObXxLwvBuDxfIgm4kXwwmBHgoIgPBbmUFHmYAqfo,978
|
|
100
|
+
usecortex_ai/types/triplet_with_evidence.py,sha256=Jqgbxo60zi14CdfgecdkKnkXG2Yi-AFXfcrDuZAqd_M,923
|
|
101
|
+
usecortex_ai/types/user_assistant_pair.py,sha256=l0xGFuHHfo9rbD_2jcL_oCL8kq5CFm819AowYRkhUoY,766
|
|
102
|
+
usecortex_ai/types/validation_error.py,sha256=Ou-GSQTdmDFWIFlP_y9ka_EUAavqFEFLonU9srAkJdc,642
|
|
103
|
+
usecortex_ai/types/validation_error_loc_item.py,sha256=LAtjCHIllWRBFXvAZ5QZpp7CPXjdtN9EB7HrLVo6EP0,128
|
|
104
|
+
usecortex_ai/types/vector_store_chunk.py,sha256=fXtMBi8uc2WpBGrU6DTvpt64uY9yiCVXlDCpPywOzeY,2516
|
|
105
|
+
usecortex_ai/upload/__init__.py,sha256=F13WAucSniaKhJJNLe2PAYEbITadfFEaYTIMv-T0ktg,211
|
|
106
|
+
usecortex_ai/upload/client.py,sha256=EAoarsMfEl3YameTFIR2twLCcnuL4qL_n49rukk0O0E,21111
|
|
107
|
+
usecortex_ai/upload/raw_client.py,sha256=f4wdJdckERw6GijhDWRogwTh-oMiJcpVrmTuud3qXyY,61218
|
|
108
|
+
usecortex_ai/upload/types/__init__.py,sha256=hKOtGnwwQrjeCTlNrDhclmhSH1jLNLLmPl-Sb4YC2MU,259
|
|
109
|
+
usecortex_ai/upload/types/body_upload_app_ingestion_upload_app_post_app_sources.py,sha256=MonlCkXtrGYunPHLMnsjlmO_w61qCM08T03WxLIKPvQ,227
|
|
110
|
+
usecortex_ai-0.5.0.dist-info/licenses/LICENSE,sha256=6LmuyFokcoKlKFcADtfwpylDp6lGgp14s0WoS-mMI8k,1266
|
|
111
|
+
usecortex_ai-0.5.0.dist-info/METADATA,sha256=shPLAQTcCDdK-g5QRPUUMhvEriXrqRO6R0YN82xSaBQ,7942
|
|
112
|
+
usecortex_ai-0.5.0.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
113
|
+
usecortex_ai-0.5.0.dist-info/top_level.txt,sha256=TQ77el6hL0CvN7BTXJVFTqZ5ot1_kHKo2ZnEcOvZsjo,13
|
|
114
|
+
usecortex_ai-0.5.0.dist-info/RECORD,,
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
Copyright (c) 2024 Cortex AI
|
|
2
|
-
|
|
3
|
-
All Rights Reserved.
|
|
4
|
-
|
|
5
|
-
PROPRIETARY AND CONFIDENTIAL
|
|
6
|
-
|
|
7
|
-
This software is the proprietary and confidential property of Cortex AI ("the Company").
|
|
8
|
-
Permission is hereby granted to users to install and use this software as part of the Cortex AI service, subject to the terms and conditions of the service agreement entered into with the Company.
|
|
9
|
-
|
|
10
|
-
You may not, without the express written permission of the Company:
|
|
11
|
-
|
|
12
|
-
1. Copy, modify, or create derivative works of the software.
|
|
13
|
-
2. Distribute, sell, rent, lease, sublicense, or otherwise transfer the software to any third party.
|
|
14
|
-
3. Reverse engineer, decompile, or disassemble the software, except and only to the extent that such activity is expressly permitted by applicable law notwithstanding this limitation.
|
|
15
|
-
|
|
16
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
1
|
+
Copyright (c) 2024 Cortex AI
|
|
2
|
+
|
|
3
|
+
All Rights Reserved.
|
|
4
|
+
|
|
5
|
+
PROPRIETARY AND CONFIDENTIAL
|
|
6
|
+
|
|
7
|
+
This software is the proprietary and confidential property of Cortex AI ("the Company").
|
|
8
|
+
Permission is hereby granted to users to install and use this software as part of the Cortex AI service, subject to the terms and conditions of the service agreement entered into with the Company.
|
|
9
|
+
|
|
10
|
+
You may not, without the express written permission of the Company:
|
|
11
|
+
|
|
12
|
+
1. Copy, modify, or create derivative works of the software.
|
|
13
|
+
2. Distribute, sell, rent, lease, sublicense, or otherwise transfer the software to any third party.
|
|
14
|
+
3. Reverse engineer, decompile, or disassemble the software, except and only to the extent that such activity is expressly permitted by applicable law notwithstanding this limitation.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
22
|
SOFTWARE.
|
|
File without changes
|
usecortex_ai/document/client.py
DELETED
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
-
|
|
3
|
-
import typing
|
|
4
|
-
|
|
5
|
-
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
6
|
-
from ..core.request_options import RequestOptions
|
|
7
|
-
from ..types.delete_sources import DeleteSources
|
|
8
|
-
from .raw_client import AsyncRawDocumentClient, RawDocumentClient
|
|
9
|
-
|
|
10
|
-
# this is used as the default value for optional parameters
|
|
11
|
-
OMIT = typing.cast(typing.Any, ...)
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
class DocumentClient:
|
|
15
|
-
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
16
|
-
self._raw_client = RawDocumentClient(client_wrapper=client_wrapper)
|
|
17
|
-
|
|
18
|
-
@property
|
|
19
|
-
def with_raw_response(self) -> RawDocumentClient:
|
|
20
|
-
"""
|
|
21
|
-
Retrieves a raw implementation of this client that returns raw responses.
|
|
22
|
-
|
|
23
|
-
Returns
|
|
24
|
-
-------
|
|
25
|
-
RawDocumentClient
|
|
26
|
-
"""
|
|
27
|
-
return self._raw_client
|
|
28
|
-
|
|
29
|
-
def delete(
|
|
30
|
-
self,
|
|
31
|
-
*,
|
|
32
|
-
tenant_id: str,
|
|
33
|
-
source_ids: typing.Sequence[str],
|
|
34
|
-
sub_tenant_id: typing.Optional[str] = OMIT,
|
|
35
|
-
request_options: typing.Optional[RequestOptions] = None,
|
|
36
|
-
) -> DeleteSources:
|
|
37
|
-
"""
|
|
38
|
-
Remove documents and content from your knowledge base.
|
|
39
|
-
|
|
40
|
-
This endpoint permanently deletes the specified sources from your knowledge base. Once deleted, the content will no longer be available for search or retrieval.
|
|
41
|
-
|
|
42
|
-
Use this carefully as the action cannot be undone. The system will confirm successful deletion of each source ID you specify.
|
|
43
|
-
|
|
44
|
-
Parameters
|
|
45
|
-
----------
|
|
46
|
-
tenant_id : str
|
|
47
|
-
Unique identifier for the tenant/organization
|
|
48
|
-
|
|
49
|
-
source_ids : typing.Sequence[str]
|
|
50
|
-
List of source IDs to delete
|
|
51
|
-
|
|
52
|
-
sub_tenant_id : typing.Optional[str]
|
|
53
|
-
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
54
|
-
|
|
55
|
-
request_options : typing.Optional[RequestOptions]
|
|
56
|
-
Request-specific configuration.
|
|
57
|
-
|
|
58
|
-
Returns
|
|
59
|
-
-------
|
|
60
|
-
DeleteSources
|
|
61
|
-
Successful Response
|
|
62
|
-
|
|
63
|
-
Examples
|
|
64
|
-
--------
|
|
65
|
-
from usecortex-ai import CortexAI
|
|
66
|
-
|
|
67
|
-
client = CortexAI(token="YOUR_TOKEN", )
|
|
68
|
-
client.document.delete(tenant_id='tenant_1234', source_ids=['CortexDoc1234', 'CortexDoc4567'], )
|
|
69
|
-
"""
|
|
70
|
-
_response = self._raw_client.delete(
|
|
71
|
-
tenant_id=tenant_id, source_ids=source_ids, sub_tenant_id=sub_tenant_id, request_options=request_options
|
|
72
|
-
)
|
|
73
|
-
return _response.data
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
class AsyncDocumentClient:
|
|
77
|
-
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
78
|
-
self._raw_client = AsyncRawDocumentClient(client_wrapper=client_wrapper)
|
|
79
|
-
|
|
80
|
-
@property
|
|
81
|
-
def with_raw_response(self) -> AsyncRawDocumentClient:
|
|
82
|
-
"""
|
|
83
|
-
Retrieves a raw implementation of this client that returns raw responses.
|
|
84
|
-
|
|
85
|
-
Returns
|
|
86
|
-
-------
|
|
87
|
-
AsyncRawDocumentClient
|
|
88
|
-
"""
|
|
89
|
-
return self._raw_client
|
|
90
|
-
|
|
91
|
-
async def delete(
|
|
92
|
-
self,
|
|
93
|
-
*,
|
|
94
|
-
tenant_id: str,
|
|
95
|
-
source_ids: typing.Sequence[str],
|
|
96
|
-
sub_tenant_id: typing.Optional[str] = OMIT,
|
|
97
|
-
request_options: typing.Optional[RequestOptions] = None,
|
|
98
|
-
) -> DeleteSources:
|
|
99
|
-
"""
|
|
100
|
-
Remove documents and content from your knowledge base.
|
|
101
|
-
|
|
102
|
-
This endpoint permanently deletes the specified sources from your knowledge base. Once deleted, the content will no longer be available for search or retrieval.
|
|
103
|
-
|
|
104
|
-
Use this carefully as the action cannot be undone. The system will confirm successful deletion of each source ID you specify.
|
|
105
|
-
|
|
106
|
-
Parameters
|
|
107
|
-
----------
|
|
108
|
-
tenant_id : str
|
|
109
|
-
Unique identifier for the tenant/organization
|
|
110
|
-
|
|
111
|
-
source_ids : typing.Sequence[str]
|
|
112
|
-
List of source IDs to delete
|
|
113
|
-
|
|
114
|
-
sub_tenant_id : typing.Optional[str]
|
|
115
|
-
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
116
|
-
|
|
117
|
-
request_options : typing.Optional[RequestOptions]
|
|
118
|
-
Request-specific configuration.
|
|
119
|
-
|
|
120
|
-
Returns
|
|
121
|
-
-------
|
|
122
|
-
DeleteSources
|
|
123
|
-
Successful Response
|
|
124
|
-
|
|
125
|
-
Examples
|
|
126
|
-
--------
|
|
127
|
-
import asyncio
|
|
128
|
-
|
|
129
|
-
from usecortex-ai import AsyncCortexAI
|
|
130
|
-
|
|
131
|
-
client = AsyncCortexAI(token="YOUR_TOKEN", )
|
|
132
|
-
async def main() -> None:
|
|
133
|
-
await client.document.delete(tenant_id='tenant_1234', source_ids=['CortexDoc1234', 'CortexDoc4567'], )
|
|
134
|
-
asyncio.run(main())
|
|
135
|
-
"""
|
|
136
|
-
_response = await self._raw_client.delete(
|
|
137
|
-
tenant_id=tenant_id, source_ids=source_ids, sub_tenant_id=sub_tenant_id, request_options=request_options
|
|
138
|
-
)
|
|
139
|
-
return _response.data
|
|
@@ -1,312 +0,0 @@
|
|
|
1
|
-
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
-
|
|
3
|
-
import typing
|
|
4
|
-
from json.decoder import JSONDecodeError
|
|
5
|
-
|
|
6
|
-
from ..core.api_error import ApiError
|
|
7
|
-
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
8
|
-
from ..core.http_response import AsyncHttpResponse, HttpResponse
|
|
9
|
-
from ..core.pydantic_utilities import parse_obj_as
|
|
10
|
-
from ..core.request_options import RequestOptions
|
|
11
|
-
from ..errors.bad_request_error import BadRequestError
|
|
12
|
-
from ..errors.forbidden_error import ForbiddenError
|
|
13
|
-
from ..errors.internal_server_error import InternalServerError
|
|
14
|
-
from ..errors.not_found_error import NotFoundError
|
|
15
|
-
from ..errors.service_unavailable_error import ServiceUnavailableError
|
|
16
|
-
from ..errors.unauthorized_error import UnauthorizedError
|
|
17
|
-
from ..errors.unprocessable_entity_error import UnprocessableEntityError
|
|
18
|
-
from ..types.actual_error_response import ActualErrorResponse
|
|
19
|
-
from ..types.delete_sources import DeleteSources
|
|
20
|
-
|
|
21
|
-
# this is used as the default value for optional parameters
|
|
22
|
-
OMIT = typing.cast(typing.Any, ...)
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
class RawDocumentClient:
|
|
26
|
-
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
27
|
-
self._client_wrapper = client_wrapper
|
|
28
|
-
|
|
29
|
-
def delete(
|
|
30
|
-
self,
|
|
31
|
-
*,
|
|
32
|
-
tenant_id: str,
|
|
33
|
-
source_ids: typing.Sequence[str],
|
|
34
|
-
sub_tenant_id: typing.Optional[str] = OMIT,
|
|
35
|
-
request_options: typing.Optional[RequestOptions] = None,
|
|
36
|
-
) -> HttpResponse[DeleteSources]:
|
|
37
|
-
"""
|
|
38
|
-
Remove documents and content from your knowledge base.
|
|
39
|
-
|
|
40
|
-
This endpoint permanently deletes the specified sources from your knowledge base. Once deleted, the content will no longer be available for search or retrieval.
|
|
41
|
-
|
|
42
|
-
Use this carefully as the action cannot be undone. The system will confirm successful deletion of each source ID you specify.
|
|
43
|
-
|
|
44
|
-
Parameters
|
|
45
|
-
----------
|
|
46
|
-
tenant_id : str
|
|
47
|
-
Unique identifier for the tenant/organization
|
|
48
|
-
|
|
49
|
-
source_ids : typing.Sequence[str]
|
|
50
|
-
List of source IDs to delete
|
|
51
|
-
|
|
52
|
-
sub_tenant_id : typing.Optional[str]
|
|
53
|
-
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
54
|
-
|
|
55
|
-
request_options : typing.Optional[RequestOptions]
|
|
56
|
-
Request-specific configuration.
|
|
57
|
-
|
|
58
|
-
Returns
|
|
59
|
-
-------
|
|
60
|
-
HttpResponse[DeleteSources]
|
|
61
|
-
Successful Response
|
|
62
|
-
"""
|
|
63
|
-
_response = self._client_wrapper.httpx_client.request(
|
|
64
|
-
"document/delete",
|
|
65
|
-
method="DELETE",
|
|
66
|
-
json={
|
|
67
|
-
"tenant_id": tenant_id,
|
|
68
|
-
"source_ids": source_ids,
|
|
69
|
-
"sub_tenant_id": sub_tenant_id,
|
|
70
|
-
},
|
|
71
|
-
headers={
|
|
72
|
-
"content-type": "application/json",
|
|
73
|
-
},
|
|
74
|
-
request_options=request_options,
|
|
75
|
-
omit=OMIT,
|
|
76
|
-
)
|
|
77
|
-
try:
|
|
78
|
-
if 200 <= _response.status_code < 300:
|
|
79
|
-
_data = typing.cast(
|
|
80
|
-
DeleteSources,
|
|
81
|
-
parse_obj_as(
|
|
82
|
-
type_=DeleteSources, # type: ignore
|
|
83
|
-
object_=_response.json(),
|
|
84
|
-
),
|
|
85
|
-
)
|
|
86
|
-
return HttpResponse(response=_response, data=_data)
|
|
87
|
-
if _response.status_code == 400:
|
|
88
|
-
raise BadRequestError(
|
|
89
|
-
headers=dict(_response.headers),
|
|
90
|
-
body=typing.cast(
|
|
91
|
-
ActualErrorResponse,
|
|
92
|
-
parse_obj_as(
|
|
93
|
-
type_=ActualErrorResponse, # type: ignore
|
|
94
|
-
object_=_response.json(),
|
|
95
|
-
),
|
|
96
|
-
),
|
|
97
|
-
)
|
|
98
|
-
if _response.status_code == 401:
|
|
99
|
-
raise UnauthorizedError(
|
|
100
|
-
headers=dict(_response.headers),
|
|
101
|
-
body=typing.cast(
|
|
102
|
-
ActualErrorResponse,
|
|
103
|
-
parse_obj_as(
|
|
104
|
-
type_=ActualErrorResponse, # type: ignore
|
|
105
|
-
object_=_response.json(),
|
|
106
|
-
),
|
|
107
|
-
),
|
|
108
|
-
)
|
|
109
|
-
if _response.status_code == 403:
|
|
110
|
-
raise ForbiddenError(
|
|
111
|
-
headers=dict(_response.headers),
|
|
112
|
-
body=typing.cast(
|
|
113
|
-
ActualErrorResponse,
|
|
114
|
-
parse_obj_as(
|
|
115
|
-
type_=ActualErrorResponse, # type: ignore
|
|
116
|
-
object_=_response.json(),
|
|
117
|
-
),
|
|
118
|
-
),
|
|
119
|
-
)
|
|
120
|
-
if _response.status_code == 404:
|
|
121
|
-
raise NotFoundError(
|
|
122
|
-
headers=dict(_response.headers),
|
|
123
|
-
body=typing.cast(
|
|
124
|
-
ActualErrorResponse,
|
|
125
|
-
parse_obj_as(
|
|
126
|
-
type_=ActualErrorResponse, # type: ignore
|
|
127
|
-
object_=_response.json(),
|
|
128
|
-
),
|
|
129
|
-
),
|
|
130
|
-
)
|
|
131
|
-
if _response.status_code == 422:
|
|
132
|
-
raise UnprocessableEntityError(
|
|
133
|
-
headers=dict(_response.headers),
|
|
134
|
-
body=typing.cast(
|
|
135
|
-
typing.Optional[typing.Any],
|
|
136
|
-
parse_obj_as(
|
|
137
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
|
138
|
-
object_=_response.json(),
|
|
139
|
-
),
|
|
140
|
-
),
|
|
141
|
-
)
|
|
142
|
-
if _response.status_code == 500:
|
|
143
|
-
raise InternalServerError(
|
|
144
|
-
headers=dict(_response.headers),
|
|
145
|
-
body=typing.cast(
|
|
146
|
-
ActualErrorResponse,
|
|
147
|
-
parse_obj_as(
|
|
148
|
-
type_=ActualErrorResponse, # type: ignore
|
|
149
|
-
object_=_response.json(),
|
|
150
|
-
),
|
|
151
|
-
),
|
|
152
|
-
)
|
|
153
|
-
if _response.status_code == 503:
|
|
154
|
-
raise ServiceUnavailableError(
|
|
155
|
-
headers=dict(_response.headers),
|
|
156
|
-
body=typing.cast(
|
|
157
|
-
ActualErrorResponse,
|
|
158
|
-
parse_obj_as(
|
|
159
|
-
type_=ActualErrorResponse, # type: ignore
|
|
160
|
-
object_=_response.json(),
|
|
161
|
-
),
|
|
162
|
-
),
|
|
163
|
-
)
|
|
164
|
-
_response_json = _response.json()
|
|
165
|
-
except JSONDecodeError:
|
|
166
|
-
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
167
|
-
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
class AsyncRawDocumentClient:
|
|
171
|
-
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
172
|
-
self._client_wrapper = client_wrapper
|
|
173
|
-
|
|
174
|
-
async def delete(
|
|
175
|
-
self,
|
|
176
|
-
*,
|
|
177
|
-
tenant_id: str,
|
|
178
|
-
source_ids: typing.Sequence[str],
|
|
179
|
-
sub_tenant_id: typing.Optional[str] = OMIT,
|
|
180
|
-
request_options: typing.Optional[RequestOptions] = None,
|
|
181
|
-
) -> AsyncHttpResponse[DeleteSources]:
|
|
182
|
-
"""
|
|
183
|
-
Remove documents and content from your knowledge base.
|
|
184
|
-
|
|
185
|
-
This endpoint permanently deletes the specified sources from your knowledge base. Once deleted, the content will no longer be available for search or retrieval.
|
|
186
|
-
|
|
187
|
-
Use this carefully as the action cannot be undone. The system will confirm successful deletion of each source ID you specify.
|
|
188
|
-
|
|
189
|
-
Parameters
|
|
190
|
-
----------
|
|
191
|
-
tenant_id : str
|
|
192
|
-
Unique identifier for the tenant/organization
|
|
193
|
-
|
|
194
|
-
source_ids : typing.Sequence[str]
|
|
195
|
-
List of source IDs to delete
|
|
196
|
-
|
|
197
|
-
sub_tenant_id : typing.Optional[str]
|
|
198
|
-
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
|
|
199
|
-
|
|
200
|
-
request_options : typing.Optional[RequestOptions]
|
|
201
|
-
Request-specific configuration.
|
|
202
|
-
|
|
203
|
-
Returns
|
|
204
|
-
-------
|
|
205
|
-
AsyncHttpResponse[DeleteSources]
|
|
206
|
-
Successful Response
|
|
207
|
-
"""
|
|
208
|
-
_response = await self._client_wrapper.httpx_client.request(
|
|
209
|
-
"document/delete",
|
|
210
|
-
method="DELETE",
|
|
211
|
-
json={
|
|
212
|
-
"tenant_id": tenant_id,
|
|
213
|
-
"source_ids": source_ids,
|
|
214
|
-
"sub_tenant_id": sub_tenant_id,
|
|
215
|
-
},
|
|
216
|
-
headers={
|
|
217
|
-
"content-type": "application/json",
|
|
218
|
-
},
|
|
219
|
-
request_options=request_options,
|
|
220
|
-
omit=OMIT,
|
|
221
|
-
)
|
|
222
|
-
try:
|
|
223
|
-
if 200 <= _response.status_code < 300:
|
|
224
|
-
_data = typing.cast(
|
|
225
|
-
DeleteSources,
|
|
226
|
-
parse_obj_as(
|
|
227
|
-
type_=DeleteSources, # type: ignore
|
|
228
|
-
object_=_response.json(),
|
|
229
|
-
),
|
|
230
|
-
)
|
|
231
|
-
return AsyncHttpResponse(response=_response, data=_data)
|
|
232
|
-
if _response.status_code == 400:
|
|
233
|
-
raise BadRequestError(
|
|
234
|
-
headers=dict(_response.headers),
|
|
235
|
-
body=typing.cast(
|
|
236
|
-
ActualErrorResponse,
|
|
237
|
-
parse_obj_as(
|
|
238
|
-
type_=ActualErrorResponse, # type: ignore
|
|
239
|
-
object_=_response.json(),
|
|
240
|
-
),
|
|
241
|
-
),
|
|
242
|
-
)
|
|
243
|
-
if _response.status_code == 401:
|
|
244
|
-
raise UnauthorizedError(
|
|
245
|
-
headers=dict(_response.headers),
|
|
246
|
-
body=typing.cast(
|
|
247
|
-
ActualErrorResponse,
|
|
248
|
-
parse_obj_as(
|
|
249
|
-
type_=ActualErrorResponse, # type: ignore
|
|
250
|
-
object_=_response.json(),
|
|
251
|
-
),
|
|
252
|
-
),
|
|
253
|
-
)
|
|
254
|
-
if _response.status_code == 403:
|
|
255
|
-
raise ForbiddenError(
|
|
256
|
-
headers=dict(_response.headers),
|
|
257
|
-
body=typing.cast(
|
|
258
|
-
ActualErrorResponse,
|
|
259
|
-
parse_obj_as(
|
|
260
|
-
type_=ActualErrorResponse, # type: ignore
|
|
261
|
-
object_=_response.json(),
|
|
262
|
-
),
|
|
263
|
-
),
|
|
264
|
-
)
|
|
265
|
-
if _response.status_code == 404:
|
|
266
|
-
raise NotFoundError(
|
|
267
|
-
headers=dict(_response.headers),
|
|
268
|
-
body=typing.cast(
|
|
269
|
-
ActualErrorResponse,
|
|
270
|
-
parse_obj_as(
|
|
271
|
-
type_=ActualErrorResponse, # type: ignore
|
|
272
|
-
object_=_response.json(),
|
|
273
|
-
),
|
|
274
|
-
),
|
|
275
|
-
)
|
|
276
|
-
if _response.status_code == 422:
|
|
277
|
-
raise UnprocessableEntityError(
|
|
278
|
-
headers=dict(_response.headers),
|
|
279
|
-
body=typing.cast(
|
|
280
|
-
typing.Optional[typing.Any],
|
|
281
|
-
parse_obj_as(
|
|
282
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
|
283
|
-
object_=_response.json(),
|
|
284
|
-
),
|
|
285
|
-
),
|
|
286
|
-
)
|
|
287
|
-
if _response.status_code == 500:
|
|
288
|
-
raise InternalServerError(
|
|
289
|
-
headers=dict(_response.headers),
|
|
290
|
-
body=typing.cast(
|
|
291
|
-
ActualErrorResponse,
|
|
292
|
-
parse_obj_as(
|
|
293
|
-
type_=ActualErrorResponse, # type: ignore
|
|
294
|
-
object_=_response.json(),
|
|
295
|
-
),
|
|
296
|
-
),
|
|
297
|
-
)
|
|
298
|
-
if _response.status_code == 503:
|
|
299
|
-
raise ServiceUnavailableError(
|
|
300
|
-
headers=dict(_response.headers),
|
|
301
|
-
body=typing.cast(
|
|
302
|
-
ActualErrorResponse,
|
|
303
|
-
parse_obj_as(
|
|
304
|
-
type_=ActualErrorResponse, # type: ignore
|
|
305
|
-
object_=_response.json(),
|
|
306
|
-
),
|
|
307
|
-
),
|
|
308
|
-
)
|
|
309
|
-
_response_json = _response.json()
|
|
310
|
-
except JSONDecodeError:
|
|
311
|
-
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
312
|
-
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|