syntaxmatrix 2.1.9__tar.gz → 2.2.2__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.
Files changed (71) hide show
  1. {syntaxmatrix-2.1.9 → syntaxmatrix-2.2.2}/PKG-INFO +3 -1
  2. {syntaxmatrix-2.1.9 → syntaxmatrix-2.2.2}/SyntaxMatrix.egg-info/PKG-INFO +3 -1
  3. {syntaxmatrix-2.1.9 → syntaxmatrix-2.2.2}/SyntaxMatrix.egg-info/requires.txt +2 -0
  4. {syntaxmatrix-2.1.9 → syntaxmatrix-2.2.2}/setup.py +3 -2
  5. {syntaxmatrix-2.1.9 → syntaxmatrix-2.2.2}/syntaxmatrix/commentary.py +35 -21
  6. {syntaxmatrix-2.1.9 → syntaxmatrix-2.2.2}/syntaxmatrix/core.py +199 -120
  7. {syntaxmatrix-2.1.9 → syntaxmatrix-2.2.2}/syntaxmatrix/generate_page.py +23 -7
  8. {syntaxmatrix-2.1.9 → syntaxmatrix-2.2.2}/syntaxmatrix/gpt_models_latest.py +10 -3
  9. {syntaxmatrix-2.1.9 → syntaxmatrix-2.2.2}/syntaxmatrix/kernel_manager.py +1 -1
  10. {syntaxmatrix-2.1.9 → syntaxmatrix-2.2.2}/syntaxmatrix/profiles.py +25 -7
  11. {syntaxmatrix-2.1.9 → syntaxmatrix-2.2.2}/syntaxmatrix/routes.py +94 -9
  12. {syntaxmatrix-2.1.9 → syntaxmatrix-2.2.2}/syntaxmatrix/settings/model_map.py +21 -0
  13. syntaxmatrix-2.2.2/syntaxmatrix/static/icons/favicon.png +0 -0
  14. syntaxmatrix-2.2.2/syntaxmatrix/templates/dashboard.html +607 -0
  15. {syntaxmatrix-2.1.9 → syntaxmatrix-2.2.2}/syntaxmatrix/utils.py +195 -47
  16. syntaxmatrix-2.1.9/syntaxmatrix/static/icons/favicon.png +0 -0
  17. syntaxmatrix-2.1.9/syntaxmatrix/templates/dashboard.html +0 -391
  18. {syntaxmatrix-2.1.9 → syntaxmatrix-2.2.2}/LICENSE.txt +0 -0
  19. {syntaxmatrix-2.1.9 → syntaxmatrix-2.2.2}/README.md +0 -0
  20. {syntaxmatrix-2.1.9 → syntaxmatrix-2.2.2}/SyntaxMatrix.egg-info/SOURCES.txt +0 -0
  21. {syntaxmatrix-2.1.9 → syntaxmatrix-2.2.2}/SyntaxMatrix.egg-info/dependency_links.txt +0 -0
  22. {syntaxmatrix-2.1.9 → syntaxmatrix-2.2.2}/SyntaxMatrix.egg-info/top_level.txt +0 -0
  23. {syntaxmatrix-2.1.9 → syntaxmatrix-2.2.2}/pyproject.toml +0 -0
  24. {syntaxmatrix-2.1.9 → syntaxmatrix-2.2.2}/setup.cfg +0 -0
  25. {syntaxmatrix-2.1.9 → syntaxmatrix-2.2.2}/syntaxmatrix/__init__.py +0 -0
  26. {syntaxmatrix-2.1.9 → syntaxmatrix-2.2.2}/syntaxmatrix/auth.py +0 -0
  27. {syntaxmatrix-2.1.9 → syntaxmatrix-2.2.2}/syntaxmatrix/bootstrap.py +0 -0
  28. {syntaxmatrix-2.1.9 → syntaxmatrix-2.2.2}/syntaxmatrix/db.py +0 -0
  29. {syntaxmatrix-2.1.9 → syntaxmatrix-2.2.2}/syntaxmatrix/display.py +0 -0
  30. {syntaxmatrix-2.1.9 → syntaxmatrix-2.2.2}/syntaxmatrix/emailer.py +0 -0
  31. {syntaxmatrix-2.1.9 → syntaxmatrix-2.2.2}/syntaxmatrix/file_processor.py +0 -0
  32. {syntaxmatrix-2.1.9 → syntaxmatrix-2.2.2}/syntaxmatrix/history_store.py +0 -0
  33. {syntaxmatrix-2.1.9 → syntaxmatrix-2.2.2}/syntaxmatrix/llm_store.py +0 -0
  34. {syntaxmatrix-2.1.9 → syntaxmatrix-2.2.2}/syntaxmatrix/model_templates.py +0 -0
  35. {syntaxmatrix-2.1.9 → syntaxmatrix-2.2.2}/syntaxmatrix/models.py +0 -0
  36. {syntaxmatrix-2.1.9 → syntaxmatrix-2.2.2}/syntaxmatrix/plottings.py +0 -0
  37. {syntaxmatrix-2.1.9 → syntaxmatrix-2.2.2}/syntaxmatrix/project_root.py +0 -0
  38. {syntaxmatrix-2.1.9 → syntaxmatrix-2.2.2}/syntaxmatrix/session.py +0 -0
  39. {syntaxmatrix-2.1.9 → syntaxmatrix-2.2.2}/syntaxmatrix/settings/__init__.py +0 -0
  40. {syntaxmatrix-2.1.9 → syntaxmatrix-2.2.2}/syntaxmatrix/settings/default.yaml +0 -0
  41. {syntaxmatrix-2.1.9 → syntaxmatrix-2.2.2}/syntaxmatrix/settings/logging.py +0 -0
  42. {syntaxmatrix-2.1.9 → syntaxmatrix-2.2.2}/syntaxmatrix/settings/prompts.py +0 -0
  43. {syntaxmatrix-2.1.9 → syntaxmatrix-2.2.2}/syntaxmatrix/settings/string_navbar.py +0 -0
  44. {syntaxmatrix-2.1.9 → syntaxmatrix-2.2.2}/syntaxmatrix/smiv.py +0 -0
  45. {syntaxmatrix-2.1.9 → syntaxmatrix-2.2.2}/syntaxmatrix/smpv.py +0 -0
  46. {syntaxmatrix-2.1.9 → syntaxmatrix-2.2.2}/syntaxmatrix/static/css/style.css +0 -0
  47. {syntaxmatrix-2.1.9 → syntaxmatrix-2.2.2}/syntaxmatrix/static/docs.md +0 -0
  48. {syntaxmatrix-2.1.9 → syntaxmatrix-2.2.2}/syntaxmatrix/static/icons/hero_bg.jpg +0 -0
  49. {syntaxmatrix-2.1.9 → syntaxmatrix-2.2.2}/syntaxmatrix/static/icons/logo.png +0 -0
  50. {syntaxmatrix-2.1.9 → syntaxmatrix-2.2.2}/syntaxmatrix/static/icons/svg_497526.svg +0 -0
  51. {syntaxmatrix-2.1.9 → syntaxmatrix-2.2.2}/syntaxmatrix/static/icons/svg_497528.svg +0 -0
  52. {syntaxmatrix-2.1.9 → syntaxmatrix-2.2.2}/syntaxmatrix/static/js/chat.js +0 -0
  53. {syntaxmatrix-2.1.9 → syntaxmatrix-2.2.2}/syntaxmatrix/static/js/sidebar.js +0 -0
  54. {syntaxmatrix-2.1.9 → syntaxmatrix-2.2.2}/syntaxmatrix/static/js/widgets.js +0 -0
  55. {syntaxmatrix-2.1.9 → syntaxmatrix-2.2.2}/syntaxmatrix/templates/code_cell.html +0 -0
  56. {syntaxmatrix-2.1.9 → syntaxmatrix-2.2.2}/syntaxmatrix/templates/docs_page_embed.html +0 -0
  57. {syntaxmatrix-2.1.9 → syntaxmatrix-2.2.2}/syntaxmatrix/templates/error.html +0 -0
  58. {syntaxmatrix-2.1.9 → syntaxmatrix-2.2.2}/syntaxmatrix/templates/login.html +0 -0
  59. {syntaxmatrix-2.1.9 → syntaxmatrix-2.2.2}/syntaxmatrix/templates/register.html +0 -0
  60. {syntaxmatrix-2.1.9 → syntaxmatrix-2.2.2}/syntaxmatrix/themes.py +0 -0
  61. {syntaxmatrix-2.1.9 → syntaxmatrix-2.2.2}/syntaxmatrix/ui_modes.py +0 -0
  62. {syntaxmatrix-2.1.9 → syntaxmatrix-2.2.2}/syntaxmatrix/vector_db.py +0 -0
  63. {syntaxmatrix-2.1.9 → syntaxmatrix-2.2.2}/syntaxmatrix/vectordb/__init__.py +0 -0
  64. {syntaxmatrix-2.1.9 → syntaxmatrix-2.2.2}/syntaxmatrix/vectordb/adapters/__init__.py +0 -0
  65. {syntaxmatrix-2.1.9 → syntaxmatrix-2.2.2}/syntaxmatrix/vectordb/adapters/milvus_adapter.py +0 -0
  66. {syntaxmatrix-2.1.9 → syntaxmatrix-2.2.2}/syntaxmatrix/vectordb/adapters/pgvector_adapter.py +0 -0
  67. {syntaxmatrix-2.1.9 → syntaxmatrix-2.2.2}/syntaxmatrix/vectordb/adapters/sqlite_adapter.py +0 -0
  68. {syntaxmatrix-2.1.9 → syntaxmatrix-2.2.2}/syntaxmatrix/vectordb/base.py +0 -0
  69. {syntaxmatrix-2.1.9 → syntaxmatrix-2.2.2}/syntaxmatrix/vectordb/registry.py +0 -0
  70. {syntaxmatrix-2.1.9 → syntaxmatrix-2.2.2}/syntaxmatrix/vectorizer.py +0 -0
  71. {syntaxmatrix-2.1.9 → syntaxmatrix-2.2.2}/syntaxmatrix/workspace_db.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: syntaxmatrix
