sunholo 0.61.6__py3-none-any.whl → 0.61.8__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/flask/base.py +1 -0
- sunholo/agents/flask/qna_routes.py +3 -4
- sunholo/chunker/data_to_embed_pubsub.py +24 -0
- sunholo/cli/chat_vac.py +8 -9
- sunholo/cli/cli.py +7 -0
- sunholo/cli/run_proxy.py +6 -22
- sunholo/database/alloydb.py +1 -1
- {sunholo-0.61.6.dist-info → sunholo-0.61.8.dist-info}/METADATA +2 -2
- {sunholo-0.61.6.dist-info → sunholo-0.61.8.dist-info}/RECORD +13 -13
- {sunholo-0.61.6.dist-info → sunholo-0.61.8.dist-info}/LICENSE.txt +0 -0
- {sunholo-0.61.6.dist-info → sunholo-0.61.8.dist-info}/WHEEL +0 -0
- {sunholo-0.61.6.dist-info → sunholo-0.61.8.dist-info}/entry_points.txt +0 -0
- {sunholo-0.61.6.dist-info → sunholo-0.61.8.dist-info}/top_level.txt +0 -0
sunholo/agents/flask/base.py
CHANGED
|
@@ -27,13 +27,12 @@ from ...utils.config import load_config
|
|
|
27
27
|
try:
|
|
28
28
|
from flask import request, jsonify, Response
|
|
29
29
|
except ImportError:
|
|
30
|
-
|
|
30
|
+
pass
|
|
31
31
|
|
|
32
32
|
try:
|
|
33
33
|
from langfuse.decorators import langfuse_context, observe
|
|
34
|
-
except ImportError
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
except ImportError:
|
|
35
|
+
pass
|
|
37
36
|
|
|
38
37
|
def register_qna_routes(app, stream_interpreter, vac_interpreter):
|
|
39
38
|
|
|
@@ -11,11 +11,31 @@
|
|
|
11
11
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
|
+
import pathlib
|
|
15
|
+
|
|
14
16
|
from ..logging import log
|
|
15
17
|
from ..pubsub import process_pubsub_message
|
|
16
18
|
from .message_data import handle_gcs_message, handle_google_drive_message, handle_github_message, handle_http_message, handle_json_content_message
|
|
17
19
|
from .publish import process_docs_chunks_vector_name
|
|
20
|
+
from .splitter import chunk_doc_to_docs
|
|
21
|
+
|
|
18
22
|
from ..llamaindex.import_files import llamaindex_chunker_check
|
|
23
|
+
from . import loaders
|
|
24
|
+
|
|
25
|
+
def direct_file_to_embed(file_name: pathlib.Path, metadata: dict, vector_name: str):
|
|
26
|
+
|
|
27
|
+
log.info(f"Sending direct file upload {file_name} to loaders.read_file_to_documents {metadata}")
|
|
28
|
+
docs = loaders.read_file_to_documents(file_name, metadata=metadata)
|
|
29
|
+
if docs is None:
|
|
30
|
+
log.warning(f"loaders.read_file_to_documents docs2 failed to load file {metadata}")
|
|
31
|
+
|
|
32
|
+
return None
|
|
33
|
+
|
|
34
|
+
chunks = chunk_doc_to_docs(docs, file_name.suffix, vector_name=vector_name)
|
|
35
|
+
|
|
36
|
+
return format_chunk_return(chunks, metadata, vector_name)
|
|
37
|
+
|
|
38
|
+
|
|
19
39
|
|
|
20
40
|
def data_to_embed_pubsub(data: dict):
|
|
21
41
|
"""Triggered from a message on a Cloud Pub/Sub topic.
|
|
@@ -62,7 +82,11 @@ def process_chunker_data(message_data, metadata, vector_name):
|
|
|
62
82
|
|
|
63
83
|
else:
|
|
64
84
|
chunks, metadata = handle_json_content_message(message_data, metadata, vector_name)
|
|
85
|
+
|
|
86
|
+
return format_chunk_return(chunks, metadata, vector_name)
|
|
87
|
+
|
|
65
88
|
|
|
89
|
+
def format_chunk_return(chunks, metadata, vector_name):
|
|
66
90
|
# to be really sure
|
|
67
91
|
if metadata:
|
|
68
92
|
metadata["vector_name"] = vector_name
|
sunholo/cli/chat_vac.py
CHANGED
|
@@ -157,20 +157,19 @@ def resolve_service_url(args, no_config=False):
|
|
|
157
157
|
|
|
158
158
|
return args.url_override
|
|
159
159
|
|
|
160
|
-
if
|
|
161
|
-
try:
|
|
162
|
-
service_url = get_service_url(args.vac_name, args.project, args.region, no_config=no_config)
|
|
163
|
-
except ValueError as e:
|
|
164
|
-
console.print(f"[bold red]ERROR: Could not start {args.vac_name} proxy URL: {str(e)}[/bold red]")
|
|
165
|
-
sys.exit(1)
|
|
166
|
-
else:
|
|
167
|
-
console.print(f"Not using a proxy, connecting directly to {service_url}")
|
|
168
|
-
|
|
160
|
+
if args.no_proxy:
|
|
169
161
|
agent_url = load_config_key("agent_url", args.vac_name, "vacConfig")
|
|
170
162
|
if agent_url:
|
|
171
163
|
console.print("Found agent_url within vacConfig: {agent_url}")
|
|
172
164
|
|
|
173
165
|
service_url = agent_url or get_cloud_run_service_url(args.project, args.region, args.vac_name)
|
|
166
|
+
console.print(f"No proxy, connecting directly to {service_url}")
|
|
167
|
+
else:
|
|
168
|
+
try:
|
|
169
|
+
service_url = get_service_url(args.vac_name, args.project, args.region, no_config=no_config)
|
|
170
|
+
except ValueError as e:
|
|
171
|
+
console.print(f"[bold red]ERROR: Could not start {args.vac_name} proxy URL: {str(e)}[/bold red]")
|
|
172
|
+
sys.exit(1)
|
|
174
173
|
|
|
175
174
|
return service_url
|
|
176
175
|
|
sunholo/cli/cli.py
CHANGED
|
@@ -15,6 +15,7 @@ from ..logging import log
|
|
|
15
15
|
|
|
16
16
|
from .sun_rich import console
|
|
17
17
|
import sys
|
|
18
|
+
from rich.panel import Panel
|
|
18
19
|
|
|
19
20
|
|
|
20
21
|
def load_default_gcp_config():
|
|
@@ -31,6 +32,12 @@ def load_default_gcp_config():
|
|
|
31
32
|
|
|
32
33
|
def main(args=None):
|
|
33
34
|
|
|
35
|
+
console.print(
|
|
36
|
+
Panel("Welcome to Sunholo Command Line Interface, your assistant to deploy GenAI Virtual Agent Computers (VACs) to Multivac or your own Cloud.",
|
|
37
|
+
title="Sunholo GenAIOps Assistant CLI",
|
|
38
|
+
subtitle="Documentation at https://dev.sunholo.com/")
|
|
39
|
+
)
|
|
40
|
+
console.rule()
|
|
34
41
|
|
|
35
42
|
"""
|
|
36
43
|
Entry point for the sunholo console script. This function parses command line arguments
|
sunholo/cli/run_proxy.py
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import subprocess
|
|
2
2
|
import os
|
|
3
|
-
import sys
|
|
4
3
|
import signal
|
|
5
4
|
import json
|
|
6
5
|
|
|
@@ -11,19 +10,6 @@ from rich import print
|
|
|
11
10
|
PROXY_TRACKER_FILE = '.vac_proxy_tracker.json'
|
|
12
11
|
DEFAULT_PORT = 8080
|
|
13
12
|
|
|
14
|
-
def create_hyperlink(url, text):
|
|
15
|
-
"""
|
|
16
|
-
Creates a hyperlink for the console.
|
|
17
|
-
|
|
18
|
-
Args:
|
|
19
|
-
url (str): The URL for the hyperlink.
|
|
20
|
-
text (str): The text to display for the hyperlink.
|
|
21
|
-
|
|
22
|
-
Returns:
|
|
23
|
-
str: The formatted hyperlink.
|
|
24
|
-
"""
|
|
25
|
-
return f"\033]8;;{url}\033\\{text}\033]8;;\033\\"
|
|
26
|
-
|
|
27
13
|
|
|
28
14
|
def get_next_available_port(proxies, default_port):
|
|
29
15
|
"""
|
|
@@ -94,9 +80,6 @@ def save_proxies(proxies):
|
|
|
94
80
|
with open(PROXY_TRACKER_FILE, 'w') as file:
|
|
95
81
|
json.dump(proxies, file, indent=4)
|
|
96
82
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
83
|
def start_proxy(service_name, region, project, port=None, local=False, app_type=None, app_folder=None, log_file=None):
|
|
101
84
|
"""
|
|
102
85
|
Starts the gcloud proxy to the Cloud Run service and stores the PID.
|
|
@@ -116,8 +99,6 @@ def start_proxy(service_name, region, project, port=None, local=False, app_type=
|
|
|
116
99
|
if not port:
|
|
117
100
|
port = get_next_available_port(proxies, DEFAULT_PORT)
|
|
118
101
|
|
|
119
|
-
|
|
120
|
-
|
|
121
102
|
if local:
|
|
122
103
|
start_local(service_name, port, app_type, app_folder, log_file)
|
|
123
104
|
else:
|
|
@@ -160,6 +141,9 @@ def stop_proxy(service_name, stop_local=True):
|
|
|
160
141
|
"""
|
|
161
142
|
proxies = clean_proxy_list()
|
|
162
143
|
|
|
144
|
+
# ps aux | grep gcloud
|
|
145
|
+
# kill PID
|
|
146
|
+
|
|
163
147
|
if service_name not in proxies:
|
|
164
148
|
print(f"No proxy found for service: {service_name}")
|
|
165
149
|
return
|
|
@@ -248,7 +232,7 @@ def start_local(service_name, port, app_type, app_folder, log_file):
|
|
|
248
232
|
return
|
|
249
233
|
|
|
250
234
|
if app_type == 'flask':
|
|
251
|
-
command = [
|
|
235
|
+
command = ["gunicorn", "--bind", f"0.0.0.0:{port}", "--workers", "4", "app:app"]
|
|
252
236
|
elif app_type == 'fastapi':
|
|
253
237
|
command = ["uvicorn", "app:app", f"--port={port}"]
|
|
254
238
|
else:
|
|
@@ -304,11 +288,11 @@ def setup_proxy_subparser(subparsers):
|
|
|
304
288
|
args.app_folder,
|
|
305
289
|
args.log_file))
|
|
306
290
|
|
|
307
|
-
stop_parser = proxy_subparsers.add_parser('stop', help='Stop the proxy to the Cloud Run service.')
|
|
291
|
+
stop_parser = proxy_subparsers.add_parser('stop', help='Stop the proxy to the Cloud Run service. Backup: `kill -9 PID`')
|
|
308
292
|
stop_parser.add_argument('service_name', help='Name of the Cloud Run service.')
|
|
309
293
|
stop_parser.set_defaults(func=lambda args: stop_proxy(args.service_name))
|
|
310
294
|
|
|
311
|
-
list_parser = proxy_subparsers.add_parser('list', help='List all running proxies.')
|
|
295
|
+
list_parser = proxy_subparsers.add_parser('list', help='List all running proxies. Examine port via `lsof-i :PORT`')
|
|
312
296
|
list_parser.set_defaults(func=lambda args: list_proxies())
|
|
313
297
|
|
|
314
298
|
stop_all_parser = proxy_subparsers.add_parser('stop-all', help='Stop all running proxies.')
|
sunholo/database/alloydb.py
CHANGED
|
@@ -8,7 +8,7 @@ try:
|
|
|
8
8
|
from langchain_google_alloydb_pg import AlloyDBEngine, Column, AlloyDBLoader, AlloyDBDocumentSaver
|
|
9
9
|
from google.cloud.alloydb.connector import IPTypes
|
|
10
10
|
except ImportError:
|
|
11
|
-
|
|
11
|
+
pass
|
|
12
12
|
|
|
13
13
|
from .database import get_vector_size
|
|
14
14
|
from ..logging import log
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: sunholo
|
|
3
|
-
Version: 0.61.
|
|
3
|
+
Version: 0.61.8
|
|
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.61.
|
|
6
|
+
Download-URL: https://github.com/sunholo-data/sunholo-py/archive/refs/tags/v0.61.8.tar.gz
|
|
7
7
|
Author: Holosun ApS
|
|
8
8
|
Author-email: multivac@sunholo.com
|
|
9
9
|
License: Apache License, Version 2.0
|
|
@@ -11,8 +11,8 @@ sunholo/agents/fastapi/__init__.py,sha256=S_pj4_bTUmDGoq_exaREHlOKThi0zTuGT0VZY0
|
|
|
11
11
|
sunholo/agents/fastapi/base.py,sha256=clk76cHbUAvU0OYJrRfCWX_5f0ACbhDsIzYBhI3wyoE,2514
|
|
12
12
|
sunholo/agents/fastapi/qna_routes.py,sha256=DgK4Btu5XriOC1JaRQ4G_nWEjJfnQ0J5pyLanF6eF1g,3857
|
|
13
13
|
sunholo/agents/flask/__init__.py,sha256=uqfHNw2Ru3EJ4dJEcbp86h_lkquBQPMxZbjhV_xe3rs,72
|
|
14
|
-
sunholo/agents/flask/base.py,sha256=
|
|
15
|
-
sunholo/agents/flask/qna_routes.py,sha256=
|
|
14
|
+
sunholo/agents/flask/base.py,sha256=FgSaCODyoTtlstJtsqlLPScdgRUtv9_plxftdzHdVFo,809
|
|
15
|
+
sunholo/agents/flask/qna_routes.py,sha256=t5BabGKjlK3sMcaXZywja47gtQRoROXXz6NMm8H-SSc,8561
|
|
16
16
|
sunholo/archive/__init__.py,sha256=qNHWm5rGPVOlxZBZCpA1wTYPbalizRT7f8X4rs2t290,31
|
|
17
17
|
sunholo/archive/archive.py,sha256=C-UhG5x-XtZ8VheQp92IYJqgD0V3NFQjniqlit94t18,1197
|
|
18
18
|
sunholo/auth/__init__.py,sha256=4owDjSaWYkbTlPK47UHTOC0gCWbZsqn4ZIEw5NWZTlg,28
|
|
@@ -22,7 +22,7 @@ sunholo/bots/discord.py,sha256=cCFae5K1BCa6JVkWGLh_iZ9qFO1JpXb6K4eJrlDfEro,2442
|
|
|
22
22
|
sunholo/bots/github_webhook.py,sha256=5pQPRLM_wxxcILVaIzUDV8Kt7Arcm2dL1r1kMMHA524,9629
|
|
23
23
|
sunholo/bots/webapp.py,sha256=EIMxdAJ_xtufwJmvnn7N_Fb_1hZ9DjhJ0Kf_hp02vEU,1926
|
|
24
24
|
sunholo/chunker/__init__.py,sha256=UhQBZTKwDfBXm0TPv4LvsGc5pdUGCbYzi3qPTOkU4gw,55
|
|
25
|
-
sunholo/chunker/data_to_embed_pubsub.py,sha256=
|
|
25
|
+
sunholo/chunker/data_to_embed_pubsub.py,sha256=_uIf1hLD-fF3_S_TaG5PzpzoEcnooehN9K9CaGN7PwI,3820
|
|
26
26
|
sunholo/chunker/doc_handling.py,sha256=rIyknpzDyj5A0u_DqSQVD_CXLRNZPOU6TCL4bhCdjOI,8563
|
|
27
27
|
sunholo/chunker/images.py,sha256=Xmh1vwHrVhoXm5iH2dhCc52O8YgdzE8KrDSdL-pGnp8,1861
|
|
28
28
|
sunholo/chunker/loaders.py,sha256=xiToUVgPz2ZzcqpUAq7aNP3PTenb_rBUAFzu0JPycIg,10268
|
|
@@ -31,14 +31,14 @@ 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=
|
|
35
|
-
sunholo/cli/cli.py,sha256=
|
|
34
|
+
sunholo/cli/chat_vac.py,sha256=A_xavw034dE_Pr6dCRDp_OJrO3xs_F7S-W_QkK3r1Og,13165
|
|
35
|
+
sunholo/cli/cli.py,sha256=ya5gCK9z4c4tF3XhK9gga1TAC7DnDJES1voDV2TV5xQ,3128
|
|
36
36
|
sunholo/cli/cli_init.py,sha256=JMZ9AX2cPDZ-_mv3adiv2ToFVNyRPtjk9Biszl1kiR0,2358
|
|
37
37
|
sunholo/cli/configs.py,sha256=QUM9DvKOdZmEQRM5uI3Nh887T0YDiSMr7O240zTLqws,4546
|
|
38
38
|
sunholo/cli/deploy.py,sha256=zxdwUsRTRMC8U5vyRv0JiKBLFn84Ug_Tc88-_h9hJSs,1609
|
|
39
39
|
sunholo/cli/embedder.py,sha256=hqIfqGCeV5UI_0dllNFsjdyjVWgC0Kmnw8kAKhN4jCI,5482
|
|
40
40
|
sunholo/cli/merge_texts.py,sha256=U9vdMwKmcPoc6iPOWX5MKSxn49dNGbNzVLw8ui5PhEU,1823
|
|
41
|
-
sunholo/cli/run_proxy.py,sha256=
|
|
41
|
+
sunholo/cli/run_proxy.py,sha256=0ft_9FUL9d1NKM2ABMMPpvXRTRZd9f-lR2FCahiGzlU,11281
|
|
42
42
|
sunholo/cli/sun_rich.py,sha256=UpMqeJ0C8i0pkue1AHnnyyX0bFJ9zZeJ7HBR6yhuA8A,54
|
|
43
43
|
sunholo/components/__init__.py,sha256=RJGNEihwvRIiDScKis04RHJv4yZGI1UpXlOmuCptNZI,208
|
|
44
44
|
sunholo/components/llm.py,sha256=T4we3tGmqUj4tPwxQr9M6AXv_BALqZV_dRSvINan-oU,10374
|
|
@@ -46,7 +46,7 @@ sunholo/components/prompt.py,sha256=eZSghXkIlRzXiSrzgkG7e5ytUYq6R6LV-qjHU8jStig,
|
|
|
46
46
|
sunholo/components/retriever.py,sha256=_Lyt9RIgb2PD-rhV6oKAadiUs3ukT5uAYGW197tEskw,3755
|
|
47
47
|
sunholo/components/vectorstore.py,sha256=lB8vx_N6eBA44orNeVo1WRn0Q8GCIjvPPT9AfiPWBWE,5620
|
|
48
48
|
sunholo/database/__init__.py,sha256=Zz0Shcq-CtStf9rJGIYB_Ybzb8rY_Q9mfSj-nviM490,241
|
|
49
|
-
sunholo/database/alloydb.py,sha256=
|
|
49
|
+
sunholo/database/alloydb.py,sha256=zvT50Df7r-jJPo5lEEWbjlXzVr0KuqN6WINgRtiSyxo,17014
|
|
50
50
|
sunholo/database/database.py,sha256=doY05kG8BZBLL-arh4hq5ef1ouWOtGHqdsDc6M2YHgk,7345
|
|
51
51
|
sunholo/database/lancedb.py,sha256=2rAbJVusMrm5TPtVTsUtmwn0z1iZ_wvbKhc6eyT6ClE,708
|
|
52
52
|
sunholo/database/static_dbs.py,sha256=aOyU3AJ-Dzz3qSNjbuN2293cfYw5PhkcQuQxdwPMJ4w,435
|
|
@@ -96,9 +96,9 @@ sunholo/utils/parsers.py,sha256=OrHmASqIbI45atVOhiGodgLvnfrzkvVzyHnSvAXD89I,3841
|
|
|
96
96
|
sunholo/utils/user_ids.py,sha256=SQd5_H7FE7vcTZp9AQuQDWBXd4FEEd7TeVMQe1H4Ny8,292
|
|
97
97
|
sunholo/vertex/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
98
98
|
sunholo/vertex/init_vertex.py,sha256=JDMUaBRdednzbKF-5p33qqLit2LMsvgvWW-NRz0AqO0,1801
|
|
99
|
-
sunholo-0.61.
|
|
100
|
-
sunholo-0.61.
|
|
101
|
-
sunholo-0.61.
|
|
102
|
-
sunholo-0.61.
|
|
103
|
-
sunholo-0.61.
|
|
104
|
-
sunholo-0.61.
|
|
99
|
+
sunholo-0.61.8.dist-info/LICENSE.txt,sha256=SdE3QjnD3GEmqqg9EX3TM9f7WmtOzqS1KJve8rhbYmU,11345
|
|
100
|
+
sunholo-0.61.8.dist-info/METADATA,sha256=yW6gVMlt1_S4pAeXHijSp86J2dR3P9-qvjabNZ6J1qU,8057
|
|
101
|
+
sunholo-0.61.8.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
102
|
+
sunholo-0.61.8.dist-info/entry_points.txt,sha256=bZuN5AIHingMPt4Ro1b_T-FnQvZ3teBes-3OyO0asl4,49
|
|
103
|
+
sunholo-0.61.8.dist-info/top_level.txt,sha256=wt5tadn5--5JrZsjJz2LceoUvcrIvxjHJe-RxuudxAk,8
|
|
104
|
+
sunholo-0.61.8.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|