sunholo 0.137.0__py3-none-any.whl → 0.138.1__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/special_commands.py +3 -2
- sunholo/utils/config.py +9 -9
- sunholo/utils/config_class.py +1 -1
- {sunholo-0.137.0.dist-info → sunholo-0.138.1.dist-info}/METADATA +1 -1
- {sunholo-0.137.0.dist-info → sunholo-0.138.1.dist-info}/RECORD +9 -9
- {sunholo-0.137.0.dist-info → sunholo-0.138.1.dist-info}/WHEEL +0 -0
- {sunholo-0.137.0.dist-info → sunholo-0.138.1.dist-info}/entry_points.txt +0 -0
- {sunholo-0.137.0.dist-info → sunholo-0.138.1.dist-info}/licenses/LICENSE.txt +0 -0
- {sunholo-0.137.0.dist-info → sunholo-0.138.1.dist-info}/top_level.txt +0 -0
@@ -25,7 +25,7 @@ from ..database import delete_row_from_source, return_sources_last24
|
|
25
25
|
from ..utils.parsers import contains_url, extract_urls
|
26
26
|
from ..chunker.publish import publish_text
|
27
27
|
from ..gcs.add_file import add_file_to_gcs
|
28
|
-
from ..utils
|
28
|
+
from ..utils import ConfigManager
|
29
29
|
from ..custom_logging import log
|
30
30
|
|
31
31
|
# config file?
|
@@ -48,8 +48,9 @@ def handle_special_commands(user_input,
|
|
48
48
|
|
49
49
|
user_input = user_input.strip()
|
50
50
|
|
51
|
+
config = ConfigManager("vector_name")
|
51
52
|
if not cmds:
|
52
|
-
cmds =
|
53
|
+
cmds = config.vacConfig("user_special_cmds")
|
53
54
|
if not cmds:
|
54
55
|
return None
|
55
56
|
|
sunholo/utils/config.py
CHANGED
@@ -58,12 +58,12 @@ def load_all_configs():
|
|
58
58
|
"""
|
59
59
|
from ..custom_logging import log
|
60
60
|
|
61
|
-
if not os.getenv("
|
62
|
-
log.
|
61
|
+
if not os.getenv("VAC_CONFIG_FOLDER"):
|
62
|
+
log.warning("VAC_CONFIG_FOLDER is not set, using os.getcwd() instead")
|
63
63
|
else:
|
64
|
-
log.
|
64
|
+
log.warning(f"VAC_CONFIG_FOLDER set to: {os.getenv('VAC_CONFIG_FOLDER')}")
|
65
65
|
|
66
|
-
config_folder = os.getenv("
|
66
|
+
config_folder = os.getenv("VAC_CONFIG_FOLDER", os.getcwd())
|
67
67
|
config_folder = os.path.join(config_folder, "config")
|
68
68
|
|
69
69
|
log.debug(f"Loading all configs from folder: {config_folder}")
|
@@ -104,7 +104,7 @@ def reload_config_file(config_file, filename):
|
|
104
104
|
Helper function to load a config file and update the cache.
|
105
105
|
"""
|
106
106
|
from ..custom_logging import log
|
107
|
-
with open(config_file, 'r') as file:
|
107
|
+
with open(config_file, 'r', encoding='utf-8') as file:
|
108
108
|
if filename.endswith('.json'):
|
109
109
|
config = json.load(file)
|
110
110
|
else:
|
@@ -119,7 +119,7 @@ def reload_config_file(config_file, filename):
|
|
119
119
|
def load_config(filename: str=None) -> tuple[dict, str]:
|
120
120
|
"""
|
121
121
|
Load configuration from a yaml or json file.
|
122
|
-
Will look relative to `
|
122
|
+
Will look relative to `VAC_CONFIG_FOLDER` environment variable if available, else current directory.
|
123
123
|
|
124
124
|
Args:
|
125
125
|
filename (str, optional): The name of the configuration file. Defaults to the `_CONFIG_FILE` environment variable.
|
@@ -154,11 +154,11 @@ def load_config(filename: str=None) -> tuple[dict, str]:
|
|
154
154
|
log.debug(f"Cache expired for {filename}, reloading...")
|
155
155
|
|
156
156
|
|
157
|
-
if os.getenv("
|
158
|
-
log.debug(f"
|
157
|
+
if os.getenv("VAC_CONFIG_FOLDER"):
|
158
|
+
log.debug(f"VAC_CONFIG_FOLDER: {os.getenv('VAC_CONFIG_FOLDER')}")
|
159
159
|
|
160
160
|
# Join the script directory with the filename
|
161
|
-
config_folder = os.getenv("
|
161
|
+
config_folder = os.getenv("VAC_CONFIG_FOLDER") if os.getenv("VAC_CONFIG_FOLDER") else os.getcwd()
|
162
162
|
|
163
163
|
config_file = os.path.join(config_folder, filename)
|
164
164
|
log.debug(f"Loading config file {config_file}")
|
sunholo/utils/config_class.py
CHANGED
@@ -123,7 +123,7 @@ class ConfigManager:
|
|
123
123
|
from ..custom_logging import log
|
124
124
|
from ruamel.yaml import YAML
|
125
125
|
|
126
|
-
with open(config_file, 'r') as file:
|
126
|
+
with open(config_file, 'r', encoding='utf-8') as file:
|
127
127
|
if filename.endswith('.json'):
|
128
128
|
config = json.load(file)
|
129
129
|
else:
|
@@ -7,7 +7,7 @@ sunholo/agents/dispatch_to_qa.py,sha256=NHihwAoCJ5_Lk11e_jZnucVUGQyZHCB-YpkfMHBC
|
|
7
7
|
sunholo/agents/langserve.py,sha256=C46ph2mnygr6bdHijYWYyfQDI9ylAF0_9Kx2PfcCJpU,4414
|
8
8
|
sunholo/agents/pubsub.py,sha256=TscZN_6am6DfaQkC-Yl18ZIBOoLE-0nDSiil6GpQEh4,1344
|
9
9
|
sunholo/agents/route.py,sha256=mV8tGABbSqcg3PQL02MgQOs41gKEHLMyIJJJcTuFdbE,2988
|
10
|
-
sunholo/agents/special_commands.py,sha256
|
10
|
+
sunholo/agents/special_commands.py,sha256=-9reLRZtTFMuivY4JLk6FDLi5Pf6lphn4SJlSPuMVsE,6492
|
11
11
|
sunholo/agents/swagger.py,sha256=2tzGmpveUMmTREykZvVnDj3j295wyOMu7mUFDnXdY3c,10671
|
12
12
|
sunholo/agents/fastapi/__init__.py,sha256=S_pj4_bTUmDGoq_exaREHlOKThi0zTuGT0VZY0YfODQ,88
|
13
13
|
sunholo/agents/fastapi/base.py,sha256=W-cyF8ZDUH40rc-c-Apw3-_8IIi2e4Y9qRtnoVnsc1Q,2521
|
@@ -150,8 +150,8 @@ sunholo/tools/web_browser.py,sha256=8Gdf02F4zCOeSnijnfaL6jzk4oaSI0cj48o-esoWzwE,
|
|
150
150
|
sunholo/utils/__init__.py,sha256=Hv02T5L2zYWvCso5hzzwm8FQogwBq0OgtUbN_7Quzqc,89
|
151
151
|
sunholo/utils/api_key.py,sha256=Ct4bIAQZxzPEw14hP586LpVxBAVi_W9Serpy0BK-7KI,244
|
152
152
|
sunholo/utils/big_context.py,sha256=HuP9_r_Nx1jvZHxjMEihgoZAXmnCh80zzsj1fq3mIOg,6021
|
153
|
-
sunholo/utils/config.py,sha256=
|
154
|
-
sunholo/utils/config_class.py,sha256=
|
153
|
+
sunholo/utils/config.py,sha256=OeYr4UvhRv94e1OVFab4kuQa5TdbbljQjvhnGlkDewM,9160
|
154
|
+
sunholo/utils/config_class.py,sha256=uSRiJLj8t5UgWNxaq8W4KPnzxb4SkUJ1avXecDHuP-E,9768
|
155
155
|
sunholo/utils/config_schema.py,sha256=Wv-ncitzljOhgbDaq9qnFqH5LCuxNv59dTGDWgd1qdk,4189
|
156
156
|
sunholo/utils/gcp.py,sha256=lus1HH8YhFInw6QRKwfvKZq-Lz-2KQg4ips9v1I_3zE,4783
|
157
157
|
sunholo/utils/gcp_project.py,sha256=Fa0IhCX12bZ1ctF_PKN8PNYd7hihEUfb90kilBfUDjg,1411
|
@@ -168,9 +168,9 @@ sunholo/vertex/init.py,sha256=1OQwcPBKZYBTDPdyU7IM4X4OmiXLdsNV30C-fee2scQ,2875
|
|
168
168
|
sunholo/vertex/memory_tools.py,sha256=tBZxqVZ4InTmdBvLlOYwoSEWu4-kGquc-gxDwZCC4FA,7667
|
169
169
|
sunholo/vertex/safety.py,sha256=S9PgQT1O_BQAkcqauWncRJaydiP8Q_Jzmu9gxYfy1VA,2482
|
170
170
|
sunholo/vertex/type_dict_to_json.py,sha256=uTzL4o9tJRao4u-gJOFcACgWGkBOtqACmb6ihvCErL8,4694
|
171
|
-
sunholo-0.
|
172
|
-
sunholo-0.
|
173
|
-
sunholo-0.
|
174
|
-
sunholo-0.
|
175
|
-
sunholo-0.
|
176
|
-
sunholo-0.
|
171
|
+
sunholo-0.138.1.dist-info/licenses/LICENSE.txt,sha256=SdE3QjnD3GEmqqg9EX3TM9f7WmtOzqS1KJve8rhbYmU,11345
|
172
|
+
sunholo-0.138.1.dist-info/METADATA,sha256=GC4bwGLlBT68d6uqc99tTFX7Y_WtWnombuk2fPrTzls,10067
|
173
|
+
sunholo-0.138.1.dist-info/WHEEL,sha256=0CuiUZ_p9E4cD6NyLD6UG80LBXYyiSYZOKDm5lp32xk,91
|
174
|
+
sunholo-0.138.1.dist-info/entry_points.txt,sha256=bZuN5AIHingMPt4Ro1b_T-FnQvZ3teBes-3OyO0asl4,49
|
175
|
+
sunholo-0.138.1.dist-info/top_level.txt,sha256=wt5tadn5--5JrZsjJz2LceoUvcrIvxjHJe-RxuudxAk,8
|
176
|
+
sunholo-0.138.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|