3
- Version: 2.1.9
3
+ Version: 2.2.2
4
4
  Summary: SyntaxMUI: A customizable framework for Python AI Assistant Projects.
5
5
  Home-page: https://github.com/bobganti/syntaxmatrix_demo
6
6
  Author: Bob Nti
@@ -22,6 +22,8 @@ Requires-Dist: nest-asyncio>=1.6.0
22
22
  Requires-Dist: python-dotenv>=1.1.0
23
23
  Requires-Dist: openai>=1.84.0
24
24
  Requires-Dist: google-genai>=1.19.0
25
+ Requires-Dist: anthropic>=0.67.0
26
+ Requires-Dist: reportlab>=4.4.3
25
27
  Provides-Extra: mlearning
26
28
  Requires-Dist: pandas>=2.2.3; extra == "mlearning"
27
29
  Requires-Dist: numpy>=2.0.2; extra == "mlearning"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: syntaxmatrix
3
- Version: 2.1.9
3
+ Version: 2.2.2
4
4
  Summary: SyntaxMUI: A customizable framework for Python AI Assistant Projects.
5
5
  Home-page: https://github.com/bobganti/syntaxmatrix_demo
6
6
  Author: Bob Nti
@@ -22,6 +22,8 @@ Requires-Dist: nest-asyncio>=1.6.0
22
22
  Requires-Dist: python-dotenv>=1.1.0
