sunholo 0.62.7__py3-none-any.whl → 0.62.8__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/logging.py CHANGED
@@ -18,17 +18,16 @@ try:
18
18
  except ImportError:
19
19
  Client = None
20
20
 
21
- from .utils.gcp_project import get_gcp_project
22
- from .utils.gcp import is_running_on_gcp, is_gcp_logged_in
23
21
  import logging
24
22
  import inspect
25
23
  import os
26
24
 
27
-
28
25
  class GoogleCloudLogging:
29
26
 
30
27
  _instances = {} # Dictionary to hold instances keyed by a tuple of (project_id, logger_name)
31
28
 
29
+
30
+
32
31
  def __new__(cls, project_id=None, log_level=logging.INFO, logger_name=None):
33
32
  key = (project_id, logger_name)
34
33
  if key not in cls._instances:
@@ -37,6 +36,8 @@ class GoogleCloudLogging:
37
36
 
38
37
  def __init__(self, project_id=None, log_level=logging.INFO, logger_name=None):
39
38
  if not hasattr(self, 'initialized'): # Avoid re-initialization
39
+ from .utils.gcp_project import get_gcp_project # circular import if outside
40
+
40
41
  self.project_id = project_id or get_gcp_project()
41
42
  self.client = Client(project=self.project_id) if is_gcp_logged_in() else None
42
43
  self.logger_name = logger_name
@@ -53,6 +54,7 @@ class GoogleCloudLogging:
53
54
 
54
55
  try:
55
56
  caller_info = self._get_caller_info()
57
+ from .utils.gcp import is_running_on_gcp, is_gcp_logged_in
56
58
  if not is_running_on_gcp() and not is_gcp_logged_in():
57
59
  import logging
58
60
  logging.basicConfig(level=self.log_level, format='%(asctime)s - %(levelname)s - %(message)s')
@@ -99,6 +101,7 @@ class GoogleCloudLogging:
99
101
  if not logger_name and not self.logger_name:
100
102
  raise ValueError("Must provide a logger name e.g. 'run.googleapis.com%2Fstderr'")
101
103
 
104
+ from .utils.gcp import is_running_on_gcp, is_gcp_logged_in
102
105
  if not is_running_on_gcp() and not is_gcp_logged_in():
