sunholo 0.59.7__tar.gz → 0.60.0__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.59.7 → sunholo-0.60.0}/PKG-INFO +2 -2
- {sunholo-0.59.7 → sunholo-0.60.0}/setup.py +1 -1
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/cli/cli.py +6 -2
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/cli/configs.py +1 -1
- sunholo-0.60.0/sunholo/cli/merge_texts.py +41 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/utils/big_context.py +10 -1
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo.egg-info/PKG-INFO +2 -2
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo.egg-info/SOURCES.txt +1 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/LICENSE.txt +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/MANIFEST.in +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/README.md +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/setup.cfg +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/__init__.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/agents/__init__.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/agents/chat_history.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/agents/dispatch_to_qa.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/agents/fastapi/__init__.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/agents/fastapi/base.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/agents/fastapi/qna_routes.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/agents/flask/__init__.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/agents/flask/base.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/agents/flask/qna_routes.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/agents/langserve.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/agents/pubsub.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/agents/route.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/agents/special_commands.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/agents/test_chat_history.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/archive/__init__.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/archive/archive.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/auth/__init__.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/auth/run.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/bots/__init__.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/bots/discord.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/bots/github_webhook.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/bots/webapp.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/chunker/__init__.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/chunker/data_to_embed_pubsub.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/chunker/doc_handling.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/chunker/images.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/chunker/loaders.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/chunker/message_data.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/chunker/pdfs.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/chunker/publish.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/chunker/splitter.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/cli/__init__.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/cli/cli_init.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/cli/deploy.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/components/__init__.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/components/llm.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/components/prompt.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/components/retriever.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/components/vectorstore.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/database/__init__.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/database/alloydb.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/database/database.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/database/lancedb.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/database/sql/sb/create_function.sql +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/database/sql/sb/create_function_time.sql +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/database/sql/sb/create_table.sql +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/database/sql/sb/delete_source_row.sql +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/database/sql/sb/return_sources.sql +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/database/sql/sb/setup.sql +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/database/static_dbs.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/database/uuid.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/embedder/__init__.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/embedder/embed_chunk.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/gcs/__init__.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/gcs/add_file.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/gcs/download_url.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/gcs/metadata.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/langfuse/__init__.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/langfuse/callback.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/langfuse/prompts.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/llamaindex/__init__.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/llamaindex/generate.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/llamaindex/import_files.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/logging.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/lookup/__init__.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/lookup/model_lookup.yaml +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/patches/__init__.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/patches/langchain/__init__.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/patches/langchain/lancedb.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/patches/langchain/vertexai.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/pubsub/__init__.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/pubsub/process_pubsub.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/pubsub/pubsub_manager.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/qna/__init__.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/qna/parsers.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/qna/retry.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/streaming/__init__.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/streaming/content_buffer.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/streaming/langserve.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/streaming/streaming.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/summarise/__init__.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/summarise/summarise.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/utils/__init__.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/utils/config.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/utils/config_schema.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/utils/gcp.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/utils/parsers.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/vertex/__init__.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo/vertex/init_vertex.py +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo.egg-info/dependency_links.txt +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo.egg-info/entry_points.txt +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo.egg-info/requires.txt +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/sunholo.egg-info/top_level.txt +0 -0
- {sunholo-0.59.7 → sunholo-0.60.0}/test/test_dispatch_to_qa.py +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: sunholo
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.60.0
|
|
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.
|
|
6
|
+
Download-URL: https://github.com/sunholo-data/sunholo-py/archive/refs/tags/v0.60.0.tar.gz
|
|
7
7
|
Author: Holosun ApS
|
|
8
8
|
Author-email: multivac@sunholo.com
|
|
9
9
|
License: Apache License, Version 2.0
|
|
@@ -3,6 +3,8 @@ import argparse
|
|
|
3
3
|
from .configs import setup_list_configs_subparser
|
|
4
4
|
from .deploy import setup_deploy_subparser
|
|
5
5
|
from .cli_init import setup_init_subparser
|
|
6
|
+
from .merge_texts import setup_merge_text_subparser
|
|
7
|
+
|
|
6
8
|
|
|
7
9
|
def main(args=None):
|
|
8
10
|
"""
|
|
@@ -21,12 +23,14 @@ def main(args=None):
|
|
|
21
23
|
dest='command',
|
|
22
24
|
required=True)
|
|
23
25
|
|
|
24
|
-
#
|
|
26
|
+
# deploy command
|
|
25
27
|
setup_deploy_subparser(subparsers)
|
|
26
28
|
# Setup list-configs command
|
|
27
29
|
setup_list_configs_subparser(subparsers)
|
|
28
|
-
# init
|
|
30
|
+
# init command
|
|
29
31
|
setup_init_subparser(subparsers)
|
|
32
|
+
# merge-text command
|
|
33
|
+
setup_merge_text_subparser(subparsers)
|
|
30
34
|
|
|
31
35
|
args = parser.parse_args(args)
|
|
32
36
|
|
|
@@ -113,7 +113,7 @@ def setup_list_configs_subparser(subparsers):
|
|
|
113
113
|
subparsers = parser.add_subparsers()
|
|
114
114
|
setup_list_configs_subparser(subparsers)
|
|
115
115
|
"""
|
|
116
|
-
list_configs_parser = subparsers.add_parser('list-configs', help='Lists all configuration files and their details
|
|
116
|
+
list_configs_parser = subparsers.add_parser('list-configs', help='Lists all configuration files and their details')
|
|
117
117
|
list_configs_parser.add_argument('--kind', help='Filter configurations by kind e.g. `--kind=vacConfig`')
|
|
118
118
|
list_configs_parser.add_argument('--vac', help='Filter configurations by VAC name e.g. `--vac=edmonbrain`')
|
|
119
119
|
list_configs_parser.add_argument('--validate', action='store_true', help='Validate the configuration files.')
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import os
|
|
2
|
+
from pprint import pprint
|
|
3
|
+
|
|
4
|
+
from ..utils.big_context import load_gitignore_patterns, merge_text_files
|
|
5
|
+
|
|
6
|
+
def setup_merge_text_subparser(subparsers):
|
|
7
|
+
"""
|
|
8
|
+
Sets up an argparse subparser for the 'merge-text' command.
|
|
9
|
+
|
|
10
|
+
Args:
|
|
11
|
+
subparsers: The subparsers object from argparse.ArgumentParser().
|
|
12
|
+
"""
|
|
13
|
+
merge_text_parser = subparsers.add_parser('merge-text', help='Merge text files from a source folder into a single output file.')
|
|
14
|
+
merge_text_parser.add_argument('source_folder', help='Folder containing the text files.')
|
|
15
|
+
merge_text_parser.add_argument('output_file', help='Output file to write the merged text.')
|
|
16
|
+
merge_text_parser.add_argument('--gitignore', help='Path to .gitignore file to exclude patterns.', default=None)
|
|
17
|
+
merge_text_parser.add_argument('--output_tree', action='store_true', help='Set to output the file tree in the console after merging', default=None)
|
|
18
|
+
|
|
19
|
+
merge_text_parser.set_defaults(func=merge_text_files_command)
|
|
20
|
+
|
|
21
|
+
def merge_text_files_command(args):
|
|
22
|
+
"""
|
|
23
|
+
Command to merge text files based on the provided arguments.
|
|
24
|
+
|
|
25
|
+
Args:
|
|
26
|
+
args: Command-line arguments.
|
|
27
|
+
"""
|
|
28
|
+
gitignore_path = os.path.join(args.source_folder, '.gitignore') if not args.gitignore else args.gitignore
|
|
29
|
+
|
|
30
|
+
if os.path.exists(gitignore_path):
|
|
31
|
+
patterns = load_gitignore_patterns(gitignore_path)
|
|
32
|
+
print(f"Ignoring patterns from {gitignore_path}")
|
|
33
|
+
else:
|
|
34
|
+
patterns = [] # Empty list if no .gitignore
|
|
35
|
+
|
|
36
|
+
print(f"Merging text files within {args.source_folder} to {args.output_file}")
|
|
37
|
+
file_tree = merge_text_files(args.source_folder, args.output_file, patterns)
|
|
38
|
+
print(f"OK: Merged files available in {args.output_file}")
|
|
39
|
+
if args.output_tree:
|
|
40
|
+
print(f"==File Tree for {args.source_folder}")
|
|
41
|
+
pprint(file_tree)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import os
|
|
2
|
+
from fnmatch import fnmatch
|
|
2
3
|
|
|
3
4
|
def has_text_extension(file_path):
|
|
4
5
|
"""
|
|
@@ -42,6 +43,7 @@ def load_gitignore_patterns(gitignore_path):
|
|
|
42
43
|
"""
|
|
43
44
|
with open(gitignore_path, 'r') as f:
|
|
44
45
|
patterns = [line.strip() for line in f if line.strip() and not line.startswith('#')]
|
|
46
|
+
patterns.extend(["*.git/*", "*.terraform/*"])
|
|
45
47
|
return patterns
|
|
46
48
|
|
|
47
49
|
def should_ignore(file_path, patterns):
|
|
@@ -59,13 +61,15 @@ def should_ignore(file_path, patterns):
|
|
|
59
61
|
>>> should_ignore("path/to/file.txt", ["*.txt", "node_modules/"])
|
|
60
62
|
True
|
|
61
63
|
"""
|
|
62
|
-
from fnmatch import fnmatch
|
|
63
64
|
rel_path = os.path.relpath(file_path)
|
|
65
|
+
|
|
64
66
|
for pattern in patterns:
|
|
65
67
|
if fnmatch(rel_path, pattern) or fnmatch(os.path.basename(rel_path), pattern):
|
|
66
68
|
return True
|
|
69
|
+
|
|
67
70
|
return False
|
|
68
71
|
|
|
72
|
+
|
|
69
73
|
def build_file_tree(source_folder, patterns):
|
|
70
74
|
"""
|
|
71
75
|
Build a hierarchical file tree structure of a directory, ignoring files and directories in .gitignore.
|
|
@@ -112,6 +116,7 @@ def merge_text_files(source_folder, output_file, patterns):
|
|
|
112
116
|
file_tree = build_file_tree(source_folder, patterns)
|
|
113
117
|
with open(output_file, 'w', encoding='utf-8') as outfile:
|
|
114
118
|
for root, dirs, files in os.walk(source_folder):
|
|
119
|
+
print(f"- merging {root}...")
|
|
115
120
|
# Filter out ignored directories
|
|
116
121
|
dirs[:] = [d for d in dirs if not should_ignore(os.path.join(root, d), patterns)]
|
|
117
122
|
# Filter out ignored files
|
|
@@ -119,6 +124,8 @@ def merge_text_files(source_folder, output_file, patterns):
|
|
|
119
124
|
|
|
120
125
|
for file_name in files:
|
|
121
126
|
file_path = os.path.join(root, file_name)
|
|
127
|
+
if file_path == output_file:
|
|
128
|
+
continue
|
|
122
129
|
if has_text_extension(file_path):
|
|
123
130
|
try:
|
|
124
131
|
with open(file_path, 'r', encoding='utf-8') as infile:
|
|
@@ -129,6 +136,8 @@ def merge_text_files(source_folder, output_file, patterns):
|
|
|
129
136
|
print(f"Skipping file (cannot read as text): {file_path}")
|
|
130
137
|
outfile.write("\n--- File Tree ---\n")
|
|
131
138
|
outfile.write("\n".join(file_tree))
|
|
139
|
+
|
|
140
|
+
return file_tree
|
|
132
141
|
|
|
133
142
|
# Example usage
|
|
134
143
|
if __name__ == "__main__":
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: sunholo
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.60.0
|
|
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.
|
|
6
|
+
Download-URL: https://github.com/sunholo-data/sunholo-py/archive/refs/tags/v0.60.0.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
|