npcpy 1.3.7__tar.gz → 1.3.8__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 (79) hide show
  1. {npcpy-1.3.7/npcpy.egg-info → npcpy-1.3.8}/PKG-INFO +1 -1
  2. {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/llm_funcs.py +35 -5
  3. {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/npc_compiler.py +7 -5
  4. {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/npc_sysenv.py +3 -2
  5. {npcpy-1.3.7 → npcpy-1.3.8/npcpy.egg-info}/PKG-INFO +1 -1
  6. {npcpy-1.3.7 → npcpy-1.3.8}/setup.py +1 -1
  7. {npcpy-1.3.7 → npcpy-1.3.8}/LICENSE +0 -0
  8. {npcpy-1.3.7 → npcpy-1.3.8}/MANIFEST.in +0 -0
  9. {npcpy-1.3.7 → npcpy-1.3.8}/README.md +0 -0
  10. {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/__init__.py +0 -0
  11. {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/build_funcs.py +0 -0
  12. {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/data/__init__.py +0 -0
  13. {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/data/audio.py +0 -0
  14. {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/data/data_models.py +0 -0
  15. {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/data/image.py +0 -0
  16. {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/data/load.py +0 -0
  17. {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/data/text.py +0 -0
  18. {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/data/video.py +0 -0
  19. {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/data/web.py +0 -0
  20. {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/ft/__init__.py +0 -0
  21. {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/ft/diff.py +0 -0
  22. {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/ft/ge.py +0 -0
  23. {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/ft/memory_trainer.py +0 -0
  24. {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/ft/model_ensembler.py +0 -0
  25. {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/ft/rl.py +0 -0
  26. {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/ft/sft.py +0 -0
  27. {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/ft/usft.py +0 -0
  28. {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/gen/__init__.py +0 -0
  29. {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/gen/audio_gen.py +0 -0
  30. {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/gen/embeddings.py +0 -0
  31. {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/gen/image_gen.py +0 -0
  32. {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/gen/ocr.py +0 -0
  33. {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/gen/response.py +0 -0
  34. {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/gen/video_gen.py +0 -0
  35. {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/gen/world_gen.py +0 -0
  36. {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/main.py +0 -0
  37. {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/memory/__init__.py +0 -0
  38. {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/memory/command_history.py +0 -0
  39. {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/memory/kg_vis.py +0 -0
  40. {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/memory/knowledge_graph.py +0 -0
  41. {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/memory/memory_processor.py +0 -0
  42. {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/memory/search.py +0 -0
  43. {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/mix/__init__.py +0 -0
  44. {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/mix/debate.py +0 -0
  45. {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/ml_funcs.py +0 -0
  46. {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/npc_array.py +0 -0
  47. {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/npcs.py +0 -0
  48. {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/serve.py +0 -0
  49. {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/sql/__init__.py +0 -0
  50. {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/sql/ai_function_tools.py +0 -0
  51. {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/sql/database_ai_adapters.py +0 -0
  52. {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/sql/database_ai_functions.py +0 -0
  53. {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/sql/model_runner.py +0 -0
  54. {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/sql/npcsql.py +0 -0
  55. {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/sql/sql_model_compiler.py +0 -0
  56. {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/tools.py +0 -0
  57. {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/work/__init__.py +0 -0
  58. {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/work/browser.py +0 -0
  59. {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/work/desktop.py +0 -0
  60. {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/work/plan.py +0 -0
  61. {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/work/trigger.py +0 -0
  62. {npcpy-1.3.7 → npcpy-1.3.8}/npcpy.egg-info/SOURCES.txt +0 -0
  63. {npcpy-1.3.7 → npcpy-1.3.8}/npcpy.egg-info/dependency_links.txt +0 -0
  64. {npcpy-1.3.7 → npcpy-1.3.8}/npcpy.egg-info/requires.txt +0 -0
  65. {npcpy-1.3.7 → npcpy-1.3.8}/npcpy.egg-info/top_level.txt +0 -0
  66. {npcpy-1.3.7 → npcpy-1.3.8}/setup.cfg +0 -0
  67. {npcpy-1.3.7 → npcpy-1.3.8}/tests/test_audio.py +0 -0
  68. {npcpy-1.3.7 → npcpy-1.3.8}/tests/test_command_history.py +0 -0
  69. {npcpy-1.3.7 → npcpy-1.3.8}/tests/test_image.py +0 -0
  70. {npcpy-1.3.7 → npcpy-1.3.8}/tests/test_llm_funcs.py +0 -0
  71. {npcpy-1.3.7 → npcpy-1.3.8}/tests/test_load.py +0 -0
  72. {npcpy-1.3.7 → npcpy-1.3.8}/tests/test_npc_array.py +0 -0
  73. {npcpy-1.3.7 → npcpy-1.3.8}/tests/test_npc_compiler.py +0 -0
  74. {npcpy-1.3.7 → npcpy-1.3.8}/tests/test_npcsql.py +0 -0
  75. {npcpy-1.3.7 → npcpy-1.3.8}/tests/test_response.py +0 -0
  76. {npcpy-1.3.7 → npcpy-1.3.8}/tests/test_serve.py +0 -0
  77. {npcpy-1.3.7 → npcpy-1.3.8}/tests/test_text.py +0 -0
  78. {npcpy-1.3.7 → npcpy-1.3.8}/tests/test_tools.py +0 -0
  79. {npcpy-1.3.7 → npcpy-1.3.8}/tests/test_web.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: npcpy
3
- Version: 1.3.7
3
+ Version: 1.3.8
4
4
  Summary: npcpy is the premier open-source library for integrating LLMs and Agents into python systems.
5
5
  Home-page: https://github.com/NPC-Worldwide/npcpy
6
6
  Author: Christopher Agostino
@@ -589,8 +589,20 @@ def check_llm_command(
589
589
  # If we have jinxs, use ReAct fallback (JSON prompting) instead of tool_calls
590
590
  if jinxs:
591
591
  return _react_fallback(
592
- command, model, provider, api_url, api_key, npc, team,
593
- full_messages, images, stream, context, jinxs, extra_globals, max_iterations
592
+ command,
593
+ model,
594
+ provider,
595
+ api_url,
596
+ api_key,
597
+ npc,
598
+ team,
599
+ full_messages,
600
+ images,
601
+ stream,
602
+ context,
603
+ jinxs,
604
+ extra_globals,
605
+ max_iterations
594
606
  )
595
607
 
596
608
  # No jinxs - just get a direct response
@@ -633,8 +645,20 @@ def check_llm_command(
633
645
 
634
646
 
635
647
  def _react_fallback(
636
- command, model, provider, api_url, api_key, npc, team,
637
- messages, images, stream, context, jinxs, extra_globals, max_iterations
648
+ command,
649
+ model,
650
+ provider,
651
+ api_url,
652
+ api_key,
653
+ npc,
654
+ team,
655
+ messages,
656
+ images,
657
+ stream,
658
+ context,
659
+ jinxs,
660
+ extra_globals,
661
+ max_iterations
638
662
  ):
639
663
  """ReAct-style fallback for models without tool calling."""
640
664
  import logging
@@ -705,6 +729,12 @@ Instructions:
705
729
  print(f"[REACT-DEBUG] Full response keys: {response.keys()}")
706
730
  print(f"[REACT-DEBUG] Raw response['response']: {str(response.get('response', 'NONE'))[:500]}")
707
731
  print(f"[REACT-DEBUG] Raw decision type: {type(decision)}, value: {str(decision)[:500]}")
732
+
733
+ # Handle None response - model decided no action needed
734
+ if decision is None:
735
+ logger.debug(f"[_react_fallback] Decision is None, returning current output")
736
+ return {"messages": current_messages, "output": "", "usage": total_usage, "jinx_executions": jinx_executions}
737
+
708
738
  if isinstance(decision, str):
709
739
  try:
710
740
  decision = json.loads(decision)
@@ -712,7 +742,7 @@ Instructions:
712
742
  logger.debug(f"[_react_fallback] Could not parse JSON, returning as text")
713
743
  return {"messages": current_messages, "output": decision, "usage": total_usage, "jinx_executions": jinx_executions}
714
744
 
715
- logger.debug(f"[_react_fallback] Parsed decision action: {decision.get('action')}")
745
+ logger.debug(f"[_react_fallback] Parsed decision action: {decision.get('action') if decision else 'None'}")
716
746
  if decision.get("action") == "answer":
717
747
  output = decision.get("response", "")
718
748
 
@@ -2114,17 +2114,19 @@ Requirements:
2114
2114
  context=None,
2115
2115
  team=None,
2116
2116
  stream=False,
2117
- jinxs=None):
2117
+ jinxs=None,
2118
+ use_jinxs=True):
2118
2119
  """Check if a command is for the LLM"""
2119
2120
  if context is None:
2120
2121
  context = self.shared_context
2121
2122
 
2122
2123
  if team:
2123
2124
  self._current_team = team
2124
-
2125
- # Use provided jinxs or fall back to NPC's own jinxs
2126
- jinxs_to_use = jinxs if jinxs is not None else self.jinxs_dict
2127
-
2125
+ if jinxs is None and use_jinxs:
2126
+ jinxs_to_use = self.jinxs_dict
2127
+ elif jinxs is not None and use_jinxs:
2128
+ jinxs_to_use = jinxs
2129
+
2128
2130
  return npy.llm_funcs.check_llm_command(
2129
2131
  command,
2130
2132
  model=self.model,
@@ -266,6 +266,8 @@ def get_locally_available_models(project_directory, airplane_mode=False):
266
266
  'gemini-2.0-pro',
267
267
  'gemini-1.5-pro',
268
268
  'gemini-1.5-flash'
269
+ 'gemini-3-flash-preview',
270
+ 'gemini-3-pro-preview',
269
271
  ]
270
272
 
271
273
  for m in client.models.list():
@@ -853,8 +855,7 @@ The current date and time are : {datetime.now().strftime("%Y-%m-%d %H:%M:%S")}
853
855
  db_path = npc.db_conn.url.database
854
856
  elif hasattr(npc.db_conn, "database"):
855
857
  db_path = npc.db_conn.database
856
- system_message += """What follows is in
857
- formation about the database connection. If you are asked to execute queries with tools, use this information.
858
+ system_message += """What follows is information about the database connection. If you are asked to execute queries with tools, use this information.
858
859
  If you are asked for help with debugging queries, use this information.
859
860
  Do not unnecessarily reference that you possess this information unless it is
860
861
  specifically relevant to the request.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: npcpy
3
- Version: 1.3.7
3
+ Version: 1.3.8
4
4
  Summary: npcpy is the premier open-source library for integrating LLMs and Agents into python systems.
5
5
  Home-page: https://github.com/NPC-Worldwide/npcpy
6
6
  Author: Christopher Agostino
@@ -83,7 +83,7 @@ extra_files = package_files("npcpy/npc_team/")
83
83
 
84
84
  setup(
85
85
  name="npcpy",
86
- version="1.3.7",
86
+ version="1.3.8",
87
87
  packages=find_packages(exclude=["tests*"]),
88
88
  install_requires=base_requirements,
89
89
  extras_require={
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