sunholo 0.66.21__py3-none-any.whl → 0.66.22__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.
@@ -121,7 +121,7 @@ def send_to_qa(user_input, vector_name, chat_history, stream=False, **kwargs):
121
121
 
122
122
  except requests.exceptions.HTTPError as err:
123
123
  log.error(f"HTTP error occurred: {err}")
124
- error_message = f"There was an error processing your request. Please try again later. {str(err)}"
124
+ error_message = f"There was an error processing your request. {str(err)}"
125
125
  if stream:
126
126
  return iter([error_message])
127
127
  else:
@@ -129,7 +129,7 @@ def send_to_qa(user_input, vector_name, chat_history, stream=False, **kwargs):
129
129
 
130
130
  except Exception as err:
131
131
  log.error(f"Other error occurred: {str(err)}")
132
- error_message = f"Something went wrong. Please try again later. {str(err)}"
132
+ error_message = f"Something went wrong. {str(err)}"
133
133
  if stream:
134
134
  return iter([error_message])
135
135
  else:
sunholo/auth/run.py CHANGED
@@ -4,6 +4,7 @@ import inspect
4
4
  from typing import Dict, Optional
5
5
  from ..utils.config import load_config_key, load_config
6
6
  from ..utils.gcp import is_running_on_cloudrun
7
+ from ..utils.api_key import has_multivac_api_key, get_multivac_api_key
7
8
  from ..logging import log
8
9
  from ..agents.route import route_vac
9
10
 
@@ -48,6 +49,10 @@ def get_id_token(url: str) -> str:
48
49
  )
49
50
 
50
51
  def get_header(vector_name) -> Optional[dict]:
52
+ if has_multivac_api_key():
53
+
54
+ return {"x-api-key": get_multivac_api_key()}
55
+
51
56
  if is_running_on_cloudrun():
52
57
  run_url = get_run_url(vector_name)
53
58
  else:
sunholo/cli/chat_vac.py CHANGED
@@ -2,6 +2,7 @@ from ..agents import send_to_qa, handle_special_commands
2
2
  from ..streaming import generate_proxy_stream, can_agent_stream
3
3
  from ..utils.user_ids import generate_user_id
4
4
  from ..utils.config import load_config_key
5
+ from ..utils.api_key import has_multivac_api_key
5
6
  from ..logging import log
6
7
  from ..qna.parsers import parse_output
7
8
  from .run_proxy import clean_proxy_list, start_proxy, stop_proxy
@@ -234,21 +235,24 @@ def resolve_service_url(args, no_config=False):
234
235
  console.print("Found agent_url within vacConfig: {agent_url}")
235
236
 
236
237
  # via public cloud endpoints - assumes no gcloud auth
237
- if os.getenv("MULTIVAC_API_KEY"):
238
- console.rule("Found MULTIVAC_API_KEY")
238
+ if has_multivac_api_key():
239
+ log.debug("Found MULTIVAC_API_KEY")
239
240
  gcp_config = load_config_key("gcp_config", "global", "vacConfig")
240
241
  endpoints_base_url = gcp_config.get("endpoints_base_url")
241
242
  if not endpoints_base_url:
242
243
  console.print("[bold red]MULTIVAC_API_KEY env var is set but no config.gcp_config.endpoints_base_url can be found[/bold red]")
243
244
  sys.exit(1)
244
245
 
245
- service_url = f"{endpoints_base_url}/v1/{agent_name}"
246
+ return f"{endpoints_base_url}/v1/{agent_name}"
246
247
 
247
248
  # via direct access to agent url - requires gcloud auth access
248
249
  elif args.no_proxy:
249
250
 
250
251
  service_url = agent_url or get_cloud_run_service_url(args.project, args.region, agent_name)
251
252
  console.print(f"No proxy, connecting directly to {service_url}")
253
+
254
+ return service_url
255
+
252
256
  else:
253
257
  # via gcloud proxy - requires gcloud auth access
254
258
  try:
@@ -257,7 +261,7 @@ def resolve_service_url(args, no_config=False):
257
261
  console.print(f"[bold red]ERROR: Could not start {args.vac_name} proxy URL: {str(e)}[/bold red]")
258
262
  sys.exit(1)
259
263
 
260
- return service_url
264
+ return service_url
261
265
 
262
266
  def vac_command(args):
263
267
 
sunholo/cli/run_proxy.py CHANGED
@@ -151,7 +151,6 @@ def stop_proxy(service_name, stop_local=True):
151
151
  # kill PID
152
152
 
153
153
  if service_name not in proxies:
154
- print(f"No proxy found for service: {service_name}")
155
154
  return
156
155
 
157
156
  if not stop_local:
