usecortex-ai 0.2.0__py3-none-any.whl → 0.2.2__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 (64) hide show
  1. usecortex_ai/__init__.py +20 -3
  2. usecortex_ai/client.py +7 -78
  3. usecortex_ai/core/client_wrapper.py +6 -8
  4. usecortex_ai/document/__init__.py +4 -0
  5. usecortex_ai/document/client.py +139 -0
  6. usecortex_ai/document/raw_client.py +312 -0
  7. usecortex_ai/embeddings/client.py +50 -82
  8. usecortex_ai/embeddings/raw_client.py +48 -80
  9. usecortex_ai/fetch/client.py +10 -0
  10. usecortex_ai/fetch/raw_client.py +10 -0
  11. usecortex_ai/search/client.py +74 -80
  12. usecortex_ai/search/raw_client.py +74 -80
  13. usecortex_ai/sources/client.py +28 -0
  14. usecortex_ai/sources/raw_client.py +28 -0
  15. usecortex_ai/tenant/client.py +152 -4
  16. usecortex_ai/tenant/raw_client.py +502 -4
  17. usecortex_ai/types/__init__.py +18 -2
  18. usecortex_ai/types/add_user_memory_response.py +36 -0
  19. usecortex_ai/types/app_sources_upload_data.py +10 -2
  20. usecortex_ai/types/attachment_model.py +34 -7
  21. usecortex_ai/types/batch_upload_data.py +10 -2
  22. usecortex_ai/types/body_scrape_webpage_upload_scrape_webpage_post.py +0 -2
  23. usecortex_ai/types/body_update_scrape_job_upload_update_webpage_patch.py +0 -2
  24. usecortex_ai/types/content_model.py +33 -6
  25. usecortex_ai/types/delete_memory_request.py +14 -3
  26. usecortex_ai/types/delete_sources.py +20 -0
  27. usecortex_ai/types/delete_sub_tenant_data.py +42 -0
  28. usecortex_ai/types/delete_user_memory_response.py +31 -0
  29. usecortex_ai/types/embeddings_create_collection_data.py +19 -4
  30. usecortex_ai/types/embeddings_delete_data.py +19 -4
  31. usecortex_ai/types/embeddings_get_data.py +19 -4
  32. usecortex_ai/types/embeddings_search_data.py +19 -4
  33. usecortex_ai/types/error_response.py +0 -1
  34. usecortex_ai/types/fetch_content_data.py +19 -5
  35. usecortex_ai/types/file_upload_result.py +9 -2
  36. usecortex_ai/types/generate_user_memory_response.py +32 -0
  37. usecortex_ai/types/list_sources_response.py +14 -3
  38. usecortex_ai/types/list_user_memories_response.py +32 -0
  39. usecortex_ai/types/markdown_upload_request.py +18 -3
  40. usecortex_ai/types/processing_status.py +14 -3
  41. usecortex_ai/types/relations.py +2 -2
  42. usecortex_ai/types/retrieve_user_memory_response.py +32 -0
  43. usecortex_ai/types/search_chunk.py +54 -16
  44. usecortex_ai/types/single_upload_data.py +10 -2
  45. usecortex_ai/types/source.py +34 -14
  46. usecortex_ai/types/source_model.py +63 -12
  47. usecortex_ai/types/sub_tenant_ids_data.py +42 -0
  48. usecortex_ai/types/tenant_create_data.py +19 -4
  49. usecortex_ai/types/tenant_stats.py +24 -5
  50. usecortex_ai/types/user_memory.py +31 -0
  51. usecortex_ai/upload/client.py +508 -132
  52. usecortex_ai/upload/raw_client.py +492 -152
  53. usecortex_ai/user/client.py +14 -6
  54. usecortex_ai/user/raw_client.py +14 -6
  55. usecortex_ai/user_memory/client.py +184 -50
  56. usecortex_ai/user_memory/raw_client.py +905 -88
  57. {usecortex_ai-0.2.0.dist-info → usecortex_ai-0.2.2.dist-info}/METADATA +1 -1
  58. usecortex_ai-0.2.2.dist-info/RECORD +100 -0
  59. usecortex_ai/raw_client.py +0 -90
  60. usecortex_ai/types/source_content.py +0 -26
  61. usecortex_ai-0.2.0.dist-info/RECORD +0 -90
  62. {usecortex_ai-0.2.0.dist-info → usecortex_ai-0.2.2.dist-info}/WHEEL +0 -0
  63. {usecortex_ai-0.2.0.dist-info → usecortex_ai-0.2.2.dist-info}/licenses/LICENSE +0 -0
  64. {usecortex_ai-0.2.0.dist-info → usecortex_ai-0.2.2.dist-info}/top_level.txt +0 -0
