npcpy 1.3.5__py3-none-any.whl → 1.3.6__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.
npcpy/gen/response.py CHANGED
@@ -753,7 +753,7 @@ def get_litellm_response(
753
753
  model = model.split('-npc')[0]
754
754
  provider = "openai"
755
755
 
756
- if isinstance(format, BaseModel):
756
+ if isinstance(format, type) and issubclass(format, BaseModel):
757
757
  api_params["response_format"] = format
758
758
  if model is None:
759
759
  model = os.environ.get("NPCSH_CHAT_MODEL", "llama3.2")
npcpy/llm_funcs.py CHANGED
@@ -775,19 +775,23 @@ Instructions:
775
775
  required_inputs = []
776
776
 
777
777
  if required_inputs:
778
- # Get just the parameter names (handle both string and dict formats)
779
- required_names = []
778
+ # Get parameter names, distinguishing required (string) from optional with defaults (dict)
779
+ required_names = [] # Params without defaults - truly required
780
+ optional_names = [] # Params with defaults - not required
780
781
  for inp in required_inputs:
781
782
  if isinstance(inp, str):
783
+ # String inputs have no default, so they're required
782
784
  required_names.append(inp)
783
785
  elif isinstance(inp, dict):
784
- required_names.extend(inp.keys())
786
+ # Dict inputs have defaults (e.g., "backup: true"), so they're optional
787
+ optional_names.extend(inp.keys())
785
788
 
786
- # Check which required params are missing
789
+ # Only check truly required params (those without defaults)
787
790
  missing = [p for p in required_names if p not in inputs or not inputs.get(p)]
788
791
  provided = list(inputs.keys())
789
792
  if missing:
790
- context = f"Error: jinx '{jinx_name}' requires parameters {required_names} but got {provided}. Missing: {missing}. Please retry with correct parameter names."
793
+ all_params = required_names + optional_names
794
+ context = f"Error: jinx '{jinx_name}' requires parameters {required_names} but got {provided}. Missing: {missing}. Optional params with defaults: {optional_names}. Please retry with correct parameter names."
791
795
  logger.debug(f"[_react_fallback] Missing required params: {missing}")
792
796
  print(f"[REACT-DEBUG] Missing params for {jinx_name}: {missing}, got: {provided}")
793
797
  continue
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: npcpy
3
- Version: 1.3.5
3
+ Version: 1.3.6
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
@@ -1,6 +1,6 @@
1
1
  npcpy/__init__.py,sha256=uJcJGjR1mWvE69GySNAufkgiRwJA28zdObDBWaxp0tY,505
2
2
  npcpy/build_funcs.py,sha256=vOz6pjV0zS-kYKo0ux-pn9AcppVaR8KIDi2ldOxb3RQ,7479
3
- npcpy/llm_funcs.py,sha256=E0HCVD98YFG8yMm5Pvlo8AatvxRykaE4DyX5LqrJTM8,75046
3
+ npcpy/llm_funcs.py,sha256=98JRBeRNwnzxkcR6iypSQdm8OD7p4KcdKi8NDRipd4k,75492
4
4
  npcpy/main.py,sha256=RWoRIj6VQLxKdOKvdVyaq2kwG35oRpeXPvp1CAAoG-w,81
5
5
  npcpy/ml_funcs.py,sha256=UI7k7JR4XOH_VXR-xxLaO4r9Kyx_jBaEnp3TUIY7ZLQ,22657
6
6
  npcpy/npc_array.py,sha256=fVTxcMiXV-lvltmuwaRnTU9D3ikPq3-7k5wzp7MA5OY,40224
@@ -30,7 +30,7 @@ npcpy/gen/audio_gen.py,sha256=w4toESu7nmli1T5FOwRRCGC_QK9W-SMWknYYkbRv9jE,635
30
30
  npcpy/gen/embeddings.py,sha256=QStTJ2ELiC379OEZsLEgGGIIFD267Y8zQchs7HRn2Zg,2089
31
31
  npcpy/gen/image_gen.py,sha256=SOZYpvlxSiAdDK9j750OEBKjm22OUNdXg1kQ10sJSy0,21853
32
32
  npcpy/gen/ocr.py,sha256=rgmXWHrCYX1Po-qG_LrNFbVYEZ8aaupxFTgparcoB_Y,6554
33
- npcpy/gen/response.py,sha256=2QRyc8UJQmanUkDlwT09KjmveguNC411eSmdlUhLP04,43372
33
+ npcpy/gen/response.py,sha256=3h-DgE1VbB9swbK7EAPpsofclEqXCpd4wSH63SmwhEQ,43401
34
34
  npcpy/gen/video_gen.py,sha256=RFi3Zcq_Hn3HIcfoF3mijQ6G7RYFZaM_9pjPTh-8E64,3239
35
35
  npcpy/gen/world_gen.py,sha256=_8ytE7E3QVQ5qiX8DmOby-xd0d9zV20rRI6Wkpf-qcY,18922
36
36
  npcpy/memory/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -53,8 +53,8 @@ npcpy/work/browser.py,sha256=p2PeaoZdAXipFuAgKCCB3aXXLE_p3yIRqC87KlZKZWc,679
53
53
  npcpy/work/desktop.py,sha256=F3I8mUtJp6LAkXodsh8hGZIncoads6c_2Utty-0EdDA,2986
54
54
  npcpy/work/plan.py,sha256=QyUwg8vElWiHuoS-xK4jXTxxHvkMD3VkaCEsCmrEPQk,8300
55
55
  npcpy/work/trigger.py,sha256=P1Y8u1wQRsS2WACims_2IdkBEar-iBQix-2TDWoW0OM,9948
56
- npcpy-1.3.5.dist-info/licenses/LICENSE,sha256=j0YPvce7Ng9e32zYOu0EmXjXeJ0Nwawd0RA3uSGGH4E,1070
57
- npcpy-1.3.5.dist-info/METADATA,sha256=AvVXykxEQwTkZozgWXKY2YgAUHuoWqZQQxREx_hqyGg,37884
58
- npcpy-1.3.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
59
- npcpy-1.3.5.dist-info/top_level.txt,sha256=g1pbSvrOOncB74Bg5-J0Olg4V0A5VzDw-Xz5YObq8BU,6
60
- npcpy-1.3.5.dist-info/RECORD,,
56
+ npcpy-1.3.6.dist-info/licenses/LICENSE,sha256=j0YPvce7Ng9e32zYOu0EmXjXeJ0Nwawd0RA3uSGGH4E,1070
57
+ npcpy-1.3.6.dist-info/METADATA,sha256=CozApjX0lQ0YzAM2f2tHEpZAdd5gLRPcGkOgr70IG50,37884
58
+ npcpy-1.3.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
59
+ npcpy-1.3.6.dist-info/top_level.txt,sha256=g1pbSvrOOncB74Bg5-J0Olg4V0A5VzDw-Xz5YObq8BU,6
60
+ npcpy-1.3.6.dist-info/RECORD,,
File without changes