103
106
  log.basicConfig(level=log.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
104
107
  if log_text:
@@ -223,6 +226,7 @@ def setup_logging(logger_name=None, log_level=logging.INFO, project_id=None):
223
226
 
224
227
  if Client and os.environ.get('GOOGLE_CLOUD_LOGGING') == "1":
225
228
  if project_id is None:
229
+ from .utils.gcp_project import get_gcp_project
226
230
  project_id = get_gcp_project()
227
231
  # Instantiate the GoogleCloudLogging class
228
232
  gc_logger = GoogleCloudLogging(project_id, log_level=log_level, logger_name=logger_name)
sunholo/utils/config.py CHANGED
@@ -192,8 +192,8 @@ def load_config_key(key: str, vector_name: str, kind: str):
192
192
  print(f'API URL: {api_url}')
193
193
  ```
194
194
  """
195
- import logging # can't use sunholo.logging due to circular import
196
- log = logging.getLogger("sunholo")
195
+ # can't use sunholo.logging due to circular import
196
+ from ..logging import log
197
197
 
198
198
  if kind != 'agentConfig':
199
199
  assert isinstance(key, str), f"key must be a string got a {type(key)}"
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sunholo
3
- Version: 0.62.7
3
+ Version: 0.62.8
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.62.7.tar.gz
6
+ Download-URL: https://github.com/sunholo-data/sunholo-py/archive/refs/tags/v0.62.8.tar.gz
7
7
  Author: Holosun ApS
8
8
  Author-email: multivac@sunholo.com
9
9
  License: Apache License, Version 2.0
@@ -1,5 +1,5 @@
1
1
  sunholo/__init__.py,sha256=0CdpufyRKWyZe7J7UKigL6j_qOorM-p0OjHIAuf9M38,864
2
- sunholo/logging.py,sha256=tSvdmPr4VI7AbY9g3fpu0VdQxZ6-TlqU4zgR6AhIRrE,11430
2
+ sunholo/logging.py,sha256=A8e9vE0byIAg-CDPL1DwOvq7ybdxqH1s5qPJwViZyPA,11615
3
3
  sunholo/agents/__init__.py,sha256=CnlbVohPt-Doth9PyROSlN3P8xMV9j9yS19YE-wCS90,341
4
4
  sunholo/agents/chat_history.py,sha256=bkII7PNEbGCaobu2Rnr2rM9dim3BCK0kM-tiWhoI1tw,5219
5
5
  sunholo/agents/dispatch_to_qa.py,sha256=rJvqFLH6V-bKm3Xi_US0L2tMbGgpws3dDmKO2Jy_6v0,8343
@@ -90,7 +90,7 @@ sunholo/summarise/__init__.py,sha256=MZk3dblUMODcPb1crq4v-Z508NrFIpkSWNf9FIO8BcU
90
90
  sunholo/summarise/summarise.py,sha256=C3HhjepTjUhUC8FLk4jMQIBvq1BcORniwuTFHjPVhVo,3784
91
91
  sunholo/utils/__init__.py,sha256=G11nN_6ATjxpuMfG_BvcUr9UU8onPIgkpTK6CjOcbr8,48
92
92
  sunholo/utils/big_context.py,sha256=gJIP7_ZL-YSLhOMq8jmFTMqH1wq8eB1NK7oKPeZAq2s,5578
93
- sunholo/utils/config.py,sha256=wqwmrQed6_N8ygyLd5QwiFj0GE9xv6aodJMI_mKag70,8977
93
+ sunholo/utils/config.py,sha256=GdEXYq2NeO7tz--vZp4ZSdNt5lpIuJb3nb_2BP1KE9Y,8953
94
94
  sunholo/utils/config_schema.py,sha256=Wv-ncitzljOhgbDaq9qnFqH5LCuxNv59dTGDWgd1qdk,4189
95
95
  sunholo/utils/gcp.py,sha256=uueODEpA-P6O15-t0hmcGC9dONLO_hLfzSsSoQnkUss,4854
96
96
  sunholo/utils/gcp_project.py,sha256=qJ7xn0TqkodaeTVPFmPd33jFZItN6OwLF00WzHHZA2U,1218
@@ -100,9 +100,9 @@ sunholo/utils/user_ids.py,sha256=SQd5_H7FE7vcTZp9AQuQDWBXd4FEEd7TeVMQe1H4Ny8,292
100
100
  sunholo/vertex/__init__.py,sha256=7B5Wf41da0dl9JOOrwq35Ob5jcKen_w5T-Tw5f4eoWE,75
101
101
  sunholo/vertex/init.py,sha256=JDMUaBRdednzbKF-5p33qqLit2LMsvgvWW-NRz0AqO0,1801
102
102
  sunholo/vertex/memory_tools.py,sha256=-o9cas_UeRU5gPLi0qcvNwR0HTU5TamzddGLTHOVjZ4,3598
103
- sunholo-0.62.7.dist-info/LICENSE.txt,sha256=SdE3QjnD3GEmqqg9EX3TM9f7WmtOzqS1KJve8rhbYmU,11345
104
- sunholo-0.62.7.dist-info/METADATA,sha256=SqjlTQFyBCynUS6QDTHuLa7Uhk5RdKa6Yo2YaSvI-CE,8057
105
- sunholo-0.62.7.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
106
- sunholo-0.62.7.dist-info/entry_points.txt,sha256=bZuN5AIHingMPt4Ro1b_T-FnQvZ3teBes-3OyO0asl4,49
107
- sunholo-0.62.7.dist-info/top_level.txt,sha256=wt5tadn5--5JrZsjJz2LceoUvcrIvxjHJe-RxuudxAk,8
108
- sunholo-0.62.7.dist-info/RECORD,,
103
+ sunholo-0.62.8.dist-info/LICENSE.txt,sha256=SdE3QjnD3GEmqqg9EX3TM9f7WmtOzqS1KJve8rhbYmU,11345
104
+ sunholo-0.62.8.dist-info/METADATA,sha256=dBltxZ-H_ayYM5k_lcqS0Hmlc73MUqxgpk_Cg9BgfuM,8057
105
+ sunholo-0.62.8.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
106
+ sunholo-0.62.8.dist-info/entry_points.txt,sha256=bZuN5AIHingMPt4Ro1b_T-FnQvZ3teBes-3OyO0asl4,49
107
+ sunholo-0.62.8.dist-info/top_level.txt,sha256=wt5tadn5--5JrZsjJz2LceoUvcrIvxjHJe-RxuudxAk,8
108
+ sunholo-0.62.8.dist-info/RECORD,,