@@ -38,28 +38,20 @@ class RawEmbeddingsClient:
38
38
  request_options: typing.Optional[RequestOptions] = None,
39
39
  ) -> HttpResponse[EmbeddingsDeleteData]:
40
40
  """
41
- Delete specific embedding chunks from indexed sources.
41
+ Delete embedding chunks by chunk ID.
42
42
 
43
- This endpoint deletes specified embedding chunks from the Findr backend by sending
44
- chunk IDs to the backend delete service.
45
-
46
- Args:
47
- request (EmbeddingsDeleteRequest): The delete request containing:
48
- - chunk_ids (List[str]): List of chunk IDs to delete
49
- - tenant_id (str): Tenant identifier for multi-tenancy
50
- - sub_tenant_id (str, optional): Sub-tenant identifier, defaults to tenant_id
51
- api_details (dict): Authentication details obtained from API key validation
52
-
53
- Returns:
54
- EmbeddingsDeleteData: Success response with deletion details
43
+ Use this to remove specific chunks from your embeddings index when they are no longer valid or should not appear in results.
55
44
 
56
45
  Parameters
57
46
  ----------
58
47
  chunk_ids : typing.Sequence[str]
48
+ The chunk IDs of the source you want to delete
59
49
 
60
50
  tenant_id : str
51
+ Unique identifier for the tenant/organization
61
52
 
62
53
  sub_tenant_id : typing.Optional[str]
54
+ Optional sub-tenant identifier for organizing data within a tenant. If not provided, defaults to tenant_id
63
55
 
64
56
  request_options : typing.Optional[RequestOptions]
65
57
  Request-specific configuration.
@@ -178,37 +170,31 @@ class RawEmbeddingsClient:
178
170
  def search(
179
171
  self,
180
172
  *,
181
- embeddings: typing.Sequence[float],
182
173
  tenant_id: str,
174
+ embeddings: typing.Optional[typing.Sequence[float]] = OMIT,
183
175
  sub_tenant_id: typing.Optional[str] = OMIT,
184
176
  max_chunks: typing.Optional[int] = OMIT,
185
177
  request_options: typing.Optional[RequestOptions] = None,
186
178
  ) -> HttpResponse[EmbeddingsSearchData]:
187
179
  """
188
- Search for similar embedding chunks using vector similarity.
180
+ Find similar chunks using an embedding vector.
189
181
 
190
- This endpoint performs semantic search by sending an embedding vector to the Findr backend
191
- and returns a list of the most similar chunk IDs based on vector similarity.
182
+ Use this to retrieve the most similar chunk IDs to a single query embedding.
192
183
 
193
- Args:
194
- request (EmbeddingsSearchRequest): The search request containing:
195
- - embeddings (List[float]): Single embedding vector for similarity search
196
- - tenant_id (str): Tenant identifier for multi-tenancy
197
- - sub_tenant_id (str, optional): Sub-tenant identifier, defaults to tenant_id
198
- - max_chunks (int, optional): Maximum number of chunk IDs to return (default: 10)
199
- api_details (dict): Authentication details obtained from API key validation
200
184
 
201
- Returns:
202
- EmbeddingsSearchData: List of chunk IDs with similarity scores
185
+ Expected outcome
186
+ - You receive the closest chunk IDs with optional similarity scores.
203
187
 
204
188
  Parameters
205
189
  ----------
206
- embeddings : typing.Sequence[float]
207
- Single embedding vector for search
208
-
209
190
  tenant_id : str
191
+ Unique identifier for the tenant/organization
192
+
193
+ embeddings : typing.Optional[typing.Sequence[float]]
194
+ The embedding vector for search
210
195
 
