syntaxmatrix 2.5.8__py3-none-any.whl → 2.5.8.2__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/agentic/agents.py +2 -1
- syntaxmatrix/core.py +1 -1
- syntaxmatrix/profiles.py +7 -2
- syntaxmatrix/routes.py +1 -1
- syntaxmatrix/utils.py +52 -4
- {syntaxmatrix-2.5.8.dist-info → syntaxmatrix-2.5.8.2.dist-info}/METADATA +1 -1
- {syntaxmatrix-2.5.8.dist-info → syntaxmatrix-2.5.8.2.dist-info}/RECORD +10 -10
- {syntaxmatrix-2.5.8.dist-info → syntaxmatrix-2.5.8.2.dist-info}/WHEEL +0 -0
- {syntaxmatrix-2.5.8.dist-info → syntaxmatrix-2.5.8.2.dist-info}/licenses/LICENSE.txt +0 -0
- {syntaxmatrix-2.5.8.dist-info → syntaxmatrix-2.5.8.2.dist-info}/top_level.txt +0 -0
syntaxmatrix/agentic/agents.py
CHANGED
|
@@ -255,7 +255,7 @@ def mlearning_agent(user_prompt, system_prompt, coding_profile):
|
|
|
255
255
|
stream=False
|
|
256
256
|
)
|
|
257
257
|
content = response.choices[0].message.content
|
|
258
|
-
|
|
258
|
+
|
|
259
259
|
um = response.usage
|
|
260
260
|
usage["input_tokens"] = um.prompt_tokens
|
|
261
261
|
usage["output_tokens"] = um.completion_tokens
|
|
@@ -288,6 +288,7 @@ def mlearning_agent(user_prompt, system_prompt, coding_profile):
|
|
|
288
288
|
else:
|
|
289
289
|
code = openai_sdk_generate_code()
|
|
290
290
|
|
|
291
|
+
code = str(code or "")
|
|
291
292
|
return code, usage
|
|
292
293
|
|
|
293
294
|
|
syntaxmatrix/core.py
CHANGED
|
@@ -54,7 +54,7 @@ class SyntaxMUI:
|
|
|
54
54
|
port="5080",
|
|
55
55
|
user_icon="👩🏿🦲",
|
|
56
56
|
bot_icon="<img src='/static/icons/favicon.png' width=20' alt='bot'/>",
|
|
57
|
-
favicon="
|
|
57
|
+
favicon="/static/icons/favicon.png",
|
|
58
58
|
site_logo="<img src='/static/icons/logo.png' width='30' alt='logo'/>",
|
|
59
59
|
site_title="SyntaxMatrix",
|
|
60
60
|
project_name="smxAI",
|
syntaxmatrix/profiles.py
CHANGED
|
@@ -31,6 +31,7 @@ def get_profiles():
|
|
|
31
31
|
def get_client(profile):
|
|
32
32
|
|
|
33
33
|
provider = profile["provider"].lower()
|
|
34
|
+
model = profile["model"]
|
|
34
35
|
api_key = profile["api_key"]
|
|
35
36
|
|
|
36
37
|
#1 - Google - gemini series
|
|
@@ -46,8 +47,12 @@ def get_client(profile):
|
|
|
46
47
|
return OpenAI(api_key=api_key, base_url="https://api.x.ai/v1")
|
|
47
48
|
|
|
48
49
|
#4 - DeepSeek chat model
|
|
49
|
-
if provider == "deepseek":
|
|
50
|
-
return OpenAI(api_key=api_key, base_url="https://api.deepseek.com")
|
|
50
|
+
if provider == "deepseek":
|
|
51
|
+
return OpenAI(api_key=api_key, base_url="https://api.deepseek.com/v3.2_speciale_expires_on_20251215")
|
|
52
|
+
# else:
|
|
53
|
+
# base_url="https://api.deepseek.com"
|
|
54
|
+
# return OpenAI(api_key=api_key, base_url=base_url)
|
|
55
|
+
|
|
51
56
|
|
|
52
57
|
#5 - Moonshot chat model
|
|
53
58
|
if provider == "moonshot": #5
|
syntaxmatrix/routes.py
CHANGED
syntaxmatrix/utils.py
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
|
-
import re, textwrap
|
|
3
|
-
import pandas as pd
|
|
4
|
-
import numpy as np
|
|
2
|
+
import re, textwrap, ast
|
|
3
|
+
import pandas as pd, numpy as np
|
|
5
4
|
import warnings
|
|
6
|
-
|
|
7
5
|
from difflib import get_close_matches
|
|
8
6
|
from typing import Iterable, Tuple, Dict
|
|
9
7
|
import inspect
|
|
@@ -645,6 +643,18 @@ def harden_ai_code(code: str) -> str:
|
|
|
645
643
|
fixed = _patch_feature_coef_dataframe(fixed)
|
|
646
644
|
fixed = _strip_file_io_ops(fixed)
|
|
647
645
|
|
|
646
|
+
metric_defaults = "\n".join([
|
|
647
|
+
"acc = None",
|
|
648
|
+
"accuracy = None",
|
|
649
|
+
"r2 = None",
|
|
650
|
+
"mae = None",
|
|
651
|
+
"rmse = None",
|
|
652
|
+
"f1 = None",
|
|
653
|
+
"precision = None",
|
|
654
|
+
"recall = None",
|
|
655
|
+
]) + "\n"
|
|
656
|
+
fixed = metric_defaults + fixed
|
|
657
|
+
|
|
648
658
|
# Import shared preface helpers once and wrap the LLM body safely
|
|
649
659
|
header = "from syntaxmatrix.preface import *\n\n"
|
|
650
660
|
wrapped = header + wrap_llm_code_safe(fixed)
|
|
@@ -1622,6 +1632,44 @@ def clean_llm_code(code: str) -> str:
|
|
|
1622
1632
|
"""
|
|
1623
1633
|
code = str(code or "")
|
|
1624
1634
|
|
|
1635
|
+
# Special case: sometimes the OpenAI SDK object repr (e.g. ChatCompletion(...))
|
|
1636
|
+
# is accidentally passed here as `code`. In that case, extract the actual
|
|
1637
|
+
# Python code from the ChatCompletionMessage(content=...) field.
|
|
1638
|
+
if "ChatCompletion(" in code and "ChatCompletionMessage" in code and "content=" in code:
|
|
1639
|
+
try:
|
|
1640
|
+
extracted = None
|
|
1641
|
+
|
|
1642
|
+
class _ChatCompletionVisitor(ast.NodeVisitor):
|
|
1643
|
+
def visit_Call(self, node):
|
|
1644
|
+
nonlocal extracted
|
|
1645
|
+
func = node.func
|
|
1646
|
+
fname = getattr(func, "id", None) or getattr(func, "attr", None)
|
|
1647
|
+
if fname == "ChatCompletionMessage":
|
|
1648
|
+
for kw in node.keywords:
|
|
1649
|
+
if kw.arg == "content" and isinstance(kw.value, ast.Constant) and isinstance(kw.value.value, str):
|
|
1650
|
+
extracted = kw.value.value
|
|
1651
|
+
self.generic_visit(node)
|
|
1652
|
+
|
|
1653
|
+
tree = ast.parse(code, mode="exec")
|
|
1654
|
+
_ChatCompletionVisitor().visit(tree)
|
|
1655
|
+
if extracted:
|
|
1656
|
+
code = extracted
|
|
1657
|
+
except Exception:
|
|
1658
|
+
# Best-effort regex fallback if AST parsing fails
|
|
1659
|
+
m = re.search(r"content=(?P<q>['\\\"])(?P<body>.*?)(?P=q)", code, flags=re.S)
|
|
1660
|
+
if m:
|
|
1661
|
+
code = m.group("body")
|
|
1662
|
+
|
|
1663
|
+
# Existing logic continues unchanged below...
|
|
1664
|
+
# Extract fenced blocks (```python ... ``` or ``` ... ```)
|
|
1665
|
+
blocks = re.findall(r"```(?:python)?\s*(.*?)```", code, flags=re.I | re.S)
|
|
1666
|
+
|
|
1667
|
+
if blocks:
|
|
1668
|
+
# pick the largest block; small trailing blocks are usually garbage
|
|
1669
|
+
largest = max(blocks, key=lambda b: len(b.strip()))
|
|
1670
|
+
if len(largest.strip().splitlines()) >= 10:
|
|
1671
|
+
code = largest
|
|
1672
|
+
|
|
1625
1673
|
# Extract fenced blocks (```python ... ``` or ``` ... ```)
|
|
1626
1674
|
blocks = re.findall(r"```(?:python)?\s*(.*?)```", code, flags=re.I | re.S)
|
|
1627
1675
|
|
|
@@ -2,7 +2,7 @@ syntaxmatrix/__init__.py,sha256=_LnTrYAW2tbYA37Y233Vv4OMOk8NUnoJi-1yzFyHxEI,2573
|
|
|
2
2
|
syntaxmatrix/auth.py,sha256=SCD6uWojXjj9yjUTKzgV5kBYe6ZkXASEG2VopLFkEtM,18140
|
|
3
3
|
syntaxmatrix/bootstrap.py,sha256=Y7ZNg-Z3ecrr1iYem5EMzPmGstXnEKmO9kqKVoOoljo,817
|
|
4
4
|
syntaxmatrix/commentary.py,sha256=3uSlbaQ1zl-gYtEtEpFbv2M-IH-HSdFdMvhxa7UCNHk,12025
|
|
5
|
-
syntaxmatrix/core.py,sha256=
|
|
5
|
+
syntaxmatrix/core.py,sha256=hebGEXJLL4q9X7jQkl_OJptIh_5AEIAy7T3HchIcjdI,61332
|
|
6
6
|
syntaxmatrix/dataset_preprocessing.py,sha256=wtV4MWzkyfOsBHTsS0H1gqHho77ZQHGDI9skJryyZWA,8732
|
|
7
7
|
syntaxmatrix/db.py,sha256=xkCpyhFxnAwrnZCTd13NkJsahVze0i4egjMcbB7kPfs,5000
|
|
8
8
|
syntaxmatrix/display.py,sha256=TgMrE5WW80VlLcL_XvEz936mekFccJgLTfzbCIozSc8,3728
|
|
@@ -16,21 +16,21 @@ syntaxmatrix/llm_store.py,sha256=c22-ahR_PmZVWB5OAKPVr01YI9rWPWDd_aSEMujhAic,750
|
|
|
16
16
|
syntaxmatrix/models.py,sha256=-yGj4fALYqyQqxIiB0Eh6xWSlr9GfwuoDlzAWUikye8,533
|
|
17
17
|
syntaxmatrix/plottings.py,sha256=MjHQ9T1_oC5oyr4_wkM2GJDrpjp0sbvudbs2lGaMyzk,6103
|
|
18
18
|
syntaxmatrix/preface.py,sha256=EOK3lflMJ-0B6SRJtVXhzZjhvu-bfXzw-sy1TbTYOVs,17009
|
|
19
|
-
syntaxmatrix/profiles.py,sha256=
|
|
19
|
+
syntaxmatrix/profiles.py,sha256=aBcLJy_BsbGY-c-PDNRc3HhTGLnPRr29KYzPodMEIbo,2449
|
|
20
20
|
syntaxmatrix/project_root.py,sha256=1ckvbFVV1szHtHsfSCoGcImHkRwbfszmPG1kGh9ZZlE,2227
|
|
21
|
-
syntaxmatrix/routes.py,sha256=
|
|
21
|
+
syntaxmatrix/routes.py,sha256=WRLKCtwGFzIetMFUyvE5cb9tl2-j54qx-JA-VlDwcQM,310998
|
|
22
22
|
syntaxmatrix/session.py,sha256=v0qgxnVM_LEaNvZQJSa-13Q2eiwc3RDnjd2SahNnHQk,599
|
|
23
23
|
syntaxmatrix/smiv.py,sha256=1lSN3UYpXvYoVNd6VrkY5iZuF_nDxD6xxvLnTn9wcbQ,1405
|
|
24
24
|
syntaxmatrix/smpv.py,sha256=rrCgYqfjBaK2n5qzfQyXK3bHFMvgNcCIqPaXquOLtDM,3600
|
|
25
25
|
syntaxmatrix/themes.py,sha256=qa90vPZTuNNKB37loZhChQfu5QqkaJG4JxgI_4QgCxw,3576
|
|
26
26
|
syntaxmatrix/ui_modes.py,sha256=5lfKK3AKAB-JQCWfi1GRYp4sQqg4Z0fC3RJ8G3VGCMw,152
|
|
27
|
-
syntaxmatrix/utils.py,sha256=
|
|
27
|
+
syntaxmatrix/utils.py,sha256=deyPiM-sHaqudspFKX9i7VPdmZlWMKcEx-PxjYOZ_lg,126045
|
|
28
28
|
syntaxmatrix/vector_db.py,sha256=ozvOcMHt52xFAvcp-vAqT69kECPq9BwL8Rzgq3AJaMs,5824
|
|
29
29
|
syntaxmatrix/vectorizer.py,sha256=5w_UQiUIirm_W-Q9TcaEI8LTcTYIuDBdKfz79T1aZ8g,1366
|
|
30
30
|
syntaxmatrix/workspace_db.py,sha256=Xu9OlW8wo3iaH5Y88ZMdLOf-fiZxF1NBb5rAw3KcbfY,4715
|
|
31
31
|
syntaxmatrix/agentic/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
32
32
|
syntaxmatrix/agentic/agent_tools.py,sha256=yQwavONP23ziMxNQf3j2Y4TVo_LxEsiAWecKuBK8WDg,866
|
|
33
|
-
syntaxmatrix/agentic/agents.py,sha256=
|
|
33
|
+
syntaxmatrix/agentic/agents.py,sha256=YLl79L7EL96zSW2WPCJD3JAXmm_sAvvS6Hd4Y7NOYWw,29420
|
|
34
34
|
syntaxmatrix/agentic/code_tools_registry.py,sha256=Wp4-KHtp0BUVciqSbmionBsQMVFOnvJPruBJeNiuwkk,1564
|
|
35
35
|
syntaxmatrix/agentic/model_templates.py,sha256=A3ROE3BHkvnU9cxqSGjlCBIw9U15zRaTKgK-WxcZtUI,76033
|
|
36
36
|
syntaxmatrix/settings/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -64,8 +64,8 @@ syntaxmatrix/vectordb/adapters/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5
|
|
|
64
64
|
syntaxmatrix/vectordb/adapters/milvus_adapter.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
65
65
|
syntaxmatrix/vectordb/adapters/pgvector_adapter.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
66
66
|
syntaxmatrix/vectordb/adapters/sqlite_adapter.py,sha256=L8M2qHfwZRAFVxWeurUVdHaJXz6F5xTUSWh3uy6TSUs,6035
|
|
67
|
-
syntaxmatrix-2.5.8.dist-info/licenses/LICENSE.txt,sha256=j1P8naTdy1JMxTC80XYQjbyAQnuOlpDusCUhncrvpy8,1083
|
|
68
|
-
syntaxmatrix-2.5.8.dist-info/METADATA,sha256=
|
|
69
|
-
syntaxmatrix-2.5.8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
70
|
-
syntaxmatrix-2.5.8.dist-info/top_level.txt,sha256=HKP_zkl4V_nt7osC15DlacoBZktHrbZYOqf_pPkF3T8,13
|
|
71
|
-
syntaxmatrix-2.5.8.dist-info/RECORD,,
|
|
67
|
+
syntaxmatrix-2.5.8.2.dist-info/licenses/LICENSE.txt,sha256=j1P8naTdy1JMxTC80XYQjbyAQnuOlpDusCUhncrvpy8,1083
|
|
68
|
+
syntaxmatrix-2.5.8.2.dist-info/METADATA,sha256=zENDe4W1XtEL78Jpw0VETAuMmht9eoiYBP9H5X89y34,18092
|
|
69
|
+
syntaxmatrix-2.5.8.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
70
|
+
syntaxmatrix-2.5.8.2.dist-info/top_level.txt,sha256=HKP_zkl4V_nt7osC15DlacoBZktHrbZYOqf_pPkF3T8,13
|
|
71
|
+
syntaxmatrix-2.5.8.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|