npcsh 1.0.9__py3-none-any.whl → 1.0.10__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/alicanto.py +3 -3
- npcsh/npcsh.py +20 -29
- npcsh/routes.py +4 -3
- {npcsh-1.0.9.dist-info → npcsh-1.0.10.dist-info}/METADATA +1 -1
- {npcsh-1.0.9.dist-info → npcsh-1.0.10.dist-info}/RECORD +9 -9
- {npcsh-1.0.9.dist-info → npcsh-1.0.10.dist-info}/WHEEL +0 -0
- {npcsh-1.0.9.dist-info → npcsh-1.0.10.dist-info}/entry_points.txt +0 -0
- {npcsh-1.0.9.dist-info → npcsh-1.0.10.dist-info}/licenses/LICENSE +0 -0
- {npcsh-1.0.9.dist-info → npcsh-1.0.10.dist-info}/top_level.txt +0 -0
npcsh/alicanto.py
CHANGED
|
@@ -14,11 +14,11 @@ import subprocess
|
|
|
14
14
|
import networkx as nx
|
|
15
15
|
|
|
16
16
|
from npcpy.npc_compiler import NPC
|
|
17
|
-
from npcpy.llm_funcs import get_llm_response
|
|
17
|
+
from npcpy.llm_funcs import get_llm_response, extract_facts, identify_groups, assign_groups_to_fact
|
|
18
18
|
from npcsh._state import NPCSH_CHAT_MODEL, NPCSH_CHAT_PROVIDER
|
|
19
19
|
from npcpy.npc_sysenv import print_and_process_stream_with_markdown
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
|
|
21
|
+
|
|
22
22
|
|
|
23
23
|
def generate_random_npcs(num_npcs: int, model: str, provider: str, request: str) -> List[NPC]:
|
|
24
24
|
"""
|
npcsh/npcsh.py
CHANGED
|
@@ -54,8 +54,6 @@ from npcpy.memory.command_history import (
|
|
|
54
54
|
CommandHistory,
|
|
55
55
|
save_conversation_message,
|
|
56
56
|
)
|
|
57
|
-
from npcpy.memory.knowledge_graph import breathe
|
|
58
|
-
from npcpy.memory.sleep import sleep, forget
|
|
59
57
|
from npcpy.npc_compiler import NPC, Team, load_jinxs_from_directory
|
|
60
58
|
from npcpy.llm_funcs import check_llm_command, get_llm_response, execute_llm_command
|
|
61
59
|
from npcpy.gen.embeddings import get_embeddings
|
|
@@ -585,10 +583,8 @@ def execute_slash_command(command: str, stdin_input: Optional[str], state: Shell
|
|
|
585
583
|
result_dict = handler(command, **handler_kwargs)
|
|
586
584
|
|
|
587
585
|
if isinstance(result_dict, dict):
|
|
588
|
-
#some respond with output, some with response, needs to be fixed upstream
|
|
589
|
-
output = result_dict.get("output") or result_dict.get("response")
|
|
590
586
|
state.messages = result_dict.get("messages", state.messages)
|
|
591
|
-
return state,
|
|
587
|
+
return state, result_dict
|
|
592
588
|
else:
|
|
593
589
|
return state, result_dict
|
|
594
590
|
|
|
@@ -702,7 +698,7 @@ def process_pipeline_command(
|
|
|
702
698
|
images=state.attachments,
|
|
703
699
|
stream=stream_final,
|
|
704
700
|
context=info,
|
|
705
|
-
|
|
701
|
+
|
|
706
702
|
)
|
|
707
703
|
if isinstance(llm_result, dict):
|
|
708
704
|
state.messages = llm_result.get("messages", state.messages)
|
|
@@ -859,8 +855,6 @@ def execute_command(
|
|
|
859
855
|
try:
|
|
860
856
|
bash_state, bash_output = handle_bash_command(cmd_parts, command, None, state)
|
|
861
857
|
return bash_state, bash_output
|
|
862
|
-
except CommandNotFoundError:
|
|
863
|
-
return state, colored(f"Command not found: {command_name}", "red")
|
|
864
858
|
except Exception as bash_err:
|
|
865
859
|
return state, colored(f"Bash execution failed: {bash_err}", "red")
|
|
866
860
|
except Exception:
|
|
@@ -1137,12 +1131,13 @@ def execute_todo_item(todo: Dict[str, Any], ride_state: RideState, shell_state:
|
|
|
1137
1131
|
team=shell_state.team,
|
|
1138
1132
|
messages=[],
|
|
1139
1133
|
stream=shell_state.stream_output,
|
|
1140
|
-
|
|
1134
|
+
|
|
1141
1135
|
)
|
|
1142
1136
|
|
|
1143
1137
|
output_payload = result.get("output", "")
|
|
1144
1138
|
output_str = ""
|
|
1145
1139
|
|
|
1140
|
+
|
|
1146
1141
|
if isgenerator(output_payload):
|
|
1147
1142
|
output_str = print_and_process_stream_with_markdown(output_payload, shell_state.chat_model, shell_state.chat_provider)
|
|
1148
1143
|
elif isinstance(output_payload, dict):
|
|
@@ -1398,34 +1393,30 @@ def process_result(
|
|
|
1398
1393
|
if user_input =='/help':
|
|
1399
1394
|
render_markdown(output)
|
|
1400
1395
|
elif result_state.stream_output:
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
elif isinstance(output, dict):
|
|
1416
|
-
if 'output' in output:
|
|
1417
|
-
final_output_str = output['output']
|
|
1418
|
-
render_markdown(final_output_str)
|
|
1396
|
+
|
|
1397
|
+
if isinstance(output, dict):
|
|
1398
|
+
output_gen = output.get('output')
|
|
1399
|
+
model = output.get('model', result_state.chat_model)
|
|
1400
|
+
provider = output.get('provider', result_state.chat_provider)
|
|
1401
|
+
else:
|
|
1402
|
+
output_gen = output
|
|
1403
|
+
model = result_state.chat_model
|
|
1404
|
+
provider = result_state.chat_provider
|
|
1405
|
+
print('processing stream output with markdown...')
|
|
1406
|
+
|
|
1407
|
+
final_output_str = print_and_process_stream_with_markdown(output_gen,
|
|
1408
|
+
model,
|
|
1409
|
+
provider)
|
|
1419
1410
|
|
|
1420
1411
|
elif output is not None:
|
|
1421
1412
|
final_output_str = str(output)
|
|
1422
|
-
render_markdown(final_output_str)
|
|
1413
|
+
render_markdown('str not none: ', final_output_str)
|
|
1423
1414
|
if final_output_str and result_state.messages and result_state.messages[-1].get("role") != "assistant":
|
|
1424
1415
|
result_state.messages.append({"role": "assistant", "content": final_output_str})
|
|
1425
1416
|
|
|
1426
1417
|
#print(result_state.messages)
|
|
1427
1418
|
|
|
1428
|
-
|
|
1419
|
+
|
|
1429
1420
|
|
|
1430
1421
|
if final_output_str:
|
|
1431
1422
|
save_conversation_message(
|
npcsh/routes.py
CHANGED
|
@@ -24,6 +24,7 @@ from npcpy.llm_funcs import (
|
|
|
24
24
|
get_llm_response,
|
|
25
25
|
gen_image,
|
|
26
26
|
gen_video,
|
|
27
|
+
breathe,
|
|
27
28
|
)
|
|
28
29
|
from npcpy.npc_compiler import NPC, Team, Jinx
|
|
29
30
|
from npcpy.npc_compiler import initialize_npc_project
|
|
@@ -38,8 +39,8 @@ from npcpy.memory.search import execute_rag_command, execute_search_command, exe
|
|
|
38
39
|
from npcpy.memory.command_history import CommandHistory
|
|
39
40
|
|
|
40
41
|
|
|
41
|
-
|
|
42
|
-
|
|
42
|
+
|
|
43
|
+
|
|
43
44
|
from npcpy.serve import start_flask_server
|
|
44
45
|
|
|
45
46
|
|
|
@@ -336,7 +337,7 @@ def ots_handler(command: str, **kwargs):
|
|
|
336
337
|
api_url=safe_get(kwargs, 'api_url'),
|
|
337
338
|
api_key=safe_get(kwargs, 'api_key')
|
|
338
339
|
)
|
|
339
|
-
return {"output": response_data.get('response'), "messages": response_data.get('messages')}
|
|
340
|
+
return {"output": response_data.get('response'), "messages": response_data.get('messages'), "model": vision_model, "provider": vision_provider}
|
|
340
341
|
|
|
341
342
|
except Exception as e:
|
|
342
343
|
traceback.print_exc()
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
npcsh/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
2
|
npcsh/_state.py,sha256=GCMUIwgIBlS7LEBLYlfBiPNKVaK19ZyxT833NFU-djU,31109
|
|
3
|
-
npcsh/alicanto.py,sha256=
|
|
3
|
+
npcsh/alicanto.py,sha256=F-zZGjBTo3a_PQHvPC8-DNF6t4mJELo_zx7gBGvDehg,44611
|
|
4
4
|
npcsh/guac.py,sha256=Ocmk_c4NUtGsC3JOtmkbgLvD6u-XtBPRFRYcckpgUJU,33099
|
|
5
5
|
npcsh/mcp_helpers.py,sha256=Ktd2yXuBnLL2P7OMalgGLj84PXJSzaucjqmJVvWx6HA,12723
|
|
6
6
|
npcsh/mcp_npcsh.py,sha256=SfmplH62GS9iI6q4vuQLVUS6tkrok6L7JxODx_iH7ps,36158
|
|
7
7
|
npcsh/mcp_server.py,sha256=l2Ra0lpFrUu334pvp0Q9ajF2n73KvZswFi0FgbDhh9k,5884
|
|
8
8
|
npcsh/npc.py,sha256=7ujKrMQFgkeGJ4sX5Kn_dB5tjrPN58xeC91PNt453aM,7827
|
|
9
|
-
npcsh/npcsh.py,sha256=
|
|
9
|
+
npcsh/npcsh.py,sha256=xrDcmK3UlkTXF2tdR1Bxq7sqG62-AcUTf_IupJYt8U4,59237
|
|
10
10
|
npcsh/plonk.py,sha256=U2e9yUJZN95Girzzvgrh-40zOdl5zO3AHPsIjoyLv2M,15261
|
|
11
11
|
npcsh/pti.py,sha256=jGHGE5SeIcDkV8WlOEHCKQCnYAL4IPS-kUBHrUz0oDA,10019
|
|
12
|
-
npcsh/routes.py,sha256=
|
|
12
|
+
npcsh/routes.py,sha256=JNlRMk8WvGlR950Bl_LQMjm_gtdpPI0XMBQlj_YjI5I,37768
|
|
13
13
|
npcsh/spool.py,sha256=GhnSFX9uAtrB4m_ijuyA5tufH12DrWdABw0z8FmiCHc,11497
|
|
14
14
|
npcsh/wander.py,sha256=BiN6eYyFnEsFzo8MFLRkdZ8xS9sTKkQpjiCcy9chMcc,23225
|
|
15
15
|
npcsh/yap.py,sha256=h5KNt9sNOrDPhGe_zfn_yFIeQhizX09zocjcPWH7m3k,20905
|
|
16
|
-
npcsh-1.0.
|
|
17
|
-
npcsh-1.0.
|
|
18
|
-
npcsh-1.0.
|
|
19
|
-
npcsh-1.0.
|
|
20
|
-
npcsh-1.0.
|
|
21
|
-
npcsh-1.0.
|
|
16
|
+
npcsh-1.0.10.dist-info/licenses/LICENSE,sha256=IKBvAECHP-aCiJtE4cHGCE5Yl0tozYz02PomGeWS3y4,1070
|
|
17
|
+
npcsh-1.0.10.dist-info/METADATA,sha256=kaQ9neGi6CVloTZFgFdudx_oQZ9MHhlEqnwBoUp47Os,22748
|
|
18
|
+
npcsh-1.0.10.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
19
|
+
npcsh-1.0.10.dist-info/entry_points.txt,sha256=qxOYTm3ym3JWyWf2nv2Mk71uMcJIdUoNEJ8VYMkyHiY,214
|
|
20
|
+
npcsh-1.0.10.dist-info/top_level.txt,sha256=kHSNgKMCkfjV95-DH0YSp1LLBi0HXdF3w57j7MQON3E,6
|
|
21
|
+
npcsh-1.0.10.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|