synapse-pkg 2.0.0a3__tar.gz → 2.0.0a5__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.
- {synapse_pkg-2.0.0a3 → synapse_pkg-2.0.0a5}/PKG-INFO +1 -1
- {synapse_pkg-2.0.0a3 → synapse_pkg-2.0.0a5}/pyproject.toml +1 -1
- {synapse_pkg-2.0.0a3 → synapse_pkg-2.0.0a5}/synapse/cli.py +4 -1
- synapse_pkg-2.0.0a5/synapse/commands.py +39 -0
- {synapse_pkg-2.0.0a3 → synapse_pkg-2.0.0a5}/synapse/extractor.py +11 -2
- synapse_pkg-2.0.0a5/synapse/provider.py +8 -0
- {synapse_pkg-2.0.0a3 → synapse_pkg-2.0.0a5}/synapse_pkg.egg-info/PKG-INFO +1 -1
- {synapse_pkg-2.0.0a3 → synapse_pkg-2.0.0a5}/synapse_pkg.egg-info/SOURCES.txt +1 -0
- synapse_pkg-2.0.0a3/synapse/commands.py +0 -22
- {synapse_pkg-2.0.0a3 → synapse_pkg-2.0.0a5}/LICENSE +0 -0
- {synapse_pkg-2.0.0a3 → synapse_pkg-2.0.0a5}/README.md +0 -0
- {synapse_pkg-2.0.0a3 → synapse_pkg-2.0.0a5}/setup.cfg +0 -0
- {synapse_pkg-2.0.0a3 → synapse_pkg-2.0.0a5}/synapse/__init__.py +0 -0
- {synapse_pkg-2.0.0a3 → synapse_pkg-2.0.0a5}/synapse/git_manager.py +0 -0
- {synapse_pkg-2.0.0a3 → synapse_pkg-2.0.0a5}/synapse/persistence.py +0 -0
- {synapse_pkg-2.0.0a3 → synapse_pkg-2.0.0a5}/synapse/processor.py +0 -0
- {synapse_pkg-2.0.0a3 → synapse_pkg-2.0.0a5}/synapse_pkg.egg-info/dependency_links.txt +0 -0
- {synapse_pkg-2.0.0a3 → synapse_pkg-2.0.0a5}/synapse_pkg.egg-info/entry_points.txt +0 -0
- {synapse_pkg-2.0.0a3 → synapse_pkg-2.0.0a5}/synapse_pkg.egg-info/requires.txt +0 -0
- {synapse_pkg-2.0.0a3 → synapse_pkg-2.0.0a5}/synapse_pkg.egg-info/top_level.txt +0 -0
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import sys
|
|
2
|
-
|
|
3
2
|
from . import commands
|
|
4
3
|
|
|
5
4
|
|
|
@@ -11,6 +10,7 @@ def main():
|
|
|
11
10
|
print("Available commands:")
|
|
12
11
|
print(" init")
|
|
13
12
|
print(" knowledge")
|
|
13
|
+
print(" setup")
|
|
14
14
|
return
|
|
15
15
|
|
|
16
16
|
command = sys.argv[1].lower()
|
|
@@ -20,6 +20,9 @@ def main():
|
|
|
20
20
|
|
|
21
21
|
elif command == "knowledge":
|
|
22
22
|
commands.knowledge()
|
|
23
|
+
|
|
24
|
+
elif command == "setup":
|
|
25
|
+
commands.setup()
|
|
23
26
|
|
|
24
27
|
else:
|
|
25
28
|
print(f"Unknown command: {command}")
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
from .persistence import initialize_synapse, save_config
|
|
2
|
+
from .processor import build_repository_context
|
|
3
|
+
from .extractor import build_compressed_context
|
|
4
|
+
from .provider import get_ollama_model
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def setup():
|
|
8
|
+
models = get_ollama_model()
|
|
9
|
+
|
|
10
|
+
for i,model in enumerate(models,start=1):
|
|
11
|
+
print(f"{i}, {model}")
|
|
12
|
+
choice = int(input("select a model"))
|
|
13
|
+
selected_model = models[choice-1]
|
|
14
|
+
save_config(
|
|
15
|
+
{
|
|
16
|
+
"provider":"ollama",
|
|
17
|
+
"model": selected_model
|
|
18
|
+
}
|
|
19
|
+
)
|
|
20
|
+
print("configuration saved")
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def init():
|
|
24
|
+
initialize_synapse()
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def knowledge():
|
|
28
|
+
print("Initializing repository context...")
|
|
29
|
+
|
|
30
|
+
build_repository_context()
|
|
31
|
+
|
|
32
|
+
print(
|
|
33
|
+
"Repository context initialized.\n"
|
|
34
|
+
"Building compressed repository context..."
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
build_compressed_context()
|
|
38
|
+
|
|
39
|
+
print("Successfully initialized compressed repository context.")
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import git
|
|
2
|
-
from .persistence import load_compressed_context, save_compressed_context, load_metadata, save_metadata
|
|
2
|
+
from .persistence import load_compressed_context, save_compressed_context, load_metadata, save_metadata, load_config
|
|
3
3
|
from .git_manager import (
|
|
4
4
|
get_repository_changes,
|
|
5
5
|
split_commit_by_file
|
|
@@ -9,6 +9,8 @@ import json
|
|
|
9
9
|
|
|
10
10
|
repo = git.Repo(search_parent_directories=True)
|
|
11
11
|
|
|
12
|
+
config = load_config()
|
|
13
|
+
|
|
12
14
|
|
|
13
15
|
MAX_PROMPT_SIZE = 30000
|
|
14
16
|
MAX_FILES_PER_COMMIT = 3
|
|
@@ -625,9 +627,16 @@ def clean_json_response(raw: str) -> dict:
|
|
|
625
627
|
|
|
626
628
|
def get_response(prompt, num_predict=4096):
|
|
627
629
|
|
|
630
|
+
if config["model"]:
|
|
631
|
+
model = config["model"]
|
|
632
|
+
else:
|
|
633
|
+
print("no model configured.")
|
|
634
|
+
print("Run 'synapse setup' first.")
|
|
635
|
+
return
|
|
636
|
+
|
|
628
637
|
try:
|
|
629
638
|
response = chat(
|
|
630
|
-
model=
|
|
639
|
+
model=model,
|
|
631
640
|
messages=[
|
|
632
641
|
{
|
|
633
642
|
"role": "system",
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
from .persistence import initialize_synapse
|
|
2
|
-
from .processor import build_repository_context
|
|
3
|
-
from .extractor import build_compressed_context
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
def init():
|
|
7
|
-
initialize_synapse()
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
def knowledge():
|
|
11
|
-
print("Initializing repository context...")
|
|
12
|
-
|
|
13
|
-
build_repository_context()
|
|
14
|
-
|
|
15
|
-
print(
|
|
16
|
-
"Repository context initialized.\n"
|
|
17
|
-
"Building compressed repository context..."
|
|
18
|
-
)
|
|
19
|
-
|
|
20
|
-
build_compressed_context()
|
|
21
|
-
|
|
22
|
-
print("Successfully initialized compressed repository context.")
|
|
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
|