sunholo 0.66.20__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.
- sunholo/agents/dispatch_to_qa.py +2 -2
- sunholo/agents/swagger.py +2 -3
- sunholo/auth/run.py +5 -0
- sunholo/cli/chat_vac.py +26 -6
- sunholo/cli/run_proxy.py +0 -1
- sunholo/utils/api_key.py +13 -0
- {sunholo-0.66.20.dist-info → sunholo-0.66.22.dist-info}/METADATA +2 -2
- {sunholo-0.66.20.dist-info → sunholo-0.66.22.dist-info}/RECORD +12 -11
- {sunholo-0.66.20.dist-info → sunholo-0.66.22.dist-info}/LICENSE.txt +0 -0
- {sunholo-0.66.20.dist-info → sunholo-0.66.22.dist-info}/WHEEL +0 -0
- {sunholo-0.66.20.dist-info → sunholo-0.66.22.dist-info}/entry_points.txt +0 -0
- {sunholo-0.66.20.dist-info → sunholo-0.66.22.dist-info}/top_level.txt +0 -0
sunholo/agents/dispatch_to_qa.py
CHANGED
|
@@ -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.
|
|
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.
|
|
132
|
+
error_message = f"Something went wrong. {str(err)}"
|
|
133
133
|
if stream:
|
|
134
134
|
return iter([error_message])
|
|
135
135
|
else:
|
sunholo/agents/swagger.py
CHANGED
|
@@ -273,9 +273,8 @@ See more at https://dev.sunholo.com/
|
|
|
273
273
|
try:
|
|
274
274
|
stem = route_vac(vector_name).strip()
|
|
275
275
|
except ValueError:
|
|
276
|
-
stem
|
|
277
|
-
|
|
278
|
-
|
|
276
|
+
log.warning(f"Failed to find URL stem for {vector_name}/{agent_type} - skipping")
|
|
277
|
+
continue
|
|
279
278
|
|
|
280
279
|
for method, endpoints in default_agent_config.items():
|
|
281
280
|
# controls if get requests are protected or not
|
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
|
|
@@ -11,6 +12,7 @@ import sys
|
|
|
11
12
|
import subprocess
|
|
12
13
|
import json
|
|
13
14
|
import requests
|
|
15
|
+
import os
|
|
14
16
|
from pathlib import Path
|
|
15
17
|
|
|
16
18
|
from rich import print
|
|
@@ -226,22 +228,40 @@ def resolve_service_url(args, no_config=False):
|
|
|
226
228
|
if args.url_override:
|
|
227
229
|
|
|
228
230
|
return args.url_override
|
|
231
|
+
|
|
232
|
+
agent_name = load_config_key("agent", args.vac_name, kind="vacConfig")
|
|
233
|
+
agent_url = load_config_key("agent_url", args.vac_name, "vacConfig")
|
|
234
|
+
if agent_url:
|
|
235
|
+
console.print("Found agent_url within vacConfig: {agent_url}")
|
|
236
|
+
|
|
237
|
+
# via public cloud endpoints - assumes no gcloud auth
|
|
238
|
+
if has_multivac_api_key():
|
|
239
|
+
log.debug("Found MULTIVAC_API_KEY")
|
|
240
|
+
gcp_config = load_config_key("gcp_config", "global", "vacConfig")
|
|
241
|
+
endpoints_base_url = gcp_config.get("endpoints_base_url")
|
|
242
|
+
if not endpoints_base_url:
|
|
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]")
|
|
244
|
+
sys.exit(1)
|
|
245
|
+
|
|
246
|
+
return f"{endpoints_base_url}/v1/{agent_name}"
|
|
229
247
|
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
if agent_url:
|
|
233
|
-
console.print("Found agent_url within vacConfig: {agent_url}")
|
|
248
|
+
# via direct access to agent url - requires gcloud auth access
|
|
249
|
+
elif args.no_proxy:
|
|
234
250
|
|
|
235
|
-
service_url = agent_url or get_cloud_run_service_url(args.project, args.region,
|
|
251
|
+
service_url = agent_url or get_cloud_run_service_url(args.project, args.region, agent_name)
|
|
236
252
|
console.print(f"No proxy, connecting directly to {service_url}")
|
|
253
|
+
|
|
254
|
+
return service_url
|
|
255
|
+
|
|
237
256
|
else:
|
|
257
|
+
# via gcloud proxy - requires gcloud auth access
|
|
238
258
|
try:
|
|
239
259
|
service_url = get_service_url(args.vac_name, args.project, args.region, no_config=no_config)
|
|
240
260
|
except ValueError as e:
|
|
241
261
|
console.print(f"[bold red]ERROR: Could not start {args.vac_name} proxy URL: {str(e)}[/bold red]")
|
|
242
262
|
sys.exit(1)
|
|
243
263
|
|
|
244
|
-
|
|
264
|
+
return service_url
|
|
245
265
|
|
|
246
266
|
def vac_command(args):
|
|
247
267
|
|
sunholo/cli/run_proxy.py
CHANGED
sunholo/utils/api_key.py
ADDED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: sunholo
|
|
3
|
-
Version: 0.66.
|
|
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.
|
|
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,12 +2,12 @@ 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=
|
|
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
|
|
9
9
|
sunholo/agents/special_commands.py,sha256=ecD5jrBVXo170sdgPILi0m_m_4nRFEv6qKn5zYEvEK8,6494
|
|
10
|
-
sunholo/agents/swagger.py,sha256=
|
|
10
|
+
sunholo/agents/swagger.py,sha256=npZT7jRJA65xMXNjTcYsC3-RMd8qYP71vy_fSCCcKGg,13572
|
|
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
|
|
@@ -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=
|
|
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=
|
|
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=
|
|
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.
|
|
108
|
-
sunholo-0.66.
|
|
109
|
-
sunholo-0.66.
|
|
110
|
-
sunholo-0.66.
|
|
111
|
-
sunholo-0.66.
|
|
112
|
-
sunholo-0.66.
|
|
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,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|