23
23
  Requires-Dist: openai>=1.84.0
24
24
  Requires-Dist: google-genai>=1.19.0
25
+ Requires-Dist: anthropic>=0.67.0
26
+ Requires-Dist: reportlab>=4.4.3
25
27
  Provides-Extra: mlearning
26
28
  Requires-Dist: pandas>=2.2.3; extra == "mlearning"
27
29
  Requires-Dist: numpy>=2.0.2; extra == "mlearning"
@@ -8,6 +8,8 @@ nest-asyncio>=1.6.0
8
8
  python-dotenv>=1.1.0
9
9
  openai>=1.84.0
10
10
  google-genai>=1.19.0
11
+ anthropic>=0.67.0
12
+ reportlab>=4.4.3
11
13
 
12
14
  [:sys_platform == "win32"]
13
15
  pywin32>=311
@@ -8,7 +8,7 @@ with open(os.path.join(this_directory, "README.md"), encoding="utf-8") as f:
8
8
 
9
9
  setup(
10
10
  name="syntaxmatrix",
11
- version="2.1.9",
11
+ version="2.2.2",
12
12
  author="Bob Nti",
13
13
  author_email="bob.nti@syntaxmatrix.com",
14
14
  description="SyntaxMUI: A customizable framework for Python AI Assistant Projects.",
@@ -36,7 +36,8 @@ setup(
36
36
  "python-dotenv>=1.1.0",
37
37
  "openai>=1.84.0",
38
38
  "google-genai>=1.19.0",
39
-
39
+ "anthropic>=0.67.0",
40
+ "reportlab>=4.4.3",
40
41
  ],
41
42
  extras_require={
42
43
  "mlearning": [
@@ -153,9 +153,7 @@ def _context_strings(context: Dict[str, Any]) -> List[str]:
153
153
  return out
154
154
 
155
155
 
156
-
157
-
158
- # --- C) LLM prompts ---
156
+ # ---LLM prompts ---
159
157
 
160
158
  _SYSTEM_VISION = (
161
159
  "You are a data analyst. Write a short, precise commentary in UK English that explains what the "
@@ -190,7 +188,6 @@ def phrase_commentary_vision(context: Dict[str, Any], images_b64: List[str]) ->
190
188
  ctx=json.dumps(visible, ensure_ascii=False, indent=2)
191
189
  )
192
190
 
193
- # Always try 'vision2text' first, then fall back to 'admin'
194
191
  prof = _prof.get_profile("vision2text") or _prof.get_profile("admin")
195
192
  if not prof:
196
193
  return (
@@ -198,21 +195,20 @@ def phrase_commentary_vision(context: Dict[str, Any], images_b64: List[str]) ->
198
195
  "No LLM profile configured for 'Vision2Text'. Please contact your Administrator."
199
196
  "</div>"
200
197
  )
201
- client = _prof.get_client(prof)
202
- provider = (prof.get("provider") or "").lower()
203
- model = prof.get("model") or ""
198
+ _client = _prof.get_client(prof)
199
+ _provider = (prof.get("provider") or "").lower()
200
+ _model = prof.get("model") or ""
204
201
 
205
202
  # Google GenAI (Gemini) — multimodal
206
- if provider == "google":
203
+ if _provider == "google":
207
204
  try:
208
- from google.genai import types
209
205
  parts = [types.Part.from_text(text=user)]
210
206
  for b64 in images_b64[:4]:
211
207
  if b64:
212
208
  parts.append(types.Part.from_bytes(data=base64.b64decode(b64), mime_type="image/png"))
213
209
  contents = [types.Content(role="user", parts=parts)]
214
- resp = client.models.generate_content(
215
- model=model,
210
+ resp = _client.models.generate_content(
211
+ model=_model,
216
212
  contents=contents,
217
213
  system_instruction=_SYSTEM_VISION
218
214
  )
@@ -222,7 +218,7 @@ def phrase_commentary_vision(context: Dict[str, Any], images_b64: List[str]) ->
222
218
  except Exception:
223
219
  pass # fall through to text-only
224
220
 
225
- elif provider == "openai" and model in GPT_MODELS_LATEST:
221
+ elif _provider == "openai" and _model in GPT_MODELS_LATEST:
226
222
  # Use the Responses API with multimodal input (text + up to 4 images)
227
223
  try:
228
224
  parts = [{"type": "input_text", "text": user}]
@@ -231,7 +227,7 @@ def phrase_commentary_vision(context: Dict[str, Any], images_b64: List[str]) ->
231
227
  parts.append({"type": "input_image", "image_url": f"data:image/png;base64,{b64}"})
232
228
 
233
229
  args = set_args(
234
- model=model,
230
+ model=_model,
235
231
  instructions=_SYSTEM_VISION,
236
232
  input=[{"role": "user", "content": parts}],
237
233
  previous_id=None,
@@ -239,7 +235,7 @@ def phrase_commentary_vision(context: Dict[str, Any], images_b64: List[str]) ->
239
235
  reasoning_effort="minimal",
240
236
  verbosity="low",
241
237
  )
242
- resp = client.responses.create(**args)
238
+ resp = _client.responses.create(**args)
243
239
  txt = _out(resp) or ""
244
240
  if txt.strip():
245
241
  return txt.strip()
@@ -247,16 +243,34 @@ def phrase_commentary_vision(context: Dict[str, Any], images_b64: List[str]) ->
247
243
  # If the Responses path fails for any reason, fall through to the
248
244
  # chat.completions fallback implemented below.
249
245
  pass
246
+
247
+ # Anthropic
248
+ elif _provider == "anthropic":
249
+ try:
250
+ parts = [{"type":"text","text": user}]
251
+ for b64 in images_b64[:4]:
252
+ if b64:
253
+ parts.append({"type":"image_url","image_url":{"url": f"data:image/png;base64,{b64}"}})
254
+
255
+ response = _client.messages.create(
256
+ model=_model,
257
+ max_tokens=1024,
258
+ system=_SYSTEM_VISION,
259
+ messages=[{"role": "user", "content":parts}],
260
+ stream=False,
261
+ )
262
+ return response.content[0].text.strip()
263
+ except Exception:
264
+ pass # fall through
250
265
 
251
- # OpenAI (gpt-4o / gpt-4o-mini) — chat.completions with image parts
252
266
  else: # provider in {"openai","xai","deepseek","moonshotai","alibaba"}:
253
267
  try:
254
268
  parts = [{"type":"text","text": user}]
255
269
  for b64 in images_b64[:4]:
256
270
  if b64:
257
271
  parts.append({"type":"image_url","image_url":{"url": f"data:image/png;base64,{b64}"}})
258
- resp = client.chat.completions.create(
259
- model=model,
272
+ resp = _client.chat.completions.create(
273
+ model=_model,
260
274
  temperature=0.2,
261
275
  messages=[
262
276
  {"role":"system","content":_SYSTEM_VISION},
@@ -270,16 +284,16 @@ def phrase_commentary_vision(context: Dict[str, Any], images_b64: List[str]) ->
270
284
 
271
285
  # Text-only fallback via Responses API
272
286
  try:
273
- args = set_args(model=model, instructions=_SYSTEM_VISION,
287
+ args = set_args(model=_model, instructions=_SYSTEM_VISION,
274
288
  input=user, previous_id=None, store=False,
275
289
  reasoning_effort="minimal", verbosity="low")
276
- resp = client.responses.create(**args)
290
+ resp = _client.responses.create(**args)
277
291
  return _out(resp)
278
292
  except Exception:
279
293
  # Classic chat fallback
280
294
  try:
281
- resp = client.chat.completions.create(
282
- model=model,
295
+ resp = _client.chat.completions.create(
296
+ model=_model,
283
297
  temperature=0.2,
284
298
  messages=[{"role":"system","content":_SYSTEM_VISION},
285
299
  {"role":"user","content":user}],