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.
- {npcpy-1.3.7/npcpy.egg-info → npcpy-1.3.8}/PKG-INFO +1 -1
- {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/llm_funcs.py +35 -5
- {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/npc_compiler.py +7 -5
- {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/npc_sysenv.py +3 -2
- {npcpy-1.3.7 → npcpy-1.3.8/npcpy.egg-info}/PKG-INFO +1 -1
- {npcpy-1.3.7 → npcpy-1.3.8}/setup.py +1 -1
- {npcpy-1.3.7 → npcpy-1.3.8}/LICENSE +0 -0
- {npcpy-1.3.7 → npcpy-1.3.8}/MANIFEST.in +0 -0
- {npcpy-1.3.7 → npcpy-1.3.8}/README.md +0 -0
- {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/__init__.py +0 -0
- {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/build_funcs.py +0 -0
- {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/data/__init__.py +0 -0
- {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/data/audio.py +0 -0
- {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/data/data_models.py +0 -0
- {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/data/image.py +0 -0
- {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/data/load.py +0 -0
- {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/data/text.py +0 -0
- {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/data/video.py +0 -0
- {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/data/web.py +0 -0
- {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/ft/__init__.py +0 -0
- {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/ft/diff.py +0 -0
- {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/ft/ge.py +0 -0
- {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/ft/memory_trainer.py +0 -0
- {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/ft/model_ensembler.py +0 -0
- {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/ft/rl.py +0 -0
- {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/ft/sft.py +0 -0
- {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/ft/usft.py +0 -0
- {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/gen/__init__.py +0 -0
- {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/gen/audio_gen.py +0 -0
- {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/gen/embeddings.py +0 -0
- {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/gen/image_gen.py +0 -0
- {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/gen/ocr.py +0 -0
- {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/gen/response.py +0 -0
- {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/gen/video_gen.py +0 -0
- {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/gen/world_gen.py +0 -0
- {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/main.py +0 -0
- {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/memory/__init__.py +0 -0
- {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/memory/command_history.py +0 -0
- {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/memory/kg_vis.py +0 -0
- {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/memory/knowledge_graph.py +0 -0
- {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/memory/memory_processor.py +0 -0
- {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/memory/search.py +0 -0
- {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/mix/__init__.py +0 -0
- {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/mix/debate.py +0 -0
- {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/ml_funcs.py +0 -0
- {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/npc_array.py +0 -0
- {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/npcs.py +0 -0
- {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/serve.py +0 -0
- {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/sql/__init__.py +0 -0
- {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/sql/ai_function_tools.py +0 -0
- {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/sql/database_ai_adapters.py +0 -0
- {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/sql/database_ai_functions.py +0 -0
- {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/sql/model_runner.py +0 -0
- {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/sql/npcsql.py +0 -0
- {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/sql/sql_model_compiler.py +0 -0
- {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/tools.py +0 -0
- {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/work/__init__.py +0 -0
- {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/work/browser.py +0 -0
- {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/work/desktop.py +0 -0
- {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/work/plan.py +0 -0
- {npcpy-1.3.7 → npcpy-1.3.8}/npcpy/work/trigger.py +0 -0
- {npcpy-1.3.7 → npcpy-1.3.8}/npcpy.egg-info/SOURCES.txt +0 -0
- {npcpy-1.3.7 → npcpy-1.3.8}/npcpy.egg-info/dependency_links.txt +0 -0
- {npcpy-1.3.7 → npcpy-1.3.8}/npcpy.egg-info/requires.txt +0 -0
- {npcpy-1.3.7 → npcpy-1.3.8}/npcpy.egg-info/top_level.txt +0 -0
- {npcpy-1.3.7 → npcpy-1.3.8}/setup.cfg +0 -0
- {npcpy-1.3.7 → npcpy-1.3.8}/tests/test_audio.py +0 -0
- {npcpy-1.3.7 → npcpy-1.3.8}/tests/test_command_history.py +0 -0
- {npcpy-1.3.7 → npcpy-1.3.8}/tests/test_image.py +0 -0
- {npcpy-1.3.7 → npcpy-1.3.8}/tests/test_llm_funcs.py +0 -0
- {npcpy-1.3.7 → npcpy-1.3.8}/tests/test_load.py +0 -0
- {npcpy-1.3.7 → npcpy-1.3.8}/tests/test_npc_array.py +0 -0
- {npcpy-1.3.7 → npcpy-1.3.8}/tests/test_npc_compiler.py +0 -0
- {npcpy-1.3.7 → npcpy-1.3.8}/tests/test_npcsql.py +0 -0
- {npcpy-1.3.7 → npcpy-1.3.8}/tests/test_response.py +0 -0
- {npcpy-1.3.7 → npcpy-1.3.8}/tests/test_serve.py +0 -0
- {npcpy-1.3.7 → npcpy-1.3.8}/tests/test_text.py +0 -0
- {npcpy-1.3.7 → npcpy-1.3.8}/tests/test_tools.py +0 -0
- {npcpy-1.3.7 → npcpy-1.3.8}/tests/test_web.py +0 -0
|
@@ -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,
|
|
593
|
-
|
|
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,
|
|
637
|
-
|
|
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
|
-
|
|
2126
|
-
|
|
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
|
|
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.
|
|
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
|
|
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
|