sunholo 0.76.6__py3-none-any.whl → 0.76.7__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.
sunholo/auth/run.py CHANGED
@@ -66,7 +66,7 @@ def get_cloud_run_token(vector_name):
66
66
  }
67
67
  log.info(f"Authenticating for run_url {run_url} from {caller_frame.f_code.co_name}")
68
68
  id_token = get_id_token(run_url)
69
- log.info(f"id_token {id_token}")
69
+ #log.info(f"id_token {id_token}")
70
70
  return id_token
71
71
 
72
72
  def get_header(vector_name) -> Optional[dict]:
@@ -12,9 +12,10 @@ def process_azure_blob_event(events: list) -> tuple:
12
12
  tuple: A tuple containing the blob URL, attributes as metadata, and the vector name.
13
13
 
14
14
  Example of Event Grid schema:
15
+ ```
15
16
  {
16
- "topic": "/subscriptions/{subscription-id}/resourceGroups/{resource-group}/providers/Microsoft.Storage/storageAccounts/{storage-account}",
17
- "subject": "/blobServices/default/containers/{container}/blobs/{blob}",
17
+ "topic": "/subscriptions/subscription-id/resourceGroups/resource-group/providers/Microsoft.Storage/storageAccounts/storage-account",
18
+ "subject": "/blobServices/default/containers/container/blobs/blob",
18
19
  "eventType": "Microsoft.Storage.BlobCreated",
19
20
  "eventTime": "2021-01-01T12:34:56.789Z",
20
21
  "id": "event-id",
@@ -26,8 +27,8 @@ def process_azure_blob_event(events: list) -> tuple:
26
27
  "contentType": "application/octet-stream",
27
28
  "contentLength": 524288,
28
29
  "blobType": "BlockBlob",
29
- "url": "https://{storage-account}.blob.core.windows.net/{container}/{blob}",
30
- "sequencer": "0000000000000000000000000000000000000000000000000000000000000000",
30
+ "url": "https://storage-account.blob.core.windows.net/container/blob",
31
+ "sequencer": "0000000000000000000000000",
31
32
  "storageDiagnostics": {
32
33
  "batchId": "batch-id"
33
34
  }
@@ -35,6 +36,7 @@ def process_azure_blob_event(events: list) -> tuple:
35
36
  "dataVersion": "",
36
37
  "metadataVersion": "1"
37
38
  }
39
+ ```
38
40
  """
39
41
  storage_blob_created_event = "Microsoft.Storage.BlobCreated"
40
42
 
@@ -7,6 +7,7 @@ from .init import init_vertex
7
7
  from ..logging import log
8
8
  from ..utils.gcp_project import get_gcp_project
9
9
  from ..utils.parsers import validate_extension_id
10
+ from ..utils.gcp import is_running_on_cloudrun
10
11
  from ..auth import get_local_gcloud_token, get_cloud_run_token
11
12
  import base64
12
13
  import json
@@ -271,27 +272,31 @@ class VertexAIExtensions:
271
272
  operation_id: str,
272
273
  operation_params: dict,
273
274
  extension_id: str=None,
275
+ extension_display_name: str=None,
274
276
  vac: str=None):
275
277
 
276
- if not extension_id:
277
- extension_name = self.created_extension.resource_name
278
- if extension_name is None:
279
- raise ValueError("Must specify extension_id or init one with class")
280
- else:
278
+ if extension_display_name:
279
+ extensions = self.list_extensions()
280
+ for extension in extensions:
281
+ if extension.get('display_name') == extension_display_name:
282
+ log.info(f"Found extension_id for '{extension_display_name}'")
283
+ extension_id = extension['resource_name']
284
+ break
285
+
286
+ if extension_id:
281
287
  extension_id = str(extension_id)
282
288
  if not extension_id.startswith("projects/"):
283
289
  extension_name = f"projects/{self.project_id}/locations/{self.location}/extensions/{extension_id}"
284
290
  else:
285
291
  extension_name = extension_id
292
+ else:
293
+ extension_name = self.created_extension.resource_name
294
+ if not extension_name:
295
+ raise ValueError("Must specify extension_id or extension_name - both were None")
286
296
 
287
297
  extension = extensions.Extension(extension_name)
288
298
 
289
- log.info(f"Executing extension {extension_name=} with {operation_id=} and {operation_params=}")
290
-
291
- # local testing auth
292
- from ..utils.gcp import is_running_on_cloudrun
293
- auth_config=None # on cloud run it sorts itself out via default creds(?)
294
-
299
+ auth_config=None
295
300
  if not is_running_on_cloudrun():
296
301
 
297
302
  log.warning("Using local authentication via gcloud")
@@ -308,10 +313,8 @@ class VertexAIExtensions:
308
313
  }
309
314
  else:
310
315
  log.warning("No vac configuration and not running locally so no authentication being set for this extension API call")
311
-
312
- if auth_config:
313
- log.info(f"{auth_config=}")
314
316
 
317
+ log.info(f"Executing extension {extension_name=} with {operation_id=} and {operation_params=}")
315
318
  response = extension.execute(
316
319
  operation_id=operation_id,
317
320
  operation_params=operation_params,
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sunholo
3
- Version: 0.76.6
3
+ Version: 0.76.7
4
4
  Summary: Large Language Model DevOps - a package to help deploy LLMs to the Cloud.
5
5
  Home-page: https://github.com/sunholo-data/sunholo-py
6
- Download-URL: https://github.com/sunholo-data/sunholo-py/archive/refs/tags/v0.76.6.tar.gz
6
+ Download-URL: https://github.com/sunholo-data/sunholo-py/archive/refs/tags/v0.76.7.tar.gz
7
7
  Author: Holosun ApS
8
8
  Author-email: multivac@sunholo.com
9
9
  License: Apache License, Version 2.0
@@ -20,9 +20,9 @@ sunholo/archive/archive.py,sha256=C-UhG5x-XtZ8VheQp92IYJqgD0V3NFQjniqlit94t18,11
20
20
  sunholo/auth/__init__.py,sha256=TeP-OY0XGxYV_8AQcVGoh35bvyWhNUcMRfhuD5l44Sk,91
21
21
  sunholo/auth/gcloud.py,sha256=PdbwkuTdRi4RKBmgG9uwsReegqC4VG15_tw5uzmA7Fs,298
22
22
  sunholo/auth/refresh.py,sha256=uOdT7oQRVl0YsUP__NXj6PdUdLyXFSv2ylwF283esuw,1831
23
- sunholo/auth/run.py,sha256=_4wdaYmkjsyz35alXZUE7cqEanpCHY5dldrx2uMagq8,2723
23
+ sunholo/auth/run.py,sha256=3f2VKjIPePWz7o5EPetXF7JBCr-FNk9lOPJ-2qNTk0I,2724
24
24
  sunholo/azure/__init__.py,sha256=S1WQ5jndzNgzhSBh9UpX_yw7hRVm3hCzkAWNxUdK4dA,48
25
- sunholo/azure/event_grid.py,sha256=Gky7D5a-xxMzbcst_wOFfcI8AH5qOzWbKbt5iqOTr6U,2606
25
+ sunholo/azure/event_grid.py,sha256=uXunwdjVLxNRf38aTRPoC9HXxFEFlL8JH9dijaOlF8M,2567
26
26
  sunholo/bots/__init__.py,sha256=EMFd7e2z68l6pzYOnkzHbLd2xJRvxTKFRNCTuhZ8hIw,130
27
27
  sunholo/bots/discord.py,sha256=cCFae5K1BCa6JVkWGLh_iZ9qFO1JpXb6K4eJrlDfEro,2442
28
28
  sunholo/bots/github_webhook.py,sha256=5pQPRLM_wxxcILVaIzUDV8Kt7Arcm2dL1r1kMMHA524,9629
@@ -120,13 +120,13 @@ sunholo/utils/timedelta.py,sha256=BbLabEx7_rbErj_YbNM0MBcaFN76DC4PTe4zD2ucezg,49
120
120
  sunholo/utils/user_ids.py,sha256=SQd5_H7FE7vcTZp9AQuQDWBXd4FEEd7TeVMQe1H4Ny8,292
121
121
  sunholo/utils/version.py,sha256=P1QAJQdZfT2cMqdTSmXmcxrD2PssMPEGM-WI6083Fck,237
122
122
  sunholo/vertex/__init__.py,sha256=XH7FUKxdIgN9H2iDcWxL3sRnVHC3297G24RqEn4Ob0Y,240
123
- sunholo/vertex/extensions_class.py,sha256=6-M2BKO7ET9nxLGPD-mWxxytGtzMPmJarrl78-V3JVk,18745
123
+ sunholo/vertex/extensions_class.py,sha256=UARBnhOmxuqRGX3ooWrJujMXc0iKtx1HkCTnK0VEJmY,19006
124
124
  sunholo/vertex/init.py,sha256=aLdNjrX3bUPfnWRhKUg5KUxSu0Qnq2YvuFNsgml4QEY,2866
125
125
  sunholo/vertex/memory_tools.py,sha256=pomHrDKqvY8MZxfUqoEwhdlpCvSGP6KmFJMVKOimXjs,6842
126
126
  sunholo/vertex/safety.py,sha256=S9PgQT1O_BQAkcqauWncRJaydiP8Q_Jzmu9gxYfy1VA,2482
127
- sunholo-0.76.6.dist-info/LICENSE.txt,sha256=SdE3QjnD3GEmqqg9EX3TM9f7WmtOzqS1KJve8rhbYmU,11345
128
- sunholo-0.76.6.dist-info/METADATA,sha256=i1v5HHKs4rv8B0rlvkIV-fTbe-V0l9ZB7PRakzA56Ps,7136
129
- sunholo-0.76.6.dist-info/WHEEL,sha256=Z4pYXqR_rTB7OWNDYFOm1qRk0RX6GFP2o8LgvP453Hk,91
130
- sunholo-0.76.6.dist-info/entry_points.txt,sha256=bZuN5AIHingMPt4Ro1b_T-FnQvZ3teBes-3OyO0asl4,49
131
- sunholo-0.76.6.dist-info/top_level.txt,sha256=wt5tadn5--5JrZsjJz2LceoUvcrIvxjHJe-RxuudxAk,8
132
- sunholo-0.76.6.dist-info/RECORD,,
127
+ sunholo-0.76.7.dist-info/LICENSE.txt,sha256=SdE3QjnD3GEmqqg9EX3TM9f7WmtOzqS1KJve8rhbYmU,11345
128
+ sunholo-0.76.7.dist-info/METADATA,sha256=CpUNghG6Y3R7SvzGvB-Mr4HVcMxh_H4fI8phNUs5SSw,7136
129
+ sunholo-0.76.7.dist-info/WHEEL,sha256=Z4pYXqR_rTB7OWNDYFOm1qRk0RX6GFP2o8LgvP453Hk,91
130
+ sunholo-0.76.7.dist-info/entry_points.txt,sha256=bZuN5AIHingMPt4Ro1b_T-FnQvZ3teBes-3OyO0asl4,49
131
+ sunholo-0.76.7.dist-info/top_level.txt,sha256=wt5tadn5--5JrZsjJz2LceoUvcrIvxjHJe-RxuudxAk,8
132
+ sunholo-0.76.7.dist-info/RECORD,,