211
196
  sub_tenant_id : typing.Optional[str]
197
+ Optional sub-tenant identifier for organizing data within a tenant. If not provided, defaults to tenant_id
212
198
 
213
199
  max_chunks : typing.Optional[int]
214
200
 
@@ -224,8 +210,8 @@ class RawEmbeddingsClient:
224
210
  "embeddings/search",
225
211
  method="POST",
226
212
  json={
227
- "embeddings": embeddings,
228
213
  "tenant_id": tenant_id,
214
+ "embeddings": embeddings,
229
215
  "sub_tenant_id": sub_tenant_id,
230
216
  "max_chunks": max_chunks,
231
217
  },
@@ -336,20 +322,20 @@ class RawEmbeddingsClient:
336
322
  request_options: typing.Optional[RequestOptions] = None,
337
323
  ) -> HttpResponse[EmbeddingsGetData]:
338
324
  """
339
- Get embeddings based on chunk IDs.
325
+ Retrieve embeddings for specific chunk IDs.
340
326
 
341
- This endpoint returns embeddings for a list of chunk IDs.
342
-
343
- Returns:
344
- EmbeddingsGetData: Embeddings data for the requested chunk IDs
327
+ Use this when you already know the chunk IDs and need their corresponding embeddings.
345
328
 
346
329
  Parameters
347
330
  ----------
348
331
  chunk_ids : typing.Sequence[str]
332
+ The chunk IDs of the source you want to get embeddings for
349
333
 
350
334
  tenant_id : str
335
+ Unique identifier for the tenant/organization
351
336
 
352
337
  sub_tenant_id : typing.Optional[str]
338
+ Optional sub-tenant identifier for organizing data within a tenant. If not provided, defaults to tenant_id
353
339
 
354
340
  request_options : typing.Optional[RequestOptions]
355
341
  Request-specific configuration.
@@ -469,16 +455,14 @@ class RawEmbeddingsClient:
469
455
  self, *, tenant_id: str, request_options: typing.Optional[RequestOptions] = None
470
456
  ) -> HttpResponse[EmbeddingsCreateCollectionData]:
471
457
  """
472
- Create an embeddings collection for the given tenant in Findr.
473
-
474
- sub_tenant_id is set to be the same as tenant_id as per requirements.
458
+ Create an embeddings collection for a tenant.
475
459
 
476
- Returns:
477
- EmbeddingsCreateCollectionData: Success response with collection details
460
+ Use this to initialize storage so you can index and query embeddings for the tenant.
478
461
 
479
462
  Parameters
480
463
  ----------
481
464
  tenant_id : str
465
+ Unique identifier for the tenant/organization
482
466
 
483
467
  request_options : typing.Optional[RequestOptions]
484
468
  Request-specific configuration.
@@ -602,28 +586,20 @@ class AsyncRawEmbeddingsClient:
602
586
  request_options: typing.Optional[RequestOptions] = None,
603
587
  ) -> AsyncHttpResponse[EmbeddingsDeleteData]:
604
588
  """
605
- Delete specific embedding chunks from indexed sources.
589
+ Delete embedding chunks by chunk ID.
606
590
 
607
- This endpoint deletes specified embedding chunks from the Findr backend by sending
608
- chunk IDs to the backend delete service.
609
-
610
- Args:
611
- request (EmbeddingsDeleteRequest): The delete request containing:
612
- - chunk_ids (List[str]): List of chunk IDs to delete
613
- - tenant_id (str): Tenant identifier for multi-tenancy
614
- - sub_tenant_id (str, optional): Sub-tenant identifier, defaults to tenant_id
615
- api_details (dict): Authentication details obtained from API key validation
616
-
617
- Returns:
618
- EmbeddingsDeleteData: Success response with deletion details
591
+ Use this to remove specific chunks from your embeddings index when they are no longer valid or should not appear in results.
619
592
 
620
593
  Parameters
621
594
  ----------
622
595
  chunk_ids : typing.Sequence[str]
596
+ The chunk IDs of the source you want to delete
623
597
 
624
598
  tenant_id : str
599
+ Unique identifier for the tenant/organization
625
600
 
626
601
  sub_tenant_id : typing.Optional[str]
602
+ Optional sub-tenant identifier for organizing data within a tenant. If not provided, defaults to tenant_id
627
603
 
628
604
  request_options : typing.Optional[RequestOptions]
629
605
  Request-specific configuration.
@@ -742,37 +718,31 @@ class AsyncRawEmbeddingsClient:
742
718
  async def search(
743
719
  self,
744
720
  *,
745
- embeddings: typing.Sequence[float],
746
721
  tenant_id: str,
722
+ embeddings: typing.Optional[typing.Sequence[float]] = OMIT,
747
723
  sub_tenant_id: typing.Optional[str] = OMIT,
748
724
  max_chunks: typing.Optional[int] = OMIT,
749
725
  request_options: typing.Optional[RequestOptions] = None,
750
726
  ) -> AsyncHttpResponse[EmbeddingsSearchData]:
751
727
  """
