npcsh 0.3.25__py3-none-any.whl → 0.3.26__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.
- npcsh/llm_funcs.py +25 -11
- {npcsh-0.3.25.dist-info → npcsh-0.3.26.dist-info}/METADATA +1207 -1202
- {npcsh-0.3.25.dist-info → npcsh-0.3.26.dist-info}/RECORD +26 -26
- {npcsh-0.3.25.dist-info → npcsh-0.3.26.dist-info}/WHEEL +1 -1
- {npcsh-0.3.25.data → npcsh-0.3.26.data}/data/npcsh/npc_team/calculator.tool +0 -0
- {npcsh-0.3.25.data → npcsh-0.3.26.data}/data/npcsh/npc_team/celona.npc +0 -0
- {npcsh-0.3.25.data → npcsh-0.3.26.data}/data/npcsh/npc_team/corca.npc +0 -0
- {npcsh-0.3.25.data → npcsh-0.3.26.data}/data/npcsh/npc_team/eriane.npc +0 -0
- {npcsh-0.3.25.data → npcsh-0.3.26.data}/data/npcsh/npc_team/foreman.npc +0 -0
- {npcsh-0.3.25.data → npcsh-0.3.26.data}/data/npcsh/npc_team/generic_search.tool +0 -0
- {npcsh-0.3.25.data → npcsh-0.3.26.data}/data/npcsh/npc_team/image_generation.tool +0 -0
- {npcsh-0.3.25.data → npcsh-0.3.26.data}/data/npcsh/npc_team/lineru.npc +0 -0
- {npcsh-0.3.25.data → npcsh-0.3.26.data}/data/npcsh/npc_team/local_search.tool +0 -0
- {npcsh-0.3.25.data → npcsh-0.3.26.data}/data/npcsh/npc_team/maurawa.npc +0 -0
- {npcsh-0.3.25.data → npcsh-0.3.26.data}/data/npcsh/npc_team/npcsh.ctx +0 -0
- {npcsh-0.3.25.data → npcsh-0.3.26.data}/data/npcsh/npc_team/raone.npc +0 -0
- {npcsh-0.3.25.data → npcsh-0.3.26.data}/data/npcsh/npc_team/screen_cap.tool +0 -0
- {npcsh-0.3.25.data → npcsh-0.3.26.data}/data/npcsh/npc_team/sibiji.npc +0 -0
- {npcsh-0.3.25.data → npcsh-0.3.26.data}/data/npcsh/npc_team/slean.npc +0 -0
- {npcsh-0.3.25.data → npcsh-0.3.26.data}/data/npcsh/npc_team/sql_executor.tool +0 -0
- {npcsh-0.3.25.data → npcsh-0.3.26.data}/data/npcsh/npc_team/test_pipeline.py +0 -0
- {npcsh-0.3.25.data → npcsh-0.3.26.data}/data/npcsh/npc_team/turnic.npc +0 -0
- {npcsh-0.3.25.data → npcsh-0.3.26.data}/data/npcsh/npc_team/welxor.npc +0 -0
- {npcsh-0.3.25.dist-info → npcsh-0.3.26.dist-info}/entry_points.txt +0 -0
- {npcsh-0.3.25.dist-info → npcsh-0.3.26.dist-info}/licenses/LICENSE +0 -0
- {npcsh-0.3.25.dist-info → npcsh-0.3.26.dist-info}/top_level.txt +0 -0
npcsh/llm_funcs.py
CHANGED
|
@@ -829,14 +829,29 @@ ReAct choices then will enter reasoning flow
|
|
|
829
829
|
|
|
830
830
|
Available tools:
|
|
831
831
|
"""
|
|
832
|
-
|
|
833
|
-
if npc.tools_dict is None or npc.tools_dict == {}
|
|
832
|
+
|
|
833
|
+
if (npc.tools_dict is None or npc.tools_dict == {}) & (
|
|
834
|
+
npc.all_tools_dict is None or npc.all_tools_dict == {}
|
|
835
|
+
):
|
|
834
836
|
prompt += "No tools available. Do not invoke tools."
|
|
835
837
|
else:
|
|
836
|
-
|
|
838
|
+
tools_set = {}
|
|
839
|
+
|
|
840
|
+
if npc.tools_dict is not None:
|
|
841
|
+
for tool_name, tool in npc.tools_dict.items():
|
|
842
|
+
if tool_name not in tools_set:
|
|
843
|
+
tools_set[tool_name] = tool.description
|
|
844
|
+
if npc.all_tools_dict is not None:
|
|
845
|
+
for tool_name, tool in npc.all_tools_dict.items():
|
|
846
|
+
if tool_name not in tools_set:
|
|
847
|
+
tools_set[tool_name] = tool.description
|
|
848
|
+
|
|
849
|
+
for tool_name, tool_description in tools_set.items():
|
|
837
850
|
prompt += f"""
|
|
838
|
-
|
|
839
|
-
|
|
851
|
+
|
|
852
|
+
{tool_name} : {tool_description} \n
|
|
853
|
+
"""
|
|
854
|
+
|
|
840
855
|
prompt += f"""
|
|
841
856
|
Available NPCs for alternative answers:
|
|
842
857
|
|
|
@@ -870,7 +885,7 @@ ReAct choices then will enter reasoning flow
|
|
|
870
885
|
Relevant shared context for the npc:
|
|
871
886
|
{npc.shared_context}
|
|
872
887
|
"""
|
|
873
|
-
print("shared_context: " + str(npc.shared_context))
|
|
888
|
+
# print("shared_context: " + str(npc.shared_context))
|
|
874
889
|
# print(prompt)
|
|
875
890
|
|
|
876
891
|
prompt += f"""
|
|
@@ -1101,9 +1116,9 @@ ReAct choices then will enter reasoning flow
|
|
|
1101
1116
|
elif action == "execute_sequence":
|
|
1102
1117
|
tool_names = response_content_parsed.get("tool_name")
|
|
1103
1118
|
npc_names = response_content_parsed.get("npc_name")
|
|
1104
|
-
print(npc_names)
|
|
1119
|
+
# print(npc_names)
|
|
1105
1120
|
npcs = []
|
|
1106
|
-
print(tool_names, npc_names)
|
|
1121
|
+
# print(tool_names, npc_names)
|
|
1107
1122
|
if isinstance(npc_names, list):
|
|
1108
1123
|
for npc_name in npc_names:
|
|
1109
1124
|
for npc_obj in npc.resolved_npcs:
|
|
@@ -1192,9 +1207,8 @@ def handle_tool_call(
|
|
|
1192
1207
|
"""
|
|
1193
1208
|
# print(npc)
|
|
1194
1209
|
print("handling tool call")
|
|
1195
|
-
if not npc
|
|
1196
|
-
|
|
1197
|
-
available_tools = npc.all_tools_dict if npc else None
|
|
1210
|
+
if not npc:
|
|
1211
|
+
|
|
1198
1212
|
print(
|
|
1199
1213
|
f"No tools available for NPC '{npc.name}' or tools_dict is empty. Available tools: {available_tools}"
|
|
1200
1214
|
)
|