mixpeek 0.21.7__py3-none-any.whl → 0.22.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.
Files changed (84) hide show
  1. mixpeek/_hooks/types.py +7 -0
  2. mixpeek/_version.py +3 -3
  3. mixpeek/basesdk.py +12 -20
  4. mixpeek/bucketobjects.py +19 -37
  5. mixpeek/buckets.py +19 -31
  6. mixpeek/clusters.py +2 -0
  7. mixpeek/collectioncache.py +6 -0
  8. mixpeek/collections.py +13 -19
  9. mixpeek/features.py +4 -0
  10. mixpeek/health.py +2 -0
  11. mixpeek/httpclient.py +6 -16
  12. mixpeek/models/__init__.py +752 -583
  13. mixpeek/models/blobmodel.py +3 -11
  14. mixpeek/models/bucketcreaterequest.py +3 -11
  15. mixpeek/models/bucketresponse.py +3 -11
  16. mixpeek/models/bucketschemafield_input.py +6 -22
  17. mixpeek/models/bucketschemafield_output.py +6 -22
  18. mixpeek/models/bucketschemafieldbase.py +81 -0
  19. mixpeek/models/bucketschemafieldtype.py +1 -0
  20. mixpeek/models/bucketupdaterequest.py +3 -10
  21. mixpeek/models/collectionmodel.py +3 -11
  22. mixpeek/models/createblobrequest.py +3 -11
  23. mixpeek/models/createcollectionrequest.py +3 -11
  24. mixpeek/models/createnamespacerequest.py +9 -9
  25. mixpeek/models/createobjectrequest.py +3 -11
  26. mixpeek/models/createretrieverrequest.py +8 -16
  27. mixpeek/models/errordetail.py +3 -10
  28. mixpeek/models/featureextractorconfig.py +3 -11
  29. mixpeek/models/featureextractordefinition.py +26 -46
  30. mixpeek/models/interactionresponse.py +3 -11
  31. mixpeek/models/internal/__init__.py +35 -1
  32. mixpeek/models/logicaloperator_input.py +30 -36
  33. mixpeek/models/logicaloperator_output.py +39 -45
  34. mixpeek/models/logicaloperatorbase_input.py +74 -0
  35. mixpeek/models/logicaloperatorbase_output.py +74 -0
  36. mixpeek/models/namespaceresponse.py +17 -6
  37. mixpeek/models/namespacestatus.py +10 -0
  38. mixpeek/models/objectresponse.py +3 -11
  39. mixpeek/models/organizationmodel.py +3 -11
  40. mixpeek/models/retrieverbinding.py +3 -10
  41. mixpeek/models/retrievermodel.py +11 -16
  42. mixpeek/models/retrieverqueryrequest.py +3 -11
  43. mixpeek/models/retrieverschema_input.py +37 -0
  44. mixpeek/models/retrieverschema_output.py +37 -0
  45. mixpeek/models/retrieverschemafield_input.py +91 -0
  46. mixpeek/models/retrieverschemafield_output.py +91 -0
  47. mixpeek/models/searchinteraction.py +3 -11
  48. mixpeek/models/stageconfig_input.py +8 -16
  49. mixpeek/models/stageconfig_output.py +8 -16
  50. mixpeek/models/stagedefinition.py +28 -17
  51. mixpeek/models/stageresponse.py +3 -11
  52. mixpeek/models/updateobjectrequest.py +3 -11
  53. mixpeek/models/usermodel_input.py +3 -11
  54. mixpeek/models/usermodel_output.py +3 -11
  55. mixpeek/namespaces.py +28 -22
  56. mixpeek/organizationnotifications.py +2 -0
  57. mixpeek/organizations.py +13 -13
  58. mixpeek/organizationsusage.py +2 -0
  59. mixpeek/research.py +2 -0
  60. mixpeek/retrieverinteractions.py +13 -19
  61. mixpeek/retrievers.py +21 -39
  62. mixpeek/retrieverstages.py +2 -0
  63. mixpeek/sdk.py +94 -65
  64. mixpeek/sdkconfiguration.py +0 -7
  65. mixpeek/tasks.py +6 -0
  66. mixpeek/taxonomies.py +2 -0
  67. mixpeek/users.py +6 -0
  68. mixpeek/utils/__init__.py +131 -45
  69. mixpeek/utils/datetimes.py +23 -0
  70. mixpeek/utils/serializers.py +32 -3
  71. {mixpeek-0.21.7.dist-info → mixpeek-0.22.0.dist-info}/METADATA +3 -15
  72. {mixpeek-0.21.7.dist-info → mixpeek-0.22.0.dist-info}/RECORD +73 -75
  73. {mixpeek-0.21.7.dist-info → mixpeek-0.22.0.dist-info}/WHEEL +1 -1
  74. mixpeek/collectiondocuments.py +0 -1564
  75. mixpeek/models/batch_delete_documents_v1_collections_collection_identifier_documents_batch_deleteop.py +0 -75
  76. mixpeek/models/batch_update_documents_v1_collections_collection_identifier_documents_batch_putop.py +0 -84
  77. mixpeek/models/delete_document_v1_collections_collection_identifier_documents_document_id_deleteop.py +0 -70
  78. mixpeek/models/documentlistresponse.py +0 -56
  79. mixpeek/models/documentresponse.py +0 -87
  80. mixpeek/models/documentupdate.py +0 -60
  81. mixpeek/models/genericsuccessresponse.py +0 -17
  82. mixpeek/models/get_document_v1_collections_collection_identifier_documents_document_id_getop.py +0 -70
  83. mixpeek/models/list_documents_v1_collections_collection_identifier_documents_getop.py +0 -114
  84. mixpeek/models/update_document_v1_collections_collection_identifier_documents_document_id_putop.py +0 -83
