syntaxmatrix 1.4.6__py3-none-any.whl → 2.5.5.4__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.
- syntaxmatrix/__init__.py +13 -8
- syntaxmatrix/agentic/__init__.py +0 -0
- syntaxmatrix/agentic/agent_tools.py +24 -0
- syntaxmatrix/agentic/agents.py +810 -0
- syntaxmatrix/agentic/code_tools_registry.py +37 -0
- syntaxmatrix/agentic/model_templates.py +1790 -0
- syntaxmatrix/auth.py +308 -14
- syntaxmatrix/commentary.py +328 -0
- syntaxmatrix/core.py +993 -375
- syntaxmatrix/dataset_preprocessing.py +218 -0
- syntaxmatrix/db.py +92 -95
- syntaxmatrix/display.py +95 -121
- syntaxmatrix/generate_page.py +634 -0
- syntaxmatrix/gpt_models_latest.py +46 -0
- syntaxmatrix/history_store.py +26 -29
- syntaxmatrix/kernel_manager.py +96 -17
- syntaxmatrix/llm_store.py +1 -1
- syntaxmatrix/plottings.py +6 -0
- syntaxmatrix/profiles.py +64 -8
- syntaxmatrix/project_root.py +55 -43
- syntaxmatrix/routes.py +5072 -1398
- syntaxmatrix/session.py +19 -0
- syntaxmatrix/settings/logging.py +40 -0
- syntaxmatrix/settings/model_map.py +300 -33
- syntaxmatrix/settings/prompts.py +273 -62
- syntaxmatrix/settings/string_navbar.py +3 -3
- syntaxmatrix/static/docs.md +272 -0
- syntaxmatrix/static/icons/favicon.png +0 -0
- syntaxmatrix/static/icons/hero_bg.jpg +0 -0
- syntaxmatrix/templates/dashboard.html +608 -147
- syntaxmatrix/templates/docs.html +71 -0
- syntaxmatrix/templates/error.html +2 -3
- syntaxmatrix/templates/login.html +1 -0
- syntaxmatrix/templates/register.html +1 -0
- syntaxmatrix/ui_modes.py +14 -0
- syntaxmatrix/utils.py +2482 -159
- syntaxmatrix/vectorizer.py +16 -12
- {syntaxmatrix-1.4.6.dist-info → syntaxmatrix-2.5.5.4.dist-info}/METADATA +20 -17
- syntaxmatrix-2.5.5.4.dist-info/RECORD +68 -0
- syntaxmatrix/model_templates.py +0 -30
- syntaxmatrix/static/icons/favicon.ico +0 -0
- syntaxmatrix-1.4.6.dist-info/RECORD +0 -54
- {syntaxmatrix-1.4.6.dist-info → syntaxmatrix-2.5.5.4.dist-info}/WHEEL +0 -0
- {syntaxmatrix-1.4.6.dist-info → syntaxmatrix-2.5.5.4.dist-info}/licenses/LICENSE.txt +0 -0
- {syntaxmatrix-1.4.6.dist-info → syntaxmatrix-2.5.5.4.dist-info}/top_level.txt +0 -0
syntaxmatrix/__init__.py
CHANGED
|
@@ -9,7 +9,6 @@ file_uploader = _app_instance.file_uploader
|
|
|
9
9
|
set_ui_mode = _app_instance.set_ui_mode
|
|
10
10
|
set_theme = _app_instance.set_theme
|
|
11
11
|
enable_theme_toggle = _app_instance.enable_theme_toggle
|
|
12
|
-
disable_theme_toggle = _app_instance.disable_theme_toggle
|
|
13
12
|
get_text_input_value = _app_instance.get_text_input_value
|
|
14
13
|
clear_text_input_value = _app_instance.clear_text_input_value
|
|
15
14
|
get_file_upload_value = _app_instance.get_file_upload_value
|
|
@@ -17,8 +16,6 @@ get_chat_history = _app_instance.get_chat_history
|
|
|
17
16
|
set_chat_history = _app_instance.set_chat_history
|
|
18
17
|
clear_chat_history = _app_instance.clear_chat_history
|
|
19
18
|
write = _app_instance.write
|
|
20
|
-
markdown = _app_instance.markdown
|
|
21
|
-
latex = _app_instance.latex
|
|
22
19
|
error = _app_instance.error
|
|
23
20
|
success = _app_instance.success
|
|
24
21
|
info = _app_instance.info
|
|
@@ -29,18 +26,17 @@ warning = _app_instance.warning
|
|
|
29
26
|
set_user_icon = _app_instance.set_user_icon
|
|
30
27
|
set_bot_icon = _app_instance.set_bot_icon
|
|
31
28
|
set_favicon = _app_instance.set_favicon
|
|
32
|
-
|
|
29
|
+
set_project_name = _app_instance.set_project_name
|
|
33
30
|
set_site_title = _app_instance.set_site_title
|
|
34
31
|
set_site_logo = _app_instance.set_site_logo
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
get_ui_modes = _app_instance.get_ui_modes
|
|
33
|
+
get_themes = _app_instance.get_themes
|
|
37
34
|
load_sys_chunks = _app_instance.load_sys_chunks
|
|
38
35
|
|
|
39
36
|
get_session_id = _app_instance.get_session_id
|
|
40
37
|
add_user_chunks = _app_instance.add_user_chunks
|
|
41
38
|
get_user_chunks = _app_instance.get_user_chunks
|
|
42
39
|
clear_user_chunks = _app_instance.clear_user_chunks
|
|
43
|
-
stream_write = _app_instance.stream_write
|
|
44
40
|
set_plottings = _app_instance.set_plottings
|
|
45
41
|
dropdown = _app_instance.dropdown
|
|
46
42
|
get_widget_value = _app_instance.get_widget_value
|
|
@@ -50,9 +46,18 @@ load_embed_model = _app_instance.load_embed_model
|
|
|
50
46
|
delete_embed_key = _app_instance.delete_embed_key
|
|
51
47
|
set_prompt_profile = _app_instance.set_prompt_profile
|
|
52
48
|
set_prompt_instructions = _app_instance.set_prompt_instructions
|
|
49
|
+
set_website_description = _app_instance.set_website_description
|
|
53
50
|
smiv_index = _app_instance.smiv_index
|
|
54
51
|
smpv_search = _app_instance.smpv_search
|
|
52
|
+
stream_process_query= _app_instance.stream_process_query
|
|
53
|
+
process_query_stream = _app_instance.process_query_stream
|
|
55
54
|
process_query = _app_instance.process_query
|
|
56
55
|
embed_query = _app_instance.embed_query
|
|
56
|
+
enable_user_files = _app_instance.enable_user_files
|
|
57
|
+
stream_write = _app_instance.stream_write
|
|
58
|
+
enable_stream = _app_instance.enable_stream
|
|
59
|
+
stream = _app_instance.stream
|
|
60
|
+
get_stream_args = _app_instance.get_stream_args
|
|
61
|
+
|
|
57
62
|
|
|
58
|
-
app = _app_instance.app
|
|
63
|
+
app = _app_instance.app
|
|
File without changes
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# syntaxmatrix/agent_tools.py
|
|
2
|
+
from dataclasses import dataclass
|
|
3
|
+
from typing import Callable, Optional, Dict, Any, List, Literal
|
|
4
|
+
|
|
5
|
+
Phase = Literal["sanitize_early", "domain_patches", "syntax_fixes", "final_repair"]
|
|
6
|
+
|
|
7
|
+
@dataclass
|
|
8
|
+
class CodeTool:
|
|
9
|
+
name: str
|
|
10
|
+
phase: Phase
|
|
11
|
+
fn: Callable[[str, Dict[str, Any]], str]
|
|
12
|
+
when: Optional[Callable[[str, Dict[str, Any]], bool]] = None
|
|
13
|
+
priority: int = 100 # lower runs earlier within the phase
|
|
14
|
+
|
|
15
|
+
class ToolRunner:
|
|
16
|
+
def __init__(self, tools: List[CodeTool]):
|
|
17
|
+
# stable order: phase → priority → name
|
|
18
|
+
self.tools = sorted(tools, key=lambda t: (t.phase, t.priority, t.name))
|
|
19
|
+
|
|
20
|
+
def run(self, code: str, ctx: Dict[str, Any]) -> str:
|
|
21
|
+
for t in self.tools:
|
|
22
|
+
if t.when is None or t.when(code, ctx):
|
|
23
|
+
code = t.fn(code, ctx)
|
|
24
|
+
return code
|