sunholo 0.62.2__py3-none-any.whl → 0.62.3__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/cli/chat_vac.py +6 -2
- sunholo/utils/config.py +11 -4
- sunholo/utils/timedelta.py +14 -0
- {sunholo-0.62.2.dist-info → sunholo-0.62.3.dist-info}/METADATA +2 -2
- {sunholo-0.62.2.dist-info → sunholo-0.62.3.dist-info}/RECORD +9 -8
- {sunholo-0.62.2.dist-info → sunholo-0.62.3.dist-info}/LICENSE.txt +0 -0
- {sunholo-0.62.2.dist-info → sunholo-0.62.3.dist-info}/WHEEL +0 -0
- {sunholo-0.62.2.dist-info → sunholo-0.62.3.dist-info}/entry_points.txt +0 -0
- {sunholo-0.62.2.dist-info → sunholo-0.62.3.dist-info}/top_level.txt +0 -0
sunholo/cli/chat_vac.py
CHANGED
|
@@ -33,8 +33,12 @@ def get_service_url(vac_name, project, region, no_config=False):
|
|
|
33
33
|
port = proxies[agent_name]['port']
|
|
34
34
|
url = f"http://127.0.0.1:{port}"
|
|
35
35
|
else:
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
if agent_name:
|
|
37
|
+
console.print(f"No proxy found running for service: [bold orange]'{agent_name}'[/bold orange] required for [bold orange]{vac_name}[/bold orange] - attempting to connect")
|
|
38
|
+
url = start_proxy(agent_name, region, project)
|
|
39
|
+
else:
|
|
40
|
+
console.print(f"No config for [bold orange]'{vac_name}'[/bold orange] - can't start proxy")
|
|
41
|
+
sys.exit(1)
|
|
38
42
|
|
|
39
43
|
return url
|
|
40
44
|
|
sunholo/utils/config.py
CHANGED
|
@@ -17,6 +17,7 @@ import json
|
|
|
17
17
|
import yaml
|
|
18
18
|
from datetime import datetime, timedelta
|
|
19
19
|
from collections import defaultdict
|
|
20
|
+
from .timedelta import format_timedelta
|
|
20
21
|
|
|
21
22
|
|
|
22
23
|
def get_module_filepath(filepath: str):
|
|
@@ -56,10 +57,15 @@ def load_all_configs():
|
|
|
56
57
|
"""
|
|
57
58
|
from ..logging import log
|
|
58
59
|
|
|
60
|
+
if not os.getenv("_CONFIG_FOLDER", None):
|
|
61
|
+
log.warning("_CONFIG_FOLDER is not set, using os.getcwd() instead")
|
|
62
|
+
else:
|
|
63
|
+
log.warning(f"_CONFIG_FOLDER set to: {os.getenv('_CONFIG_FOLDER')}")
|
|
64
|
+
|
|
59
65
|
config_folder = os.getenv("_CONFIG_FOLDER", os.getcwd())
|
|
60
66
|
config_folder = os.path.join(config_folder, "config")
|
|
61
67
|
|
|
62
|
-
log.
|
|
68
|
+
log.info(f"Loading all configs from folder: {config_folder}")
|
|
63
69
|
current_time = datetime.now()
|
|
64
70
|
|
|
65
71
|
configs_by_kind = defaultdict(dict)
|
|
@@ -74,8 +80,9 @@ def load_all_configs():
|
|
|
74
80
|
# Check cache first
|
|
75
81
|
if filename in config_cache:
|
|
76
82
|
cached_config, cache_time = config_cache[filename]
|
|
77
|
-
|
|
78
|
-
|
|
83
|
+
time_to_recache = (current_time - cache_time)
|
|
84
|
+
if time_to_recache < timedelta(minutes=5):
|
|
85
|
+
log.info(f"Returning cached config for {filename} - recache in {format_timedelta(time_to_recache)}")
|
|
79
86
|
config = cached_config
|
|
80
87
|
else:
|
|
81
88
|
config = reload_config_file(config_file, filename)
|
|
@@ -102,7 +109,7 @@ def reload_config_file(config_file, filename):
|
|
|
102
109
|
config = yaml.safe_load(file)
|
|
103
110
|
|
|
104
111
|
config_cache[filename] = (config, datetime.now())
|
|
105
|
-
log.
|
|
112
|
+
log.info(f"Loaded and cached {filename}")
|
|
106
113
|
return config
|
|
107
114
|
|
|
108
115
|
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
def format_timedelta(td):
|
|
2
|
+
days = td.days
|
|
3
|
+
seconds = td.seconds
|
|
4
|
+
hours, remainder = divmod(seconds, 3600)
|
|
5
|
+
minutes, seconds = divmod(remainder, 60)
|
|
6
|
+
|
|
7
|
+
if days > 0:
|
|
8
|
+
return f"{days} day(s), {hours} hour(s), {minutes} minute(s), {seconds} second(s)"
|
|
9
|
+
elif hours > 0:
|
|
10
|
+
return f"{hours} hour(s), {minutes} minute(s), {seconds} second(s)"
|
|
11
|
+
elif minutes > 0:
|
|
12
|
+
return f"{minutes} minute(s), {seconds} second(s)"
|
|
13
|
+
else:
|
|
14
|
+
return f"{seconds} second(s)"
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: sunholo
|
|
3
|
-
Version: 0.62.
|
|
3
|
+
Version: 0.62.3
|
|
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.
|
|
6
|
+
Download-URL: https://github.com/sunholo-data/sunholo-py/archive/refs/tags/v0.62.3.tar.gz
|
|
7
7
|
Author: Holosun ApS
|
|
8
8
|
Author-email: multivac@sunholo.com
|
|
9
9
|
License: Apache License, Version 2.0
|
|
@@ -31,7 +31,7 @@ sunholo/chunker/pdfs.py,sha256=daCZ1xjn1YvxlifIyxskWNpLJLe-Q9D_Jq12MWx3tZo,2473
|
|
|
31
31
|
sunholo/chunker/publish.py,sha256=PoT8q3XJeFCg10WrLkYhuaaXIrGVkvUD3-R9IfoWoH4,2703
|
|
32
32
|
sunholo/chunker/splitter.py,sha256=FLkDhkePkg_zGQpFBK13Cznw575D-Rf9pcaCpc1HUxY,6726
|
|
33
33
|
sunholo/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
34
|
-
sunholo/cli/chat_vac.py,sha256=
|
|
34
|
+
sunholo/cli/chat_vac.py,sha256=BeDacxULBQN9Q6OvLNv2LTEcE6eghcnhiC7asC5Hx60,14307
|
|
35
35
|
sunholo/cli/cli.py,sha256=if2xx99fIUQG_ZYvMpQsRQIvrjBZJTJSn1JBhjeVAZU,3573
|
|
36
36
|
sunholo/cli/cli_init.py,sha256=JMZ9AX2cPDZ-_mv3adiv2ToFVNyRPtjk9Biszl1kiR0,2358
|
|
37
37
|
sunholo/cli/configs.py,sha256=QUM9DvKOdZmEQRM5uI3Nh887T0YDiSMr7O240zTLqws,4546
|
|
@@ -90,17 +90,18 @@ 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=
|
|
93
|
+
sunholo/utils/config.py,sha256=eshtV7faFhMxs6AQejv7TCKzDsJXmKEyMBQ5CVmFKzg,8593
|
|
94
94
|
sunholo/utils/config_schema.py,sha256=Wv-ncitzljOhgbDaq9qnFqH5LCuxNv59dTGDWgd1qdk,4189
|
|
95
95
|
sunholo/utils/gcp.py,sha256=B2G1YKjeD7X9dqO86Jrp2vPuFwZ223Xl5Tg09Ndw-oc,5760
|
|
96
96
|
sunholo/utils/parsers.py,sha256=OrHmASqIbI45atVOhiGodgLvnfrzkvVzyHnSvAXD89I,3841
|
|
97
|
+
sunholo/utils/timedelta.py,sha256=BbLabEx7_rbErj_YbNM0MBcaFN76DC4PTe4zD2ucezg,493
|
|
97
98
|
sunholo/utils/user_ids.py,sha256=SQd5_H7FE7vcTZp9AQuQDWBXd4FEEd7TeVMQe1H4Ny8,292
|
|
98
99
|
sunholo/vertex/__init__.py,sha256=7B5Wf41da0dl9JOOrwq35Ob5jcKen_w5T-Tw5f4eoWE,75
|
|
99
100
|
sunholo/vertex/init.py,sha256=JDMUaBRdednzbKF-5p33qqLit2LMsvgvWW-NRz0AqO0,1801
|
|
100
101
|
sunholo/vertex/memory_tools.py,sha256=-o9cas_UeRU5gPLi0qcvNwR0HTU5TamzddGLTHOVjZ4,3598
|
|
101
|
-
sunholo-0.62.
|
|
102
|
-
sunholo-0.62.
|
|
103
|
-
sunholo-0.62.
|
|
104
|
-
sunholo-0.62.
|
|
105
|
-
sunholo-0.62.
|
|
106
|
-
sunholo-0.62.
|
|
102
|
+
sunholo-0.62.3.dist-info/LICENSE.txt,sha256=SdE3QjnD3GEmqqg9EX3TM9f7WmtOzqS1KJve8rhbYmU,11345
|
|
103
|
+
sunholo-0.62.3.dist-info/METADATA,sha256=TzYCZbU79szVOV-8zXdNsaGtOcfXscxrUhxmcs0pkxA,8057
|
|
104
|
+
sunholo-0.62.3.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
105
|
+
sunholo-0.62.3.dist-info/entry_points.txt,sha256=bZuN5AIHingMPt4Ro1b_T-FnQvZ3teBes-3OyO0asl4,49
|
|
106
|
+
sunholo-0.62.3.dist-info/top_level.txt,sha256=wt5tadn5--5JrZsjJz2LceoUvcrIvxjHJe-RxuudxAk,8
|
|
107
|
+
sunholo-0.62.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|