@@ -0,0 +1,13 @@
1
+ import os
2
+
3
+ def has_multivac_api_key():
4
+ if os.getenv('MULTIVAC_API_KEY'):
5
+ return True
6
+
7
+ return False
8
+
9
+ def get_multivac_api_key():
10
+ if has_multivac_api_key():
11
+ return os.getenv('MULTIVAC_API_KEY')
12
+
13
+ return None
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sunholo
3
- Version: 0.66.21
3
+ Version: 0.66.22
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.66.21.tar.gz
6
+ Download-URL: https://github.com/sunholo-data/sunholo-py/archive/refs/tags/v0.66.22.tar.gz
7
7
  Author: Holosun ApS
8
8
  Author-email: multivac@sunholo.com
9
9
  License: Apache License, Version 2.0
@@ -2,7 +2,7 @@ sunholo/__init__.py,sha256=0CdpufyRKWyZe7J7UKigL6j_qOorM-p0OjHIAuf9M38,864
2
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
- sunholo/agents/dispatch_to_qa.py,sha256=7Dl82DL3Wt-MxpLyCi_Udf8OPvxU6-UXbgP-pojoPuY,8339
5
+ sunholo/agents/dispatch_to_qa.py,sha256=nFNdxhkr7rVYuUwVoBCBNYBI2Dke6-_z_ZApBEWb_cU,8291
6
6
  sunholo/agents/langserve.py,sha256=FdhQjorAY2bMn2rpuabNT6bU3uqSKWrl8DjpH3L_V7k,4375
7
7
  sunholo/agents/pubsub.py,sha256=5hbbhbBGyVWRpt2sAGC5FEheYH1mCCwVUhZEB1S7vGg,1337
8
8
  sunholo/agents/route.py,sha256=V1HKXTvaNuYgjmT5_QgIQum4O7O0Mw497m6YiMpEzX0,2383
@@ -17,7 +17,7 @@ sunholo/agents/flask/qna_routes.py,sha256=tEsJRnnGoz_cOEaPtPpCCD920jZpLypLK58UzI
17
17
  sunholo/archive/__init__.py,sha256=qNHWm5rGPVOlxZBZCpA1wTYPbalizRT7f8X4rs2t290,31
18
18
  sunholo/archive/archive.py,sha256=C-UhG5x-XtZ8VheQp92IYJqgD0V3NFQjniqlit94t18,1197
19
19
  sunholo/auth/__init__.py,sha256=4owDjSaWYkbTlPK47UHTOC0gCWbZsqn4ZIEw5NWZTlg,28
20
- sunholo/auth/run.py,sha256=1ATGHM1ji-08oDINltfTOabYqG3_nQqL4cNpw-3l4L8,2690
20
+ sunholo/auth/run.py,sha256=n0fVWTn2MOIhTjYanKYhKnGZCOOshTfCgyxH_bW52OM,2855
21
21
  sunholo/bots/__init__.py,sha256=EMFd7e2z68l6pzYOnkzHbLd2xJRvxTKFRNCTuhZ8hIw,130
22
22
  sunholo/bots/discord.py,sha256=cCFae5K1BCa6JVkWGLh_iZ9qFO1JpXb6K4eJrlDfEro,2442
23
23
  sunholo/bots/github_webhook.py,sha256=5pQPRLM_wxxcILVaIzUDV8Kt7Arcm2dL1r1kMMHA524,9629
@@ -32,14 +32,14 @@ sunholo/chunker/pdfs.py,sha256=daCZ1xjn1YvxlifIyxskWNpLJLe-Q9D_Jq12MWx3tZo,2473
32
32
  sunholo/chunker/publish.py,sha256=GNXV6IPdKM2GZUcjGXIERu49D0ITYtizsLIktKVtMjM,2768
33
33
  sunholo/chunker/splitter.py,sha256=FLkDhkePkg_zGQpFBK13Cznw575D-Rf9pcaCpc1HUxY,6726
34
34
  sunholo/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
35
- sunholo/cli/chat_vac.py,sha256=AK1lytiXctNIYOw2L_OmxUKG9q2wg5eddZ9Ei-TKbF4,18622
35
+ sunholo/cli/chat_vac.py,sha256=_M0M1t03QJUdkJEe4Ro74FWRa1LohiztLivbjvK0ECA,18691
36
36
  sunholo/cli/cli.py,sha256=8e00HBN6eYIUJ8cnvKteBJNn7aZPRMk4b82jwcGg9D4,3741
37
37
  sunholo/cli/cli_init.py,sha256=JMZ9AX2cPDZ-_mv3adiv2ToFVNyRPtjk9Biszl1kiR0,2358
38
38
  sunholo/cli/configs.py,sha256=QUM9DvKOdZmEQRM5uI3Nh887T0YDiSMr7O240zTLqws,4546
39
39
  sunholo/cli/deploy.py,sha256=zxdwUsRTRMC8U5vyRv0JiKBLFn84Ug_Tc88-_h9hJSs,1609
40
40
  sunholo/cli/embedder.py,sha256=w7LT1CANSoQbOz8xAP3Zt4C_hP4lzGJOf8XD2jY5jBQ,7291
41
41
  sunholo/cli/merge_texts.py,sha256=U9vdMwKmcPoc6iPOWX5MKSxn49dNGbNzVLw8ui5PhEU,1823