752
- Search for similar embedding chunks using vector similarity.
728
+ Find similar chunks using an embedding vector.
753
729
 
754
- This endpoint performs semantic search by sending an embedding vector to the Findr backend
755
- and returns a list of the most similar chunk IDs based on vector similarity.
730
+ Use this to retrieve the most similar chunk IDs to a single query embedding.
756
731
 
757
- Args:
758
- request (EmbeddingsSearchRequest): The search request containing:
759
- - embeddings (List[float]): Single embedding vector for similarity search
760
- - tenant_id (str): Tenant identifier for multi-tenancy
761
- - sub_tenant_id (str, optional): Sub-tenant identifier, defaults to tenant_id
762
- - max_chunks (int, optional): Maximum number of chunk IDs to return (default: 10)
763
- api_details (dict): Authentication details obtained from API key validation
764
732
 
765
- Returns:
766
- EmbeddingsSearchData: List of chunk IDs with similarity scores
733
+ Expected outcome
734
+ - You receive the closest chunk IDs with optional similarity scores.
767
735
 
768
736
  Parameters
769
737
  ----------
770
- embeddings : typing.Sequence[float]
771
- Single embedding vector for search
772
-
773
738
  tenant_id : str
739
+ Unique identifier for the tenant/organization
740
+
741
+ embeddings : typing.Optional[typing.Sequence[float]]
742
+ The embedding vector for search
774
743
 
775
744
  sub_tenant_id : typing.Optional[str]
745
+ Optional sub-tenant identifier for organizing data within a tenant. If not provided, defaults to tenant_id
776
746
 
777
747
  max_chunks : typing.Optional[int]
778
748
 
@@ -788,8 +758,8 @@ class AsyncRawEmbeddingsClient:
788
758
  "embeddings/search",
789
759
  method="POST",
790
760
  json={
791
- "embeddings": embeddings,
792
761
  "tenant_id": tenant_id,
762
+ "embeddings": embeddings,
793
763
  "sub_tenant_id": sub_tenant_id,
794
764
  "max_chunks": max_chunks,
795
765
  },
@@ -900,20 +870,20 @@ class AsyncRawEmbeddingsClient:
900
870
  request_options: typing.Optional[RequestOptions] = None,
901
871
  ) -> AsyncHttpResponse[EmbeddingsGetData]:
902
872
  """
903
- Get embeddings based on chunk IDs.
873
+ Retrieve embeddings for specific chunk IDs.
904
874
 
905
- This endpoint returns embeddings for a list of chunk IDs.
906
-
907
- Returns:
908
- EmbeddingsGetData: Embeddings data for the requested chunk IDs
875
+ Use this when you already know the chunk IDs and need their corresponding embeddings.
909
876
 
910
877
  Parameters
911
878
  ----------
912
879
  chunk_ids : typing.Sequence[str]
880
+ The chunk IDs of the source you want to get embeddings for
913
881
 
914
882
  tenant_id : str
883
+ Unique identifier for the tenant/organization
915
884
 
916
885
  sub_tenant_id : typing.Optional[str]
886
+ Optional sub-tenant identifier for organizing data within a tenant. If not provided, defaults to tenant_id
917
887
 
918
888
  request_options : typing.Optional[RequestOptions]
919
889
  Request-specific configuration.
@@ -1033,16 +1003,14 @@ class AsyncRawEmbeddingsClient:
1033
1003
  self, *, tenant_id: str, request_options: typing.Optional[RequestOptions] = None
1034
1004
  ) -> AsyncHttpResponse[EmbeddingsCreateCollectionData]:
1035
1005
  """
