h2ogpte 1.6.38rc2__py3-none-any.whl → 1.6.38rc3__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.
- h2ogpte/__init__.py +1 -1
- h2ogpte/h2ogpte.py +105 -0
- h2ogpte/h2ogpte_async.py +103 -0
- h2ogpte/h2ogpte_sync_base.py +2 -0
- h2ogpte/rest_async/__init__.py +5 -1
- h2ogpte/rest_async/api/__init__.py +1 -0
- h2ogpte/rest_async/api/secrets_api.py +1698 -0
- h2ogpte/rest_async/api_client.py +1 -1
- h2ogpte/rest_async/configuration.py +1 -1
- h2ogpte/rest_async/models/__init__.py +3 -0
- h2ogpte/rest_async/models/create_secret201_response.py +87 -0
- h2ogpte/rest_async/models/create_secret_request.py +101 -0
- h2ogpte/rest_async/models/update_secret_request.py +87 -0
- h2ogpte/rest_sync/__init__.py +5 -1
- h2ogpte/rest_sync/api/__init__.py +1 -0
- h2ogpte/rest_sync/api/secrets_api.py +1698 -0
- h2ogpte/rest_sync/api_client.py +1 -1
- h2ogpte/rest_sync/configuration.py +1 -1
- h2ogpte/rest_sync/models/__init__.py +3 -0
- h2ogpte/rest_sync/models/create_secret201_response.py +87 -0
- h2ogpte/rest_sync/models/create_secret_request.py +101 -0
- h2ogpte/rest_sync/models/update_secret_request.py +87 -0
- {h2ogpte-1.6.38rc2.dist-info → h2ogpte-1.6.38rc3.dist-info}/METADATA +1 -1
- {h2ogpte-1.6.38rc2.dist-info → h2ogpte-1.6.38rc3.dist-info}/RECORD +26 -18
- {h2ogpte-1.6.38rc2.dist-info → h2ogpte-1.6.38rc3.dist-info}/WHEEL +0 -0
- {h2ogpte-1.6.38rc2.dist-info → h2ogpte-1.6.38rc3.dist-info}/top_level.txt +0 -0
h2ogpte/__init__.py
CHANGED
h2ogpte/h2ogpte.py
CHANGED
|
@@ -2286,6 +2286,111 @@ class H2OGPTE(H2OGPTESyncBase):
|
|
|
2286
2286
|
)
|
|
2287
2287
|
return self._wait_for_completion(response.id, timeout=timeout)
|
|
2288
2288
|
|
|
2289
|
+
def list_secret_ids(self, connector_type: Optional[str] = None) -> List[str]:
|
|
2290
|
+
"""
|
|
2291
|
+
List available secret IDs from the SecureStore for cloud storage connectors.
|
|
2292
|
+
|
|
2293
|
+
Args:
|
|
2294
|
+
connector_type: Type of connector ('s3', 'gcs', 'azure_key', 'azure_sas')
|
|
2295
|
+
If None, returns secrets for all connector types.
|
|
2296
|
+
|
|
2297
|
+
Returns:
|
|
2298
|
+
List of secret IDs available for the specified connector type
|
|
2299
|
+
"""
|
|
2300
|
+
self._init_rest()
|
|
2301
|
+
header = self._get_auth_header()
|
|
2302
|
+
response = _rest_to_client_exceptions(
|
|
2303
|
+
lambda: self._secrets_api.list_secret_ids(
|
|
2304
|
+
connector_type=connector_type, _headers=header
|
|
2305
|
+
)
|
|
2306
|
+
)
|
|
2307
|
+
return response.ids
|
|
2308
|
+
|
|
2309
|
+
def get_secret(self, secret_id: str) -> Union[Dict[str, Any], None]:
|
|
2310
|
+
"""Get a secret from the SecureStore by its ID.
|
|
2311
|
+
|
|
2312
|
+
Args:
|
|
2313
|
+
secret_id: The ID of the secret to retrieve.
|
|
2314
|
+
|
|
2315
|
+
Returns:
|
|
2316
|
+
The secret object corresponding to the provided ID.
|
|
2317
|
+
"""
|
|
2318
|
+
self._init_rest()
|
|
2319
|
+
header = self._get_auth_header()
|
|
2320
|
+
response = _rest_to_client_exceptions(
|
|
2321
|
+
lambda: self._secrets_api.get_secret(secret_id=secret_id, _headers=header)
|
|
2322
|
+
)
|
|
2323
|
+
return response.to_dict()
|
|
2324
|
+
|
|
2325
|
+
def get_secret_value(self, secret_id: str) -> Union[str, None]:
|
|
2326
|
+
"""Get the value of a secret from the SecureStore by its ID.
|
|
2327
|
+
|
|
2328
|
+
Args:
|
|
2329
|
+
secret_id: The ID of the secret to retrieve.
|
|
2330
|
+
|
|
2331
|
+
Returns:
|
|
2332
|
+
The value of the secret corresponding to the provided ID.
|
|
2333
|
+
"""
|
|
2334
|
+
self._init_rest()
|
|
2335
|
+
header = self._get_auth_header()
|
|
2336
|
+
response = _rest_to_client_exceptions(
|
|
2337
|
+
lambda: self._secrets_api.get_secret_value(
|
|
2338
|
+
secret_id=secret_id, _headers=header
|
|
2339
|
+
)
|
|
2340
|
+
)
|
|
2341
|
+
return response.value if response else None
|
|
2342
|
+
|
|
2343
|
+
def create_secret(self, secret: Dict[str, Any]) -> None:
|
|
2344
|
+
"""Create a new secret in the SecureStore.
|
|
2345
|
+
|
|
2346
|
+
Args:
|
|
2347
|
+
secret: A dictionary containing the secret data to be stored.
|
|
2348
|
+
|
|
2349
|
+
Returns:
|
|
2350
|
+
The ID of the newly created secret.
|
|
2351
|
+
"""
|
|
2352
|
+
self._init_rest()
|
|
2353
|
+
header = self._get_auth_header()
|
|
2354
|
+
response = _rest_to_client_exceptions(
|
|
2355
|
+
lambda: self._secrets_api.create_secret(secret=secret, _headers=header)
|
|
2356
|
+
)
|
|
2357
|
+
return response.id
|
|
2358
|
+
|
|
2359
|
+
def update_secret(self, secret_id: str, secret: Dict[str, Any]) -> None:
|
|
2360
|
+
"""Update an existing secret in the SecureStore.
|
|
2361
|
+
|
|
2362
|
+
Args:
|
|
2363
|
+
secret_id: The ID of the secret to update.
|
|
2364
|
+
secret: A dictionary containing the updated secret data.
|
|
2365
|
+
|
|
2366
|
+
Returns:
|
|
2367
|
+
None
|
|
2368
|
+
"""
|
|
2369
|
+
self._init_rest()
|
|
2370
|
+
header = self._get_auth_header()
|
|
2371
|
+
_rest_to_client_exceptions(
|
|
2372
|
+
lambda: self._secrets_api.update_secret(
|
|
2373
|
+
secret_id=secret_id, secret=secret, _headers=header
|
|
2374
|
+
)
|
|
2375
|
+
)
|
|
2376
|
+
|
|
2377
|
+
def delete_secret(self, secret_id: str) -> None:
|
|
2378
|
+
"""Delete a secret from the SecureStore by its ID.
|
|
2379
|
+
|
|
2380
|
+
Args:
|
|
2381
|
+
secret_id: The ID of the secret to delete.
|
|
2382
|
+
|
|
2383
|
+
Returns:
|
|
2384
|
+
None
|
|
2385
|
+
"""
|
|
2386
|
+
self._init_rest()
|
|
2387
|
+
header = self._get_auth_header()
|
|
2388
|
+
_rest_to_client_exceptions(
|
|
2389
|
+
lambda: self._secrets_api.delete_secret(
|
|
2390
|
+
secret_id=secret_id, _headers=header
|
|
2391
|
+
)
|
|
2392
|
+
)
|
|
2393
|
+
|
|
2289
2394
|
def ingest_uploads(
|
|
2290
2395
|
self,
|
|
2291
2396
|
collection_id: str,
|
h2ogpte/h2ogpte_async.py
CHANGED
|
@@ -165,6 +165,7 @@ class H2OGPTEAsync:
|
|
|
165
165
|
self.api_keys_api = None
|
|
166
166
|
self.configuration_api = None
|
|
167
167
|
self.agent_api = None
|
|
168
|
+
self.secrets_api = None
|
|
168
169
|
|
|
169
170
|
async def __aenter__(self):
|
|
170
171
|
if not self._h2ogpte._version_checked:
|
|
@@ -197,6 +198,7 @@ class H2OGPTEAsync:
|
|
|
197
198
|
self.api_keys_api = rest.APIKeysApi(self._rest_client)
|
|
198
199
|
self.configuration_api = rest.ConfigurationsApi(self._rest_client)
|
|
199
200
|
self.agent_api = rest.AgentsApi(self._rest_client)
|
|
201
|
+
self.secrets_api = rest.SecretsApi(self._rest_client)
|
|
200
202
|
return self
|
|
201
203
|
|
|
202
204
|
async def __aexit__(self, exc_type, exc_value, traceback):
|
|
@@ -2479,6 +2481,107 @@ class H2OGPTEAsync:
|
|
|
2479
2481
|
)
|
|
2480
2482
|
return await self._wait_for_completion(response.id, timeout=timeout)
|
|
2481
2483
|
|
|
2484
|
+
async def list_secret_ids(self, connector_type: Optional[str] = None) -> List[str]:
|
|
2485
|
+
"""
|
|
2486
|
+
List available secret IDs from the SecureStore for cloud storage connectors.
|
|
2487
|
+
|
|
2488
|
+
Args:
|
|
2489
|
+
connector_type: Type of connector ('s3', 'gcs', 'azure_key', 'azure_sas')
|
|
2490
|
+
If None, returns secrets for all connector types.
|
|
2491
|
+
|
|
2492
|
+
Returns:
|
|
2493
|
+
List of secret IDs available for the specified connector type
|
|
2494
|
+
"""
|
|
2495
|
+
await self._init_rest()
|
|
2496
|
+
header = await self._get_auth_header()
|
|
2497
|
+
response = await _rest_to_client_exceptions(
|
|
2498
|
+
self._secrets_api.list_secret_ids(
|
|
2499
|
+
connector_type=connector_type, _headers=header
|
|
2500
|
+
)
|
|
2501
|
+
)
|
|
2502
|
+
return response.ids
|
|
2503
|
+
|
|
2504
|
+
async def get_secret(self, secret_id: str) -> Union[Dict[str, Any], None]:
|
|
2505
|
+
"""Get a secret from the SecureStore by its ID.
|
|
2506
|
+
|
|
2507
|
+
Args:
|
|
2508
|
+
secret_id: The ID of the secret to retrieve.
|
|
2509
|
+
|
|
2510
|
+
Returns:
|
|
2511
|
+
The secret object corresponding to the provided ID.
|
|
2512
|
+
"""
|
|
2513
|
+
await self._init_rest()
|
|
2514
|
+
header = await self._get_auth_header()
|
|
2515
|
+
response = await _rest_to_client_exceptions(
|
|
2516
|
+
self._secrets_api.get_secret(secret_id=secret_id, _headers=header)
|
|
2517
|
+
)
|
|
2518
|
+
return response.to_dict()
|
|
2519
|
+
|
|
2520
|
+
async def get_secret_value(self, secret_id: str) -> Union[str, None]:
|
|
2521
|
+
"""Get the value of a secret from the SecureStore by its ID.
|
|
2522
|
+
|
|
2523
|
+
Args:
|
|
2524
|
+
secret_id: The ID of the secret to retrieve.
|
|
2525
|
+
|
|
2526
|
+
Returns:
|
|
2527
|
+
The value of the secret corresponding to the provided ID.
|
|
2528
|
+
"""
|
|
2529
|
+
await self._init_rest()
|
|
2530
|
+
header = await self._get_auth_header()
|
|
2531
|
+
response = await _rest_to_client_exceptions(
|
|
2532
|
+
self._secrets_api.get_secret_value(secret_id=secret_id, _headers=header)
|
|
2533
|
+
)
|
|
2534
|
+
return response.value if response else None
|
|
2535
|
+
|
|
2536
|
+
async def create_secret(self, secret: Dict[str, Any]) -> None:
|
|
2537
|
+
"""Create a new secret in the SecureStore.
|
|
2538
|
+
|
|
2539
|
+
Args:
|
|
2540
|
+
secret: A dictionary containing the secret data to be stored.
|
|
2541
|
+
|
|
2542
|
+
Returns:
|
|
2543
|
+
The ID of the newly created secret.
|
|
2544
|
+
"""
|
|
2545
|
+
await self._init_rest()
|
|
2546
|
+
header = await self._get_auth_header()
|
|
2547
|
+
response = await _rest_to_client_exceptions(
|
|
2548
|
+
self._secrets_api.create_secret(secret=secret, _headers=header)
|
|
2549
|
+
)
|
|
2550
|
+
return response.id
|
|
2551
|
+
|
|
2552
|
+
async def update_secret(self, secret_id: str, secret: Dict[str, Any]) -> None:
|
|
2553
|
+
"""Update an existing secret in the SecureStore.
|
|
2554
|
+
|
|
2555
|
+
Args:
|
|
2556
|
+
secret_id: The ID of the secret to update.
|
|
2557
|
+
secret: A dictionary containing the updated secret data.
|
|
2558
|
+
|
|
2559
|
+
Returns:
|
|
2560
|
+
None
|
|
2561
|
+
"""
|
|
2562
|
+
await self._init_rest()
|
|
2563
|
+
header = await self._get_auth_header()
|
|
2564
|
+
await _rest_to_client_exceptions(
|
|
2565
|
+
self._secrets_api.update_secret(
|
|
2566
|
+
secret_id=secret_id, secret=secret, _headers=header
|
|
2567
|
+
)
|
|
2568
|
+
)
|
|
2569
|
+
|
|
2570
|
+
async def delete_secret(self, secret_id: str) -> None:
|
|
2571
|
+
"""Delete a secret from the SecureStore by its ID.
|
|
2572
|
+
|
|
2573
|
+
Args:
|
|
2574
|
+
secret_id: The ID of the secret to delete.
|
|
2575
|
+
|
|
2576
|
+
Returns:
|
|
2577
|
+
None
|
|
2578
|
+
"""
|
|
2579
|
+
await self._init_rest()
|
|
2580
|
+
header = await self._get_auth_header()
|
|
2581
|
+
await _rest_to_client_exceptions(
|
|
2582
|
+
self._secrets_api.delete_secret(secret_id=secret_id, _headers=header)
|
|
2583
|
+
)
|
|
2584
|
+
|
|
2482
2585
|
async def ingest_uploads(
|
|
2483
2586
|
self,
|
|
2484
2587
|
collection_id: str,
|
h2ogpte/h2ogpte_sync_base.py
CHANGED
|
@@ -93,6 +93,7 @@ class H2OGPTESyncBase:
|
|
|
93
93
|
self._api_keys_api = rest.APIKeysApi(self._rest_client)
|
|
94
94
|
self._configuration_api = rest.ConfigurationsApi(self._rest_client)
|
|
95
95
|
self._agent_api = rest.AgentsApi(self._rest_client)
|
|
96
|
+
self._secrets_api = rest.SecretsApi(self._rest_client)
|
|
96
97
|
|
|
97
98
|
class _RESTClient:
|
|
98
99
|
def __init__(self, h2ogpte):
|
|
@@ -110,6 +111,7 @@ class H2OGPTESyncBase:
|
|
|
110
111
|
self.api_keys_api = h2ogpte._api_keys_api
|
|
111
112
|
self.configuration_api = h2ogpte._configuration_api
|
|
112
113
|
self.agent_api = h2ogpte._agent_api
|
|
114
|
+
self.secrets_api = h2ogpte._secrets_api
|
|
113
115
|
|
|
114
116
|
def __enter__(self):
|
|
115
117
|
return self
|
h2ogpte/rest_async/__init__.py
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
""" # noqa: E501
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
__version__ = "1.6.38-
|
|
17
|
+
__version__ = "1.6.38-dev3"
|
|
18
18
|
|
|
19
19
|
# import apis into sdk package
|
|
20
20
|
from h2ogpte.rest_async.api.api_keys_api import APIKeysApi
|
|
@@ -28,6 +28,7 @@ from h2ogpte.rest_async.api.jobs_api import JobsApi
|
|
|
28
28
|
from h2ogpte.rest_async.api.models_api import ModelsApi
|
|
29
29
|
from h2ogpte.rest_async.api.permissions_api import PermissionsApi
|
|
30
30
|
from h2ogpte.rest_async.api.prompt_templates_api import PromptTemplatesApi
|
|
31
|
+
from h2ogpte.rest_async.api.secrets_api import SecretsApi
|
|
31
32
|
from h2ogpte.rest_async.api.system_api import SystemApi
|
|
32
33
|
from h2ogpte.rest_async.api.tags_api import TagsApi
|
|
33
34
|
|
|
@@ -79,6 +80,8 @@ from h2ogpte.rest_async.models.create_agent_key_request import CreateAgentKeyReq
|
|
|
79
80
|
from h2ogpte.rest_async.models.create_agent_tool_key_associations_request import CreateAgentToolKeyAssociationsRequest
|
|
80
81
|
from h2ogpte.rest_async.models.create_import_collection_to_collection_job_request import CreateImportCollectionToCollectionJobRequest
|
|
81
82
|
from h2ogpte.rest_async.models.create_insert_document_to_collection_job_request import CreateInsertDocumentToCollectionJobRequest
|
|
83
|
+
from h2ogpte.rest_async.models.create_secret201_response import CreateSecret201Response
|
|
84
|
+
from h2ogpte.rest_async.models.create_secret_request import CreateSecretRequest
|
|
82
85
|
from h2ogpte.rest_async.models.create_topic_model_job_request import CreateTopicModelJobRequest
|
|
83
86
|
from h2ogpte.rest_async.models.delete_chat_sessions_job_request import DeleteChatSessionsJobRequest
|
|
84
87
|
from h2ogpte.rest_async.models.delete_collections_job_request import DeleteCollectionsJobRequest
|
|
@@ -154,6 +157,7 @@ from h2ogpte.rest_async.models.update_collection_privacy_request import UpdateCo
|
|
|
154
157
|
from h2ogpte.rest_async.models.update_default_prompt_template_visibility_request import UpdateDefaultPromptTemplateVisibilityRequest
|
|
155
158
|
from h2ogpte.rest_async.models.update_prompt_template_privacy_request import UpdatePromptTemplatePrivacyRequest
|
|
156
159
|
from h2ogpte.rest_async.models.update_qa_feedback_request import UpdateQAFeedbackRequest
|
|
160
|
+
from h2ogpte.rest_async.models.update_secret_request import UpdateSecretRequest
|
|
157
161
|
from h2ogpte.rest_async.models.uploaded_file import UploadedFile
|
|
158
162
|
from h2ogpte.rest_async.models.usage_stats import UsageStats
|
|
159
163
|
from h2ogpte.rest_async.models.usage_stats_per_model import UsageStatsPerModel
|
|
@@ -12,6 +12,7 @@ from h2ogpte.rest_async.api.jobs_api import JobsApi
|
|
|
12
12
|
from h2ogpte.rest_async.api.models_api import ModelsApi
|
|
13
13
|
from h2ogpte.rest_async.api.permissions_api import PermissionsApi
|
|
14
14
|
from h2ogpte.rest_async.api.prompt_templates_api import PromptTemplatesApi
|
|
15
|
+
from h2ogpte.rest_async.api.secrets_api import SecretsApi
|
|
15
16
|
from h2ogpte.rest_async.api.system_api import SystemApi
|
|
16
17
|
from h2ogpte.rest_async.api.tags_api import TagsApi
|
|
17
18
|
|