mixpeek/features.py CHANGED
@@ -61,6 +61,7 @@ class Features(BaseSDK):
61
61
 
62
62
  http_res = self.do_request(
63
63
  hook_ctx=HookContext(
64
+ config=self.sdk_configuration,
64
65
  base_url=base_url or "",
65
66
  operation_id="list_feature_extractors_v1_features_extractors_get",
66
67
  oauth2_scopes=[],
@@ -167,6 +168,7 @@ class Features(BaseSDK):
167
168
 
168
169
  http_res = await self.do_request_async(
169
170
  hook_ctx=HookContext(
171
+ config=self.sdk_configuration,
170
172
  base_url=base_url or "",
171
173
  operation_id="list_feature_extractors_v1_features_extractors_get",
172
174
  oauth2_scopes=[],
@@ -280,6 +282,7 @@ class Features(BaseSDK):
280
282
 
281
283
  http_res = self.do_request(
282
284
  hook_ctx=HookContext(
285
+ config=self.sdk_configuration,
283
286
  base_url=base_url or "",
284
287
  operation_id="get_feature_extractor_v1_features_extractors__feature_id__get",
285
288
  oauth2_scopes=[],
@@ -393,6 +396,7 @@ class Features(BaseSDK):
393
396
 
394
397
  http_res = await self.do_request_async(
395
398
  hook_ctx=HookContext(
399
+ config=self.sdk_configuration,
396
400
  base_url=base_url or "",
397
401
  operation_id="get_feature_extractor_v1_features_extractors__feature_id__get",
398
402
  oauth2_scopes=[],
mixpeek/health.py CHANGED
@@ -59,6 +59,7 @@ class Health(BaseSDK):
59
59
 
60
60
  http_res = self.do_request(
61
61
  hook_ctx=HookContext(
62
+ config=self.sdk_configuration,
62
63
  base_url=base_url or "",
63
64
  operation_id="healthcheck_healthcheck_get",
64
65
  oauth2_scopes=[],
@@ -143,6 +144,7 @@ class Health(BaseSDK):
143
144
 
144
145
  http_res = await self.do_request_async(
145
146
  hook_ctx=HookContext(
147
+ config=self.sdk_configuration,
146
148
  base_url=base_url or "",
147
149
  operation_id="healthcheck_healthcheck_get",
148
150
  oauth2_scopes=[],
mixpeek/httpclient.py CHANGED
@@ -2,7 +2,6 @@
2
2
 
3
3
  # pyright: reportReturnType = false
4
4
  import asyncio
5
- from concurrent.futures import ThreadPoolExecutor
6
5
  from typing_extensions import Protocol, runtime_checkable
7
6
  import httpx
8
7
  from typing import Any, Optional, Union
@@ -116,21 +115,12 @@ def close_clients(
116
115
  pass
117
116
 
118
117
  if async_client is not None and not async_client_supplied:
119
- is_async = False
120
118
  try:
121
- asyncio.get_running_loop()
122
- is_async = True
119
+ loop = asyncio.get_running_loop()
120
+ asyncio.run_coroutine_threadsafe(async_client.aclose(), loop)
123
121
  except RuntimeError:
124
- pass
125
-
126
- try:
127
- # If this function is called in an async loop then start another
128
- # loop in a separate thread to close the async http client.
129
- if is_async:
130
- with ThreadPoolExecutor(max_workers=1) as executor:
131
- future = executor.submit(asyncio.run, async_client.aclose())
132
- future.result()
133
- else:
122
+ try:
134
123
  asyncio.run(async_client.aclose())
135
- except Exception:
136
- pass
124
+ except RuntimeError:
125
+ # best effort
126
+ pass