1036
- Create an embeddings collection for the given tenant in Findr.
1037
-
1038
- sub_tenant_id is set to be the same as tenant_id as per requirements.
1006
+ Create an embeddings collection for a tenant.
1039
1007
 
1040
- Returns:
1041
- EmbeddingsCreateCollectionData: Success response with collection details
1008
+ Use this to initialize storage so you can index and query embeddings for the tenant.
1042
1009
 
1043
1010
  Parameters
1044
1011
  ----------
1045
1012
  tenant_id : str
1013
+ Unique identifier for the tenant/organization
1046
1014
 
1047
1015
  request_options : typing.Optional[RequestOptions]
1048
1016
  Request-specific configuration.
@@ -40,14 +40,19 @@ class FetchClient:
40
40
  Parameters
41
41
  ----------
42
42
  file_id : str
43
+ Unique identifier for the file to fetch
43
44
 
44
45
  file_type : str
46
+ Type of file (e.g., 'app', 'file', or other)
45
47
 
46
48
  tenant_id : str
49
+ Tenant identifier for multi-tenancy
47
50
 
48
51
  return_content : typing.Optional[bool]
52
+ Whether to return the file content along with the URL
49
53
 
50
54
  sub_tenant_id : typing.Optional[str]
55
+ Sub-tenant identifier, defaults to tenant_id if not provided
51
56
 
52
57
  request_options : typing.Optional[RequestOptions]
53
58
  Request-specific configuration.
@@ -104,14 +109,19 @@ class AsyncFetchClient:
104
109
  Parameters
105
110
  ----------
106
111
  file_id : str
112
+ Unique identifier for the file to fetch
107
113
 
108
114
  file_type : str
115
+ Type of file (e.g., 'app', 'file', or other)
109
116
 
110
117
  tenant_id : str
118
+ Tenant identifier for multi-tenancy
111
119
 
112
120
  return_content : typing.Optional[bool]
121
+ Whether to return the file content along with the URL
113
122
 
114
123
  sub_tenant_id : typing.Optional[str]
124
+ Sub-tenant identifier, defaults to tenant_id if not provided
115
125
 
116
126
  request_options : typing.Optional[RequestOptions]
117
127
  Request-specific configuration.
@@ -40,14 +40,19 @@ class RawFetchClient:
40
40
  Parameters
41
41
  ----------
42
42
  file_id : str
43
+ Unique identifier for the file to fetch
43
44
 
44
45
  file_type : str
46
+ Type of file (e.g., 'app', 'file', or other)
45
47
 
46
48
  tenant_id : str
49
+ Tenant identifier for multi-tenancy
47
50
 
48
51
  return_content : typing.Optional[bool]
52
+ Whether to return the file content along with the URL
49
53
 
50
54
  sub_tenant_id : typing.Optional[str]
55
+ Sub-tenant identifier, defaults to tenant_id if not provided
51
56
 
52
57
  request_options : typing.Optional[RequestOptions]
53
58
  Request-specific configuration.
@@ -184,14 +189,19 @@ class AsyncRawFetchClient:
184
189
  Parameters
185
190
  ----------
186
191
  file_id : str
192
+ Unique identifier for the file to fetch
187
193
 
188
194
  file_type : str
195
+ Type of file (e.g., 'app', 'file', or other)
189
196
 
190
197
  tenant_id : str
198
+ Tenant identifier for multi-tenancy
191
199
 
192
200
  return_content : typing.Optional[bool]
201
+ Whether to return the file content along with the URL
193
202
 
194
203
  sub_tenant_id : typing.Optional[str]
204
+ Sub-tenant identifier, defaults to tenant_id if not provided
195
205
 
196
206
  request_options : typing.Optional[RequestOptions]
197
207
  Request-specific configuration.