hydra-db-python 0.1.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 (115) hide show
  1. hydra_db/__init__.py +160 -0
  2. hydra_db/client.py +245 -0
  3. hydra_db/core/__init__.py +52 -0
  4. hydra_db/core/api_error.py +23 -0
  5. hydra_db/core/client_wrapper.py +84 -0
  6. hydra_db/core/datetime_utils.py +28 -0
  7. hydra_db/core/file.py +67 -0
  8. hydra_db/core/force_multipart.py +18 -0
  9. hydra_db/core/http_client.py +543 -0
  10. hydra_db/core/http_response.py +55 -0
  11. hydra_db/core/jsonable_encoder.py +100 -0
  12. hydra_db/core/pydantic_utilities.py +258 -0
  13. hydra_db/core/query_encoder.py +58 -0
  14. hydra_db/core/remove_none_from_dict.py +11 -0
  15. hydra_db/core/request_options.py +35 -0
  16. hydra_db/core/serialization.py +276 -0
  17. hydra_db/data/__init__.py +4 -0
  18. hydra_db/data/client.py +123 -0
  19. hydra_db/data/raw_client.py +295 -0
  20. hydra_db/embeddings/__init__.py +4 -0
  21. hydra_db/embeddings/client.py +486 -0
  22. hydra_db/embeddings/raw_client.py +1183 -0
  23. hydra_db/environment.py +7 -0
  24. hydra_db/errors/__init__.py +23 -0
  25. hydra_db/errors/bad_request_error.py +10 -0
  26. hydra_db/errors/forbidden_error.py +10 -0
  27. hydra_db/errors/internal_server_error.py +10 -0
  28. hydra_db/errors/not_found_error.py +10 -0
  29. hydra_db/errors/service_unavailable_error.py +10 -0
  30. hydra_db/errors/too_many_requests_error.py +11 -0
  31. hydra_db/errors/unauthorized_error.py +10 -0
  32. hydra_db/errors/unprocessable_entity_error.py +10 -0
  33. hydra_db/fetch/__init__.py +7 -0
  34. hydra_db/fetch/client.py +408 -0
  35. hydra_db/fetch/raw_client.py +927 -0
  36. hydra_db/fetch/types/__init__.py +7 -0
  37. hydra_db/fetch/types/fetch_list_data_response.py +8 -0
  38. hydra_db/key/__init__.py +4 -0
  39. hydra_db/key/client.py +135 -0
  40. hydra_db/key/raw_client.py +309 -0
  41. hydra_db/raw_client.py +92 -0
  42. hydra_db/recall/__init__.py +4 -0
  43. hydra_db/recall/client.py +699 -0
  44. hydra_db/recall/raw_client.py +1490 -0
  45. hydra_db/tenant/__init__.py +4 -0
  46. hydra_db/tenant/client.py +380 -0
  47. hydra_db/tenant/raw_client.py +1259 -0
  48. hydra_db/types/__init__.py +125 -0
  49. hydra_db/types/actual_error_response.py +20 -0
  50. hydra_db/types/add_memory_response.py +39 -0
  51. hydra_db/types/alpha.py +5 -0
  52. hydra_db/types/api_key_create_response.py +48 -0
  53. hydra_db/types/attachment_model.py +53 -0
  54. hydra_db/types/batch_processing_status.py +23 -0
  55. hydra_db/types/bm_25_operator_type.py +5 -0
  56. hydra_db/types/collection_stats.py +27 -0
  57. hydra_db/types/content_filter.py +49 -0
  58. hydra_db/types/content_model.py +53 -0
  59. hydra_db/types/custom_property_definition.py +75 -0
  60. hydra_db/types/delete_result.py +36 -0
  61. hydra_db/types/delete_user_memory_response.py +31 -0
  62. hydra_db/types/entity.py +42 -0
  63. hydra_db/types/error_response.py +21 -0
  64. hydra_db/types/fetch_mode.py +5 -0
  65. hydra_db/types/forceful_relations_payload.py +27 -0
  66. hydra_db/types/graph_context.py +26 -0
  67. hydra_db/types/infra.py +21 -0
  68. hydra_db/types/infra_status_response.py +42 -0
  69. hydra_db/types/insert_result.py +41 -0
  70. hydra_db/types/list_content_kind.py +5 -0
  71. hydra_db/types/list_user_memories_response.py +43 -0
  72. hydra_db/types/memory_item.py +88 -0
  73. hydra_db/types/memory_result_item.py +47 -0
  74. hydra_db/types/milvus_data_type.py +21 -0
  75. hydra_db/types/pagination_meta.py +51 -0
  76. hydra_db/types/path_triplet.py +23 -0
  77. hydra_db/types/processing_status.py +43 -0
  78. hydra_db/types/processing_status_indexing_status.py +7 -0
  79. hydra_db/types/qn_a_search_response.py +49 -0
  80. hydra_db/types/raw_embedding_document.py +47 -0
  81. hydra_db/types/raw_embedding_search_result.py +47 -0
  82. hydra_db/types/raw_embedding_vector.py +31 -0
  83. hydra_db/types/recall_search_request.py +78 -0
  84. hydra_db/types/relation_evidence.py +72 -0
  85. hydra_db/types/retrieval_result.py +36 -0
  86. hydra_db/types/retrieve_mode.py +5 -0
  87. hydra_db/types/scored_path_response.py +31 -0
  88. hydra_db/types/search_mode.py +5 -0
  89. hydra_db/types/source_delete_response.py +30 -0
  90. hydra_db/types/source_delete_result_item.py +36 -0
  91. hydra_db/types/source_fetch_response.py +70 -0
  92. hydra_db/types/source_graph_relations_response.py +33 -0
  93. hydra_db/types/source_info.py +57 -0
  94. hydra_db/types/source_list_response.py +32 -0
  95. hydra_db/types/source_model.py +99 -0
  96. hydra_db/types/source_status.py +5 -0
  97. hydra_db/types/source_upload_response.py +35 -0
  98. hydra_db/types/source_upload_result_item.py +38 -0
  99. hydra_db/types/sub_tenant_ids_response.py +31 -0
  100. hydra_db/types/supported_llm_providers.py +5 -0
  101. hydra_db/types/tenant_create_accepted_response.py +36 -0
  102. hydra_db/types/tenant_delete_response.py +25 -0
  103. hydra_db/types/tenant_stats_response.py +38 -0
  104. hydra_db/types/triplet_with_evidence.py +35 -0
  105. hydra_db/types/user_assistant_pair.py +31 -0
  106. hydra_db/types/user_memory.py +31 -0
  107. hydra_db/types/vector_store_chunk.py +77 -0
  108. hydra_db/upload/__init__.py +4 -0
  109. hydra_db/upload/client.py +452 -0
  110. hydra_db/upload/raw_client.py +1147 -0
  111. hydra_db_python-0.1.0.dist-info/METADATA +229 -0
  112. hydra_db_python-0.1.0.dist-info/RECORD +115 -0
  113. hydra_db_python-0.1.0.dist-info/WHEEL +5 -0
  114. hydra_db_python-0.1.0.dist-info/licenses/LICENSE +22 -0
  115. hydra_db_python-0.1.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,4 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ # isort: skip_file