42
- sunholo/cli/run_proxy.py,sha256=8mrZj0GPYO1q5e6cxej-PHdns5pGguWoDrX7RFg0FWo,11581
42
+ sunholo/cli/run_proxy.py,sha256=OeR12ZfnasbJ-smBZQznmGufoDa4iNjUN9FCFo5JxSc,11520
43
43
  sunholo/cli/sun_rich.py,sha256=UpMqeJ0C8i0pkue1AHnnyyX0bFJ9zZeJ7HBR6yhuA8A,54
44
44
  sunholo/cli/swagger.py,sha256=absYKAU-7Yd2eiVNUY-g_WLl2zJfeRUNdWQ0oH8M_HM,1564
45
45
  sunholo/components/__init__.py,sha256=IDoylb74zFKo6NIS3RQqUl0PDFBGVxM1dfUmO7OJ44U,176
@@ -91,6 +91,7 @@ sunholo/streaming/streaming.py,sha256=9z6pXINEopuL_Z1RnmgXAoZJum9dzyuOxqYtEYnjf8
91
91
  sunholo/summarise/__init__.py,sha256=MZk3dblUMODcPb1crq4v-Z508NrFIpkSWNf9FIO8BcU,38
92
92
  sunholo/summarise/summarise.py,sha256=C3HhjepTjUhUC8FLk4jMQIBvq1BcORniwuTFHjPVhVo,3784
93
93
  sunholo/utils/__init__.py,sha256=G11nN_6ATjxpuMfG_BvcUr9UU8onPIgkpTK6CjOcbr8,48
94
+ sunholo/utils/api_key.py,sha256=Ct4bIAQZxzPEw14hP586LpVxBAVi_W9Serpy0BK-7KI,244
94
95
  sunholo/utils/big_context.py,sha256=gJIP7_ZL-YSLhOMq8jmFTMqH1wq8eB1NK7oKPeZAq2s,5578
95
96
  sunholo/utils/config.py,sha256=5lzO9CkLpDslp66ZwSBC_95aA1FQs-zpiOLi5YaYWbM,8907
96
97
  sunholo/utils/config_schema.py,sha256=Wv-ncitzljOhgbDaq9qnFqH5LCuxNv59dTGDWgd1qdk,4189
@@ -104,9 +105,9 @@ sunholo/vertex/__init__.py,sha256=JvHcGFuv6R_nAhY2AdoqqhMpJ5ugeWPZ_svGhWrObBk,13
104
105
  sunholo/vertex/init.py,sha256=JDMUaBRdednzbKF-5p33qqLit2LMsvgvWW-NRz0AqO0,1801
105
106
  sunholo/vertex/memory_tools.py,sha256=8F1iTWnqEK9mX4W5RzCVKIjydIcNp6OFxjn_dtQ3GXo,5379
106
107
  sunholo/vertex/safety.py,sha256=3meAX0HyGZYrH7rXPUAHxtI_3w_zoy_RX7Shtkoa660,1275
107
- sunholo-0.66.21.dist-info/LICENSE.txt,sha256=SdE3QjnD3GEmqqg9EX3TM9f7WmtOzqS1KJve8rhbYmU,11345
108
- sunholo-0.66.21.dist-info/METADATA,sha256=g0fzhIzo4-Re8S14chGFaANtaOSJK-X4-NRr2F7acQQ,6098
109
- sunholo-0.66.21.dist-info/WHEEL,sha256=cpQTJ5IWu9CdaPViMhC9YzF8gZuS5-vlfoFihTBC86A,91
110
- sunholo-0.66.21.dist-info/entry_points.txt,sha256=bZuN5AIHingMPt4Ro1b_T-FnQvZ3teBes-3OyO0asl4,49
111
- sunholo-0.66.21.dist-info/top_level.txt,sha256=wt5tadn5--5JrZsjJz2LceoUvcrIvxjHJe-RxuudxAk,8
112
- sunholo-0.66.21.dist-info/RECORD,,
108
+ sunholo-0.66.22.dist-info/LICENSE.txt,sha256=SdE3QjnD3GEmqqg9EX3TM9f7WmtOzqS1KJve8rhbYmU,11345
109
+ sunholo-0.66.22.dist-info/METADATA,sha256=IlI07pylXN-AMnC-00izt6cVpgCDJhbHpVzIom3CMwE,6098
110
+ sunholo-0.66.22.dist-info/WHEEL,sha256=cpQTJ5IWu9CdaPViMhC9YzF8gZuS5-vlfoFihTBC86A,91
111
+ sunholo-0.66.22.dist-info/entry_points.txt,sha256=bZuN5AIHingMPt4Ro1b_T-FnQvZ3teBes-3OyO0asl4,49
112
+ sunholo-0.66.22.dist-info/top_level.txt,sha256=wt5tadn5--5JrZsjJz2LceoUvcrIvxjHJe-RxuudxAk,8
113
+ sunholo-0.66.22.dist-info/RECORD,,