sunholo 0.64.9__py3-none-any.whl → 0.64.11__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/agents/route.py CHANGED
@@ -14,8 +14,10 @@
14
14
  from ..logging import log
15
15
  from ..utils import load_config_key, load_config
16
16
 
17
- def route_vac(vector_name):
18
-
17
+ def route_vac(vector_name: str) -> str :
18
+ """
19
+ Considers what VAC this vector_name belongs to
20
+ """
19
21
  agent_url = load_config_key('agent_url', vector_name=vector_name, kind="vacConfig")
20
22
  if agent_url:
21
23
  log.info('agent_url found in llm_config.yaml')
sunholo/agents/swagger.py CHANGED
@@ -138,7 +138,7 @@ def generate_swagger(vac_config, agent_config):
138
138
  agent_config_paths = agent_config['agents'].get(agent_type, {})
139
139
  log.info(f'Configuring swagger for agent_type: {agent_type} for vector_name: {vector_name}')
140
140
  try:
141
- stem = route_vac(vector_name)
141
+ stem = route_vac(vector_name).strip()
142
142
  except ValueError:
143
143
  stem = f"${{{agent_type.upper()}_BACKEND_URL}}"
144
144
  log.warning(f"Failed to find URL stem for {vector_name}/{agent_type} - using {stem} instead")
@@ -148,14 +148,19 @@ def generate_swagger(vac_config, agent_config):
148
148
  log.warning(f"Skipping {endpoints}")
149
149
  continue
150
150
  for endpoint_key, endpoint_template in endpoints.items():
151
- endpoint_path = endpoint_template.replace("{stem}", f"/{agent_type}").replace("{vector_name}", vector_name)
151
+ endpoint_template = endpoint_template.strip()
152
+ endpoint_address = endpoint_template.replace("{stem}", stem).replace("{vector_name}", vector_name).strip()
153
+ endpoint_path = endpoint_template.replace("{stem}", f"/{agent_type}").replace("{vector_name}", vector_name).strip()
154
+ log.debug(f"Endpoint_template: {endpoint_template}")
155
+ log.debug(f"endpoint address: {endpoint_address}")
156
+ log.debug(f"endpoint_path: {endpoint_path}")
152
157
  if endpoint_path not in swagger_template['paths']:
153
158
  swagger_template['paths'][endpoint_path] = {}
154
159
  swagger_template['paths'][endpoint_path][method] = {
155
160
  'summary': f"{method.capitalize()} {vector_name}",
156
161
  'operationId': f"{method}_{agent_type}_{endpoint_key}",
157
162
  'x-google-backend': {
158
- 'address': endpoint_template.replace("{stem}", stem).replace("{vector_name}", vector_name).strip(),
163
+ 'address': endpoint_address,
159
164
  'protocol': 'h2'
160
165
  },
161
166
  'responses': copy.deepcopy(agent_config_paths.get('response', {}).get(endpoint_key, {
@@ -176,7 +181,7 @@ def generate_swagger(vac_config, agent_config):
176
181
  continue
177
182
  log.info(f'Applying default configuration for agent_type: {agent_type} for vector_name: {vector_name}')
178
183
  try:
179
- stem = route_vac(vector_name)
184
+ stem = route_vac(vector_name).strip()
180
185
  except ValueError:
181
186
  stem = f"${{{agent_type.upper()}_BACKEND_URL}}"
182
187
  log.warning(f"Failed to find URL stem for {vector_name}/{agent_type} - using {stem} instead")
@@ -185,14 +190,19 @@ def generate_swagger(vac_config, agent_config):
185
190
  if method not in ['get', 'post']:
186
191
  continue
187
192
  for endpoint_key, endpoint_template in endpoints.items():
188
- endpoint_path = endpoint_template.replace("{stem}", f"/{agent_type}").replace("{vector_name}", vector_name)
193
+ endpoint_template = endpoint_template.strip()
194
+ endpoint_address = endpoint_template.replace("{stem}", stem).replace("{vector_name}", vector_name).strip()
195
+ endpoint_path = endpoint_template.replace("{stem}", f"/{agent_type}").replace("{vector_name}", vector_name).strip()
196
+ log.debug(f"default Endpoint_template: {endpoint_template}")
197
+ log.debug(f"default endpoint address: {endpoint_address}")
198
+ log.debug(f"default endpoint_path: {endpoint_path}")
189
199
  if endpoint_path not in swagger_template['paths']:
190
200
  swagger_template['paths'][endpoint_path] = {}
191
201
  swagger_template['paths'][endpoint_path][method] = {
192
202
  'summary': f"{method.capitalize()} {agent_type}",
193
203
  'operationId': f"{method}_{agent_type}_{endpoint_key}",
194
204
  'x-google-backend': {
195
- 'address': endpoint_template.replace("{stem}", stem).replace("{vector_name}", vector_name).strip(),
205
+ 'address': endpoint_address,
196
206
  'protocol': 'h2'
197
207
  },
198
208
  'responses': copy.deepcopy(default_agent_config.get('response', {}).get(endpoint_key, {
@@ -205,4 +215,4 @@ def generate_swagger(vac_config, agent_config):
205
215
  }))
206
216
  }
207
217
 
208
- return yaml.dump(swagger_template, default_flow_style=False)
218
+ return yaml.dump(swagger_template, default_flow_style=False, width=float("inf"))
sunholo/logging.py CHANGED
@@ -18,6 +18,7 @@ try:
18
18
  except ImportError:
19
19
  Client = None
20
20
 
21
+ from .utils.version import sunholo_version
21
22
  import logging
22
23
  import inspect
23
24
  import os
@@ -44,6 +45,7 @@ class GoogleCloudLogging:
44
45
  self.logger_name = logger_name
45
46
  self.log_level = log_level
46
47
  self.initialized = True # Mark as initialized
48
+ self.version = sunholo_version()
47
49
  print(f"Initialized logging object for logger_name: {logger_name}")
48
50
 
49
51
 
@@ -106,9 +108,9 @@ class GoogleCloudLogging:
106
108
  if not is_running_on_gcp() and not is_gcp_logged_in():
107
109
  log.basicConfig(level=log.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
108
110
  if log_text:
109
- log.info(f"[{severity}][{logger_name or self.logger_name}] - {log_text}")
111
+ log.info(f"[{severity}][{logger_name or self.logger_name}][{self.version}] - {log_text}")
110
112
  elif log_struct:
111
- log.info(f"[{severity}][{logger_name or self.logger_name}] - {str(log_struct)}")
113
+ log.info(f"[{severity}][{logger_name or self.logger_name}][{self.version}] - {str(log_struct)}")
112
114
 
113
115
  logger = self.client.logger(logger_name or self.logger_name)
114
116
 
sunholo/utils/config.py CHANGED
@@ -70,7 +70,7 @@ def load_all_configs():
70
70
 
71
71
  configs_by_kind = defaultdict(dict)
72
72
  for filename in os.listdir(config_folder):
73
- log.debug(f"config file: {filename}")
73
+ #log.debug(f"config file: {filename}")
74
74
  if filename in ["cloudbuild.yaml", "cloud_run_urls.json"]:
75
75
  # skip these
76
76
  continue
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sunholo
3
- Version: 0.64.9
3
+ Version: 0.64.11
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.64.9.tar.gz
6
+ Download-URL: https://github.com/sunholo-data/sunholo-py/archive/refs/tags/v0.64.11.tar.gz
7
7
  Author: Holosun ApS
8
8
  Author-email: multivac@sunholo.com
9
9
  License: Apache License, Version 2.0
@@ -1,13 +1,13 @@
1
1
  sunholo/__init__.py,sha256=0CdpufyRKWyZe7J7UKigL6j_qOorM-p0OjHIAuf9M38,864
2
- sunholo/logging.py,sha256=hPmB5VgHV9fN2Ze55jNkRx5QNfxRtezYQkhu_RaE8mc,11667
2
+ sunholo/logging.py,sha256=00VGGArfWHbJuHHSJ4kXhHTggWnRfbVYMcZNOYIsqnA,11787
3
3
  sunholo/agents/__init__.py,sha256=Hb4NXy2rN-83Z0-UDRwX-LXv2R29lcbSFPf8G6q4fZg,380
4
4
  sunholo/agents/chat_history.py,sha256=bkII7PNEbGCaobu2Rnr2rM9dim3BCK0kM-tiWhoI1tw,5219
5
5
  sunholo/agents/dispatch_to_qa.py,sha256=7Dl82DL3Wt-MxpLyCi_Udf8OPvxU6-UXbgP-pojoPuY,8339
6
6
  sunholo/agents/langserve.py,sha256=FdhQjorAY2bMn2rpuabNT6bU3uqSKWrl8DjpH3L_V7k,4375
7
7
  sunholo/agents/pubsub.py,sha256=5hbbhbBGyVWRpt2sAGC5FEheYH1mCCwVUhZEB1S7vGg,1337
8
- sunholo/agents/route.py,sha256=-O6kljLSPdBOsysKyn6hZvXZlNlqNDHGwWl2WwR6Tss,2304
8
+ sunholo/agents/route.py,sha256=V1HKXTvaNuYgjmT5_QgIQum4O7O0Mw497m6YiMpEzX0,2383
9
9
  sunholo/agents/special_commands.py,sha256=ecD5jrBVXo170sdgPILi0m_m_4nRFEv6qKn5zYEvEK8,6494
10
- sunholo/agents/swagger.py,sha256=wQ6i72OIqrjbmdc0mSL7_PUsqsiiQQXVXZcmn7oLC2g,8444
10
+ sunholo/agents/swagger.py,sha256=KCSXoVvZLDYDLxJNqOJocpc5wMfD8_z9MEmap0kNFPY,9142
11
11
  sunholo/agents/fastapi/__init__.py,sha256=S_pj4_bTUmDGoq_exaREHlOKThi0zTuGT0VZY0YfODQ,88
12
12
  sunholo/agents/fastapi/base.py,sha256=clk76cHbUAvU0OYJrRfCWX_5f0ACbhDsIzYBhI3wyoE,2514
13
13
  sunholo/agents/fastapi/qna_routes.py,sha256=DgK4Btu5XriOC1JaRQ4G_nWEjJfnQ0J5pyLanF6eF1g,3857
@@ -92,7 +92,7 @@ sunholo/summarise/__init__.py,sha256=MZk3dblUMODcPb1crq4v-Z508NrFIpkSWNf9FIO8BcU
92
92
  sunholo/summarise/summarise.py,sha256=C3HhjepTjUhUC8FLk4jMQIBvq1BcORniwuTFHjPVhVo,3784
93
93
  sunholo/utils/__init__.py,sha256=G11nN_6ATjxpuMfG_BvcUr9UU8onPIgkpTK6CjOcbr8,48
94
94
  sunholo/utils/big_context.py,sha256=gJIP7_ZL-YSLhOMq8jmFTMqH1wq8eB1NK7oKPeZAq2s,5578
95
- sunholo/utils/config.py,sha256=v5J5j2K9TDDw2mJne5q63jCqvp9Few0Wgesc7j-46HI,8950
95
+ sunholo/utils/config.py,sha256=xwI-3Ire8vGzvUydokfNz4Ubolxy4tA_4DNGcyGPO90,8951
96
96
  sunholo/utils/config_schema.py,sha256=Wv-ncitzljOhgbDaq9qnFqH5LCuxNv59dTGDWgd1qdk,4189
97
97
  sunholo/utils/gcp.py,sha256=uueODEpA-P6O15-t0hmcGC9dONLO_hLfzSsSoQnkUss,4854
98
98
  sunholo/utils/gcp_project.py,sha256=0ozs6tzI4qEvEeXb8MxLnCdEVoWKxlM6OH05htj7_tc,1325
@@ -104,9 +104,9 @@ sunholo/vertex/__init__.py,sha256=JvHcGFuv6R_nAhY2AdoqqhMpJ5ugeWPZ_svGhWrObBk,13
104
104
  sunholo/vertex/init.py,sha256=JDMUaBRdednzbKF-5p33qqLit2LMsvgvWW-NRz0AqO0,1801
105
105
  sunholo/vertex/memory_tools.py,sha256=8F1iTWnqEK9mX4W5RzCVKIjydIcNp6OFxjn_dtQ3GXo,5379
106
106
  sunholo/vertex/safety.py,sha256=3meAX0HyGZYrH7rXPUAHxtI_3w_zoy_RX7Shtkoa660,1275
107
- sunholo-0.64.9.dist-info/LICENSE.txt,sha256=SdE3QjnD3GEmqqg9EX3TM9f7WmtOzqS1KJve8rhbYmU,11345
108
- sunholo-0.64.9.dist-info/METADATA,sha256=ZYfvslnkrApniDFnCslb3MPOyoNn2L9qZZczHNvfJCI,5971
109
- sunholo-0.64.9.dist-info/WHEEL,sha256=cpQTJ5IWu9CdaPViMhC9YzF8gZuS5-vlfoFihTBC86A,91
110
- sunholo-0.64.9.dist-info/entry_points.txt,sha256=bZuN5AIHingMPt4Ro1b_T-FnQvZ3teBes-3OyO0asl4,49
111
- sunholo-0.64.9.dist-info/top_level.txt,sha256=wt5tadn5--5JrZsjJz2LceoUvcrIvxjHJe-RxuudxAk,8
112
- sunholo-0.64.9.dist-info/RECORD,,
107
+ sunholo-0.64.11.dist-info/LICENSE.txt,sha256=SdE3QjnD3GEmqqg9EX3TM9f7WmtOzqS1KJve8rhbYmU,11345
108
+ sunholo-0.64.11.dist-info/METADATA,sha256=B9yM3g1RYqAHvbQJZAkMDhhWM1GQtzwn6k8IhTDM_KU,5973
109
+ sunholo-0.64.11.dist-info/WHEEL,sha256=cpQTJ5IWu9CdaPViMhC9YzF8gZuS5-vlfoFihTBC86A,91
110
+ sunholo-0.64.11.dist-info/entry_points.txt,sha256=bZuN5AIHingMPt4Ro1b_T-FnQvZ3teBes-3OyO0asl4,49
111
+ sunholo-0.64.11.dist-info/top_level.txt,sha256=wt5tadn5--5JrZsjJz2LceoUvcrIvxjHJe-RxuudxAk,8
112
+ sunholo-0.64.11.dist-info/RECORD,,