4
+
@@ -0,0 +1,380 @@
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.custom_property_definition import CustomPropertyDefinition
8
+ from ..types.infra_status_response import InfraStatusResponse
9
+ from ..types.sub_tenant_ids_response import SubTenantIdsResponse
10
+ from ..types.tenant_create_accepted_response import TenantCreateAcceptedResponse
11
+ from ..types.tenant_delete_response import TenantDeleteResponse
12
+ from ..types.tenant_stats_response import TenantStatsResponse
13
+ from .raw_client import AsyncRawTenantClient, RawTenantClient
14
+
15
+ # this is used as the default value for optional parameters
16
+ OMIT = typing.cast(typing.Any, ...)
17
+
18
+
19
+ class TenantClient:
20
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
21
+ self._raw_client = RawTenantClient(client_wrapper=client_wrapper)
22
+
23
+ @property
24
+ def with_raw_response(self) -> RawTenantClient:
25
+ """
26
+ Retrieves a raw implementation of this client that returns raw responses.
27
+
28
+ Returns
29
+ -------
30
+ RawTenantClient
31
+ """
32
+ return self._raw_client
33
+
34
+ def create(
35
+ self,
36
+ *,
37
+ tenant_id: str,
38
+ is_embeddings_tenant: typing.Optional[bool] = OMIT,
39
+ embeddings_dimension: typing.Optional[int] = OMIT,
40
+ tenant_metadata_schema: typing.Optional[typing.Sequence[CustomPropertyDefinition]] = OMIT,
41
+ request_options: typing.Optional[RequestOptions] = None,
42
+ ) -> TenantCreateAcceptedResponse:
43
+ """
44
+ Parameters
45
+ ----------
46
+ tenant_id : str
47
+ Unique tenant identifier
48
+
49
+ is_embeddings_tenant : typing.Optional[bool]
50
+ True to create embeddings tenant
51
+
52
+ embeddings_dimension : typing.Optional[int]
53
+ Embedding dimensions for embeddings tenant. Not required for non-embeddings (is_embeddings_tenant=False) tenants
54
+
55
+ tenant_metadata_schema : typing.Optional[typing.Sequence[CustomPropertyDefinition]]
56
+ Schema definition for tenant metadata fields. Each field can be configured for: filtering (enable_match), semantic search (enable_dense_embedding), and/or keyword search (enable_sparse_embedding). Fields with embeddings enabled must be VARCHAR type.
57
+
58
+ request_options : typing.Optional[RequestOptions]
59
+ Request-specific configuration.
60
+
61
+ Returns
62
+ -------
63
+ TenantCreateAcceptedResponse
64
+ Successful Response
65
+
66
+ Examples
67
+ --------
68
+ from hydra-db import HydraDB
69
+
70
+ client = HydraDB(token="YOUR_TOKEN", )
71
+ client.tenant.create(tenant_id='tenant_1234', )
72
+ """
73
+ _response = self._raw_client.create(
74
+ tenant_id=tenant_id,
75
+ is_embeddings_tenant=is_embeddings_tenant,
76
+ embeddings_dimension=embeddings_dimension,
77
+ tenant_metadata_schema=tenant_metadata_schema,
78
+ request_options=request_options,
79
+ )
80
+ return _response.data
81
+
82
+ def get_sub_tenant_ids(
83
+ self, *, tenant_id: str, request_options: typing.Optional[RequestOptions] = None
84
+ ) -> SubTenantIdsResponse:
85
+ """
86
+ Parameters
87
+ ----------
88
+ tenant_id : str
89
+ Unique identifier for the tenant/organization
90
+
91
+ request_options : typing.Optional[RequestOptions]
92
+ Request-specific configuration.
93
+
94
+ Returns
95
+ -------
96
+ SubTenantIdsResponse
97
+ Successful Response
98
+
99
+ Examples
100
+ --------
101
+ from hydra-db import HydraDB
102
+
103
+ client = HydraDB(token="YOUR_TOKEN", )
104
+ client.tenant.get_sub_tenant_ids(tenant_id='tenant_1234', )
105
+ """
106
+ _response = self._raw_client.get_sub_tenant_ids(tenant_id=tenant_id, request_options=request_options)
107
+ return _response.data
108
+
109
+ def get_infra_status(
110
+ self, *, tenant_id: str, request_options: typing.Optional[RequestOptions] = None
111
+ ) -> InfraStatusResponse:
112
+ """
113
+ Parameters
114
+ ----------
115
+ tenant_id : str
116
+ Unique identifier for the tenant/organization
117
+
118
+ request_options : typing.Optional[RequestOptions]
119
+ Request-specific configuration.
120
+
121
+ Returns
122
+ -------
123
+ InfraStatusResponse
124
+ Successful Response
125
+
126
+ Examples
127
+ --------
128
+ from hydra-db import HydraDB
129
+
130
+ client = HydraDB(token="YOUR_TOKEN", )
131
+ client.tenant.get_infra_status(tenant_id='tenant_1234', )
132
+ """
133
+ _response = self._raw_client.get_infra_status(tenant_id=tenant_id, request_options=request_options)
134
+ return _response.data
135
+
136
+ def delete_tenant(
137
+ self, *, tenant_id: str, request_options: typing.Optional[RequestOptions] = None
138
+ ) -> TenantDeleteResponse:
139
+ """
140
+ Parameters
141
+ ----------
142
+ tenant_id : str
143
+ Unique identifier for the tenant/organization
144
+
145
+ request_options : typing.Optional[RequestOptions]
146
+ Request-specific configuration.
147
+
148
+ Returns
149
+ -------
150
+ TenantDeleteResponse
151
+ Successful Response
152
+
153
+ Examples
154
+ --------
155
+ from hydra-db import HydraDB
156
+
157
+ client = HydraDB(token="YOUR_TOKEN", )
158
+ client.tenant.delete_tenant(tenant_id='tenant_1234', )
159
+ """
160
+ _response = self._raw_client.delete_tenant(tenant_id=tenant_id, request_options=request_options)
161
+ return _response.data
162
+
163
+ def monitor(
164
+ self, *, tenant_id: str, request_options: typing.Optional[RequestOptions] = None
165
+ ) -> TenantStatsResponse:
166
+ """
167
+ Parameters
168
+ ----------
169
+ tenant_id : str
170
+ Unique identifier for the tenant/organization
171
+
172
+ request_options : typing.Optional[RequestOptions]
173
+ Request-specific configuration.
174
+
175
+ Returns
176
+ -------
177
+ TenantStatsResponse
178
+ Successful Response
179
+
180
+ Examples
181
+ --------
182
+ from hydra-db import HydraDB
183
+
184
+ client = HydraDB(token="YOUR_TOKEN", )
185
+ client.tenant.monitor(tenant_id='tenant_1234', )
186
+ """
187
+ _response = self._raw_client.monitor(tenant_id=tenant_id, request_options=request_options)
188
+ return _response.data
189
+
190
+
191
+ class AsyncTenantClient:
192
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
193
+ self._raw_client = AsyncRawTenantClient(client_wrapper=client_wrapper)
194
+
195
+ @property
196
+ def with_raw_response(self) -> AsyncRawTenantClient:
197
+ """
198
+ Retrieves a raw implementation of this client that returns raw responses.
199
+
200
+ Returns
201
+ -------
202
+ AsyncRawTenantClient
203
+ """
204
+ return self._raw_client
205
+
206
+ async def create(
207
+ self,
208
+ *,
209
+ tenant_id: str,
210
+ is_embeddings_tenant: typing.Optional[bool] = OMIT,
211
+ embeddings_dimension: typing.Optional[int] = OMIT,
212
+ tenant_metadata_schema: typing.Optional[typing.Sequence[CustomPropertyDefinition]] = OMIT,
213
+ request_options: typing.Optional[RequestOptions] = None,
214
+ ) -> TenantCreateAcceptedResponse:
215
+ """
216
+ Parameters
217
+ ----------
218
+ tenant_id : str
219
+ Unique tenant identifier
220
+
221
+ is_embeddings_tenant : typing.Optional[bool]
222
+ True to create embeddings tenant
223
+
224
+ embeddings_dimension : typing.Optional[int]
225
+ Embedding dimensions for embeddings tenant. Not required for non-embeddings (is_embeddings_tenant=False) tenants
226
+
227
+ tenant_metadata_schema : typing.Optional[typing.Sequence[CustomPropertyDefinition]]
228
+ Schema definition for tenant metadata fields. Each field can be configured for: filtering (enable_match), semantic search (enable_dense_embedding), and/or keyword search (enable_sparse_embedding). Fields with embeddings enabled must be VARCHAR type.
229
+
230
+ request_options : typing.Optional[RequestOptions]
231
+ Request-specific configuration.
232
+
233
+ Returns
234
+ -------
235
+ TenantCreateAcceptedResponse
236
+ Successful Response
237
+
238
+ Examples
239
+ --------
240
+ import asyncio
241
+
242
+ from hydra-db import AsyncHydraDB
243
+
244
+ client = AsyncHydraDB(token="YOUR_TOKEN", )
245
+ async def main() -> None:
246
+ await client.tenant.create(tenant_id='tenant_1234', )
247
+ asyncio.run(main())
248
+ """
249
+ _response = await self._raw_client.create(
250
+ tenant_id=tenant_id,
251
+ is_embeddings_tenant=is_embeddings_tenant,
252
+ embeddings_dimension=embeddings_dimension,
253
+ tenant_metadata_schema=tenant_metadata_schema,
254
+ request_options=request_options,
255
+ )
256
+ return _response.data
257
+
258
+ async def get_sub_tenant_ids(
259
+ self, *, tenant_id: str, request_options: typing.Optional[RequestOptions] = None
260
+ ) -> SubTenantIdsResponse:
261
+ """
262
+ Parameters
263
+ ----------
264
+ tenant_id : str
265
+ Unique identifier for the tenant/organization
266
+
267
+ request_options : typing.Optional[RequestOptions]
268
+ Request-specific configuration.
269
+
270
+ Returns
271
+ -------
272
+ SubTenantIdsResponse
273
+ Successful Response
274
+
275
+ Examples
276
+ --------
277
+ import asyncio
278
+
279
+ from hydra-db import AsyncHydraDB
280
+
281
+ client = AsyncHydraDB(token="YOUR_TOKEN", )
282
+ async def main() -> None:
283
+ await client.tenant.get_sub_tenant_ids(tenant_id='tenant_1234', )
284
+ asyncio.run(main())
285
+ """
286
+ _response = await self._raw_client.get_sub_tenant_ids(tenant_id=tenant_id, request_options=request_options)
287
+ return _response.data
288
+
289
+ async def get_infra_status(
290
+ self, *, tenant_id: str, request_options: typing.Optional[RequestOptions] = None
291
+ ) -> InfraStatusResponse:
292
+ """
293
+ Parameters
294
+ ----------
295
+ tenant_id : str
296
+ Unique identifier for the tenant/organization
297
+
298
+ request_options : typing.Optional[RequestOptions]
299
+ Request-specific configuration.
300
+
301
+ Returns
302
+ -------
303
+ InfraStatusResponse
304
+ Successful Response
305
+
306
+ Examples
307
+ --------
308
+ import asyncio
309
+
310
+ from hydra-db import AsyncHydraDB
311
+
312
+ client = AsyncHydraDB(token="YOUR_TOKEN", )
313
+ async def main() -> None:
314
+ await client.tenant.get_infra_status(tenant_id='tenant_1234', )
315
+ asyncio.run(main())
316
+ """
317
+ _response = await self._raw_client.get_infra_status(tenant_id=tenant_id, request_options=request_options)
318
+ return _response.data
319
+
320
+ async def delete_tenant(
321
+ self, *, tenant_id: str, request_options: typing.Optional[RequestOptions] = None
322
+ ) -> TenantDeleteResponse:
323
+ """
324
+ Parameters
325
+ ----------
326
+ tenant_id : str
327
+ Unique identifier for the tenant/organization
328
+
329
+ request_options : typing.Optional[RequestOptions]
330
+ Request-specific configuration.
331
+
332
+ Returns
333
+ -------
334
+ TenantDeleteResponse
335
+ Successful Response
336
+
337
+ Examples
338
+ --------
339
+ import asyncio
340
+
341
+ from hydra-db import AsyncHydraDB
342
+
343
+ client = AsyncHydraDB(token="YOUR_TOKEN", )
344
+ async def main() -> None:
345
+ await client.tenant.delete_tenant(tenant_id='tenant_1234', )
346
+ asyncio.run(main())
347
+ """
348
+ _response = await self._raw_client.delete_tenant(tenant_id=tenant_id, request_options=request_options)
349
+ return _response.data
350
+
351
+ async def monitor(
352
+ self, *, tenant_id: str, request_options: typing.Optional[RequestOptions] = None
353
+ ) -> TenantStatsResponse:
354
+ """
355
+ Parameters
356
+ ----------
357
+ tenant_id : str
358
+ Unique identifier for the tenant/organization
359
+
360
+ request_options : typing.Optional[RequestOptions]
361
+ Request-specific configuration.
362
+
363
+ Returns
364
+ -------
365
+ TenantStatsResponse
366
+ Successful Response
367
+
368
+ Examples
369
+ --------
370
+ import asyncio
371
+
372
+ from hydra-db import AsyncHydraDB
373
+
374
+ client = AsyncHydraDB(token="YOUR_TOKEN", )
375
+ async def main() -> None:
376
+ await client.tenant.monitor(tenant_id='tenant_1234', )
377
+ asyncio.run(main())
378
+ """
379
+ _response = await self._raw_client.monitor(tenant_id=tenant_id, request_options=request_options)
380
+ return _response.data