sunholo 0.61.9__tar.gz → 0.61.11__tar.gz
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-0.61.9 → sunholo-0.61.11}/PKG-INFO +2 -2
- {sunholo-0.61.9 → sunholo-0.61.11}/setup.py +1 -1
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/cli/chat_vac.py +31 -9
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/cli/cli.py +17 -7
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/cli/embedder.py +46 -12
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/utils/config.py +3 -1
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo.egg-info/PKG-INFO +2 -2
- {sunholo-0.61.9 → sunholo-0.61.11}/LICENSE.txt +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/MANIFEST.in +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/README.md +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/setup.cfg +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/__init__.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/agents/__init__.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/agents/chat_history.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/agents/dispatch_to_qa.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/agents/fastapi/__init__.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/agents/fastapi/base.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/agents/fastapi/qna_routes.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/agents/flask/__init__.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/agents/flask/base.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/agents/flask/qna_routes.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/agents/langserve.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/agents/pubsub.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/agents/route.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/agents/special_commands.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/archive/__init__.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/archive/archive.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/auth/__init__.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/auth/run.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/bots/__init__.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/bots/discord.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/bots/github_webhook.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/bots/webapp.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/chunker/__init__.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/chunker/data_to_embed_pubsub.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/chunker/doc_handling.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/chunker/images.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/chunker/loaders.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/chunker/message_data.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/chunker/pdfs.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/chunker/publish.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/chunker/splitter.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/cli/__init__.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/cli/cli_init.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/cli/configs.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/cli/deploy.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/cli/merge_texts.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/cli/run_proxy.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/cli/sun_rich.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/components/__init__.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/components/llm.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/components/prompt.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/components/retriever.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/components/vectorstore.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/database/__init__.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/database/alloydb.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/database/database.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/database/lancedb.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/database/sql/sb/create_function.sql +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/database/sql/sb/create_function_time.sql +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/database/sql/sb/create_table.sql +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/database/sql/sb/delete_source_row.sql +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/database/sql/sb/return_sources.sql +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/database/sql/sb/setup.sql +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/database/static_dbs.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/database/uuid.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/embedder/__init__.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/embedder/embed_chunk.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/gcs/__init__.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/gcs/add_file.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/gcs/download_url.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/gcs/metadata.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/langfuse/__init__.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/langfuse/callback.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/langfuse/prompts.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/llamaindex/__init__.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/llamaindex/generate.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/llamaindex/import_files.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/logging.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/lookup/__init__.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/lookup/model_lookup.yaml +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/patches/__init__.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/patches/langchain/__init__.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/patches/langchain/lancedb.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/patches/langchain/vertexai.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/pubsub/__init__.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/pubsub/process_pubsub.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/pubsub/pubsub_manager.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/qna/__init__.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/qna/parsers.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/qna/retry.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/streaming/__init__.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/streaming/content_buffer.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/streaming/langserve.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/streaming/streaming.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/summarise/__init__.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/summarise/summarise.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/utils/__init__.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/utils/big_context.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/utils/config_schema.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/utils/gcp.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/utils/parsers.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/utils/user_ids.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/vertex/__init__.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo/vertex/init_vertex.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo.egg-info/SOURCES.txt +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo.egg-info/dependency_links.txt +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo.egg-info/entry_points.txt +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo.egg-info/requires.txt +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/sunholo.egg-info/top_level.txt +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/tests/test_chat_history.py +0 -0
- {sunholo-0.61.9 → sunholo-0.61.11}/tests/test_config.py +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: sunholo
|
|
3
|
-
Version: 0.61.
|
|
3
|
+
Version: 0.61.11
|
|
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.11.tar.gz
|
|
7
7
|
Author: Holosun ApS
|
|
8
8
|
Author-email: multivac@sunholo.com
|
|
9
9
|
License: Apache License, Version 2.0
|
|
@@ -10,6 +10,7 @@ import sys
|
|
|
10
10
|
import subprocess
|
|
11
11
|
import json
|
|
12
12
|
import requests
|
|
13
|
+
from pathlib import Path
|
|
13
14
|
|
|
14
15
|
from rich import print
|
|
15
16
|
from .sun_rich import console
|
|
@@ -214,18 +215,36 @@ def vac_command(args):
|
|
|
214
215
|
|
|
215
216
|
elif args.action == 'invoke':
|
|
216
217
|
service_url = resolve_service_url(args, no_config=True)
|
|
217
|
-
try:
|
|
218
|
-
json_data = json.loads(args.data)
|
|
219
|
-
except json.JSONDecodeError as err:
|
|
220
|
-
console.print(f"[bold red]ERROR: invalid JSON: {str(err)} [/bold red]")
|
|
221
|
-
sys.exit(1)
|
|
222
218
|
|
|
223
|
-
invoke_vac(service_url,
|
|
219
|
+
invoke_vac(service_url, args.data, is_file=args.is_file)
|
|
224
220
|
|
|
225
|
-
def invoke_vac(service_url, data):
|
|
221
|
+
def invoke_vac(service_url, data, vector_name=None, metadata=None, is_file=False):
|
|
226
222
|
try:
|
|
227
|
-
|
|
228
|
-
|
|
223
|
+
if is_file:
|
|
224
|
+
# Handle file upload
|
|
225
|
+
if not isinstance(data, Path) or not data.is_file():
|
|
226
|
+
raise ValueError("For file uploads, 'data' must be a Path object pointing to a valid file.")
|
|
227
|
+
|
|
228
|
+
files = {
|
|
229
|
+
'file': (data.name, open(data, 'rb')),
|
|
230
|
+
}
|
|
231
|
+
form_data = {
|
|
232
|
+
'vector_name': vector_name,
|
|
233
|
+
'metadata': json.dumps(metadata) if metadata else '',
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
response = requests.post(service_url, files=files, data=form_data)
|
|
237
|
+
else:
|
|
238
|
+
try:
|
|
239
|
+
json_data = json.loads(data)
|
|
240
|
+
except json.JSONDecodeError as err:
|
|
241
|
+
console.print(f"[bold red]ERROR: invalid JSON: {str(err)} [/bold red]")
|
|
242
|
+
sys.exit(1)
|
|
243
|
+
|
|
244
|
+
# Handle JSON data
|
|
245
|
+
headers = {"Content-Type": "application/json"}
|
|
246
|
+
response = requests.post(service_url, headers=headers, data=json.dumps(json_data))
|
|
247
|
+
|
|
229
248
|
response.raise_for_status()
|
|
230
249
|
|
|
231
250
|
the_data = response.json()
|
|
@@ -235,6 +254,8 @@ def invoke_vac(service_url, data):
|
|
|
235
254
|
|
|
236
255
|
except requests.exceptions.RequestException as e:
|
|
237
256
|
console.print(f"[bold red]ERROR: Failed to invoke VAC: {e}[/bold red]")
|
|
257
|
+
except Exception as e:
|
|
258
|
+
console.print(f"[bold red]ERROR: An unexpected error occurred: {e}[/bold red]")
|
|
238
259
|
|
|
239
260
|
|
|
240
261
|
def list_cloud_run_services(project, region):
|
|
@@ -351,5 +372,6 @@ def setup_vac_subparser(subparsers):
|
|
|
351
372
|
invoke_parser = vac_subparsers.add_parser('invoke', help='Invoke a VAC service directly with custom data.')
|
|
352
373
|
invoke_parser.add_argument('vac_name', help='Name of the VAC service.')
|
|
353
374
|
invoke_parser.add_argument('data', help='Data to send to the VAC service (as JSON string).')
|
|
375
|
+
invoke_parser.add_argument('--is-file', action='store_true', help='Indicate if the data argument is a file path')
|
|
354
376
|
|
|
355
377
|
vac_parser.set_defaults(func=vac_command)
|
|
@@ -30,14 +30,23 @@ def load_default_gcp_config():
|
|
|
30
30
|
else:
|
|
31
31
|
return '', 'europe-west1'
|
|
32
32
|
|
|
33
|
+
class CustomHelpAction(argparse.Action):
|
|
34
|
+
def __init__(self, option_strings, dest, nargs=0, **kwargs):
|
|
35
|
+
super().__init__(option_strings, dest, nargs=nargs, **kwargs)
|
|
36
|
+
|
|
37
|
+
def __call__(self, parser, namespace, values, option_string=None):
|
|
38
|
+
console.print(
|
|
39
|
+
Panel("Welcome to Sunholo Command Line Interface, your assistant to deploy GenAI Virtual Agent Computers (VACs) to Multivac or your own Cloud.",
|
|
40
|
+
title="Sunholo GenAIOps Assistant CLI",
|
|
41
|
+
subtitle="Documentation at https://dev.sunholo.com/")
|
|
42
|
+
)
|
|
43
|
+
console.rule()
|
|
44
|
+
parser.print_help()
|
|
45
|
+
parser.exit()
|
|
46
|
+
|
|
33
47
|
def main(args=None):
|
|
34
48
|
|
|
35
|
-
|
|
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()
|
|
49
|
+
|
|
41
50
|
|
|
42
51
|
"""
|
|
43
52
|
Entry point for the sunholo console script. This function parses command line arguments
|
|
@@ -50,7 +59,8 @@ def main(args=None):
|
|
|
50
59
|
"""
|
|
51
60
|
default_project, default_region = load_default_gcp_config()
|
|
52
61
|
|
|
53
|
-
parser = argparse.ArgumentParser(description="sunholo CLI tool for deploying GenAI VACs")
|
|
62
|
+
parser = argparse.ArgumentParser(description="sunholo CLI tool for deploying GenAI VACs", add_help=False)
|
|
63
|
+
parser.add_argument('-h', '--help', action=CustomHelpAction, help='Show this help message and exit')
|
|
54
64
|
parser.add_argument('--debug', action='store_true', help='Enable debug output')
|
|
55
65
|
parser.add_argument('--project', default=default_project, help='GCP project to list Cloud Run services from.')
|
|
56
66
|
parser.add_argument('--region', default=default_region, help='Region to list Cloud Run services from.')
|
|
@@ -3,14 +3,14 @@ import uuid
|
|
|
3
3
|
import base64
|
|
4
4
|
from datetime import datetime, timezone
|
|
5
5
|
from argparse import Namespace
|
|
6
|
+
from pathlib import Path
|
|
6
7
|
|
|
7
8
|
from .sun_rich import console
|
|
8
9
|
from rich.progress import Progress
|
|
9
10
|
|
|
10
11
|
from .chat_vac import resolve_service_url, invoke_vac
|
|
11
12
|
|
|
12
|
-
def
|
|
13
|
-
# Current time in UTC
|
|
13
|
+
def create_metadata(vac, metadata):
|
|
14
14
|
now_utc = datetime.now(timezone.utc)
|
|
15
15
|
formatted_time = now_utc.strftime("%Y-%m-%dT%H:%M:%SZ")
|
|
16
16
|
|
|
@@ -22,17 +22,26 @@ def encode_data(vac, content, metadata=None, local_chunks=False):
|
|
|
22
22
|
if not isinstance(metadata, dict):
|
|
23
23
|
metadata = json.loads(metadata)
|
|
24
24
|
else:
|
|
25
|
-
metadata = {}
|
|
25
|
+
metadata = {}
|
|
26
26
|
|
|
27
27
|
# Update metadata with default values if not present
|
|
28
28
|
metadata.update(default_metadata)
|
|
29
29
|
|
|
30
|
+
return metadata
|
|
31
|
+
|
|
32
|
+
def encode_data(vac, content, metadata=None, local_chunks=False):
|
|
33
|
+
|
|
34
|
+
metadata = create_metadata(vac, metadata)
|
|
35
|
+
|
|
30
36
|
# Encode the content (URL)
|
|
31
37
|
if isinstance(content, str):
|
|
32
38
|
message_data = base64.b64encode(content.encode('utf-8')).decode('utf-8')
|
|
33
39
|
else:
|
|
34
40
|
raise ValueError(f"Unsupported content type: {type(content)}")
|
|
35
41
|
|
|
42
|
+
now_utc = datetime.now(timezone.utc)
|
|
43
|
+
formatted_time = now_utc.strftime("%Y-%m-%dT%H:%M:%SZ")
|
|
44
|
+
|
|
36
45
|
# Construct the message dictionary
|
|
37
46
|
messageId = str(uuid.uuid4())
|
|
38
47
|
message = {
|
|
@@ -62,6 +71,13 @@ def embed_command(args):
|
|
|
62
71
|
|
|
63
72
|
console.rule("Sending data for chunking")
|
|
64
73
|
|
|
74
|
+
# Check if the data argument is a file path
|
|
75
|
+
if args.is_file:
|
|
76
|
+
file_path = Path(args.data)
|
|
77
|
+
if not file_path.is_file():
|
|
78
|
+
print(f"ERROR: The specified file does not exist: {file_path}")
|
|
79
|
+
return
|
|
80
|
+
|
|
65
81
|
if args.chunk_override:
|
|
66
82
|
chunk_args["url_override"] = args.chunk_override
|
|
67
83
|
else:
|
|
@@ -70,15 +86,31 @@ def embed_command(args):
|
|
|
70
86
|
chunk_args = Namespace(**chunk_args)
|
|
71
87
|
chunk_url = resolve_service_url(chunk_args, no_config=True)
|
|
72
88
|
|
|
73
|
-
json_data = encode_data(args.vac_name, args.data, args.metadata, args.local_chunks)
|
|
74
|
-
|
|
75
89
|
with console.status(f"[bold orange]Sending {args.data} to chunk via {chunk_url}[/bold orange]", spinner="star"):
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
90
|
+
if args.is_file:
|
|
91
|
+
|
|
92
|
+
metadata = create_metadata(args.vac_name, args.metadata)
|
|
93
|
+
if args.local_chunks:
|
|
94
|
+
metadata["return_chunks"] = True
|
|
95
|
+
|
|
96
|
+
chunk_res = invoke_vac(f"{chunk_url}/direct_file_to_embed",
|
|
97
|
+
data=file_path,
|
|
98
|
+
vector_name=args.vac_name,
|
|
99
|
+
metadata=metadata,
|
|
100
|
+
is_file=True)
|
|
101
|
+
|
|
102
|
+
else:
|
|
103
|
+
json_data = encode_data(args.vac_name, args.data, args.metadata, args.local_chunks)
|
|
104
|
+
chunk_res = invoke_vac(f"{chunk_url}/pubsub_to_store", json_data)
|
|
105
|
+
|
|
106
|
+
if args.only_chunk:
|
|
107
|
+
|
|
108
|
+
return chunk_res
|
|
109
|
+
|
|
110
|
+
if not args.local_chunks:
|
|
111
|
+
console.rule(f"Chunks sent for processing in cloud: {chunk_res}")
|
|
112
|
+
|
|
113
|
+
return
|
|
82
114
|
|
|
83
115
|
console.rule("Processing chunks locally")
|
|
84
116
|
|
|
@@ -91,7 +123,7 @@ def embed_command(args):
|
|
|
91
123
|
embed_url = resolve_service_url(embed_args, no_config=True)
|
|
92
124
|
|
|
93
125
|
if not chunk_res:
|
|
94
|
-
console.print(f"[bold red]ERROR: Did not get any chunks from {chunk_url} for {
|
|
126
|
+
console.print(f"[bold red]ERROR: Did not get any chunks from {chunk_url} for {args.data}")
|
|
95
127
|
|
|
96
128
|
return
|
|
97
129
|
|
|
@@ -144,5 +176,7 @@ def setup_embedder_subparser(subparsers):
|
|
|
144
176
|
embed_parser.add_argument('--local-chunks', action='store_true', help='Whether to process chunks to embed locally, or via the cloud.')
|
|
145
177
|
embed_parser.add_argument('vac_name', help='VAC service to embed the data for')
|
|
146
178
|
embed_parser.add_argument('data', help='String content to send for embedding')
|
|
179
|
+
embed_parser.add_argument('--is-file', action='store_true', help='Indicate if the data argument is a file path')
|
|
180
|
+
embed_parser.add_argument('--only-chunk', action='store_true', help='Whether to only parse the document and return the chunks locally, with no embedding')
|
|
147
181
|
|
|
148
182
|
embed_parser.set_defaults(func=embed_command)
|
|
@@ -215,7 +215,9 @@ def load_config_key(key: str, vector_name: str, kind: str):
|
|
|
215
215
|
raise ValueError("Deprecated config file, move to config with `vac:` at top level for `vector_name`")
|
|
216
216
|
vac_config = vac.get(vector_name)
|
|
217
217
|
if not vac_config:
|
|
218
|
-
|
|
218
|
+
log.warning(f"No config array was found for {vector_name} in {kind}")
|
|
219
|
+
|
|
220
|
+
return None
|
|
219
221
|
|
|
220
222
|
log.debug(f'vac_config: {vac_config} for {vector_name} - fetching "{key}"')
|
|
221
223
|
key_value = vac_config.get(key)
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: sunholo
|
|
3
|
-
Version: 0.61.
|
|
3
|
+
Version: 0.61.11
|
|
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.11.tar.gz
|
|
7
7
|
Author: Holosun ApS
|
|
8
8
|
Author-email: multivac@sunholo.com
|
|
9
9
|
License: Apache License, Version 2.0
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|