Skip to content

Commit f7b988b

Browse files
committed
adjusted some of test shell helperps and updated py version. removed shared context printout.
1 parent d0fb1db commit f7b988b

File tree

4 files changed

+16
-31
lines changed

4 files changed

+16
-31
lines changed

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# npcsh
77

88

9-
- `npcsh` is a python-based command-line tool designed to integrate Large Language Models (LLMs) and Agents into one's daily workflow by making them available and easily configurable through the command line shell.
9+
- `npcsh` is a python-based AI Agent framework designed to integrate Large Language Models (LLMs) and Agents into one's daily workflow by making them available and easily configurable through a command line shell as well as an extensible python library.
1010

1111
- **Smart Interpreter**: `npcsh` leverages the power of LLMs to understand your natural language commands and questions, executing tasks, answering queries, and providing relevant information from local files and the web.
1212

@@ -17,10 +17,9 @@
1717

1818
* **Extensible with Python:** `npcsh`'s python package provides useful functions for interacting with LLMs, including explicit coverage for popular providers like ollama, anthropic, openai, gemini, deepseek, and openai-like providers. Each macro has a corresponding function and these can be used in python scripts. `npcsh`'s functions are purpose-built to simplify NPC interactions but NPCs are not required for them to work if you don't see the need.
1919

20-
* **Simple, Powerful CLI:** Use the `npc` CLI commands to set up a flask server so you can expose your NPC team for use as a backend service. You can also use the `npc` CLI to run SQL models defined in your project, execute assembly lines, and verify the integrity of your NPC team's interrelations. `npcsh`'s NPCs take advantage of jinja templating to reference other NPCs and tools in their properties, and the `npc` CLI can be used to verify these references.
21-
22-
* **Shell Strengths:** Execute bash commands directly. Use your favorite command-line tools like VIM, Emacs, ipython, sqlite3, git. Pipe the output of these commands to LLMs or pass LLM results to bash commands.
20+
* **Simple, Powerful CLI:** Use the `npc` CLI commands to run `npcsh` macros or commands from one's regular shell. Set up a flask server so you can expose your NPC team for use as a backend service. You can also use the `npc` CLI to run SQL models defined in your project, execute assembly lines, and verify the integrity of your NPC team's interrelations. `npcsh`'s NPCs take advantage of jinja templating to reference other NPCs and tools in their properties, and the `npc` CLI can be used to verify these references.
2321

22+
* **Powerful Tool integrations:** `npcsh` has built-in tools for users to have agents execute code, analyze data, generate images, search the web, and more. Tools can be defined in YAML files as part of project-specific `npc_team`s or in the global `~/.npcsh/npc_team` directory or simply in python scripts. Once compiled, the tools can be used as macros in the `npc` cli as well as `/{tool_name}` commands in the `npcsh` shell.
2423

2524

2625
Interested to stay in the loop and to hear the latest and greatest about `npcsh` ? Be sure to sign up for the [npcsh newsletter](https://forms.gle/n1NzQmwjsV4xv1B2A)!

npcsh/llm_funcs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -885,7 +885,7 @@ def check_llm_command(
885885
Relevant shared context for the npc:
886886
{npc.shared_context}
887887
"""
888-
print("shared_context: " + str(npc.shared_context))
888+
# print("shared_context: " + str(npc.shared_context))
889889
# print(prompt)
890890

891891
prompt += f"""

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ def get_setup_message():
7777
"librosa",
7878
"openai",
7979
"jinja2",
80-
"pyautogui",
8180
"pandas",
8281
"matplotlib",
8382
"IPython",
@@ -87,6 +86,7 @@ def get_setup_message():
8786
"PyYAML",
8887
"langchain",
8988
"langchain_community",
89+
"pyautogui",
9090
# "openai-whisper",
9191
# "pyaudio",
9292
# "gtts",

tests/test_shell_helpers.py

Lines changed: 11 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,6 @@ def test_db():
6969
os.unlink(db_path)
7070

7171

72-
@pytest.fixture
73-
def command_history():
74-
return CommandHistory()
75-
76-
7772
@pytest.fixture
7873
def npc_compiler():
7974
# Get the absolute path to the npc_team directory
@@ -85,82 +80,73 @@ def npc_compiler():
8580
return NPCCompiler(npc_dir, ":memory:")
8681

8782

88-
def test_execute_slash_commands(command_history, npc_compiler, test_db):
83+
def test_execute_slash_commands(npc_compiler, test_db):
8984
"""Test various slash commands"""
9085

91-
result = execute_command("/help", command_history, test_db, npc_compiler)
86+
result = execute_command("/help", test_db, npc_compiler)
9287
assert "Available Commands" in result["output"]
9388

9489

95-
def test_execute_command_with_model_override(command_history, npc_compiler, test_db):
90+
def test_execute_command_with_model_override(npc_compiler, test_db):
9691
"""Test command execution with model override"""
9792
result = execute_command(
9893
"@gpt-4o-mini What is 2+2?",
99-
command_history,
10094
test_db,
10195
npc_compiler,
10296
)
10397
assert result["output"] is not None
10498

10599

106-
def test_execute_command_who_was_simon_bolivar(command_history, npc_compiler, test_db):
100+
def test_execute_command_who_was_simon_bolivar(npc_compiler, test_db):
107101
"""Test the command for querying information about Simón Bolívar."""
108102
result = execute_command(
109103
"What country was Simon Bolivar born in?",
110-
command_history,
111104
test_db,
112105
npc_compiler,
113106
)
114107
assert "venezuela" in str(result["output"]).lower()
115108

116109

117-
def test_execute_command_capital_of_france(command_history, npc_compiler, test_db):
110+
def test_execute_command_capital_of_france(npc_compiler, test_db):
118111
"""Test the command for querying the capital of France."""
119-
result = execute_command(
120-
"What is the capital of France?", command_history, test_db, npc_compiler
121-
)
112+
result = execute_command("What is the capital of France?", test_db, npc_compiler)
122113
assert "paris" in str(result["output"]).lower()
123114

124115

125-
def test_execute_command_weather_info(command_history, npc_compiler, test_db):
116+
def test_execute_command_weather_info(npc_compiler, test_db):
126117
"""Test the command for getting weather information."""
127118
result = execute_command(
128-
"what is the weather in Tokyo?", command_history, test_db, npc_compiler
119+
"search the web for the weather in Tokyo?", test_db, npc_compiler
129120
)
130121
print(result) # Add print for debugging
131122
assert "tokyo" in str(result["output"]).lower()
132123

133124

134-
def test_execute_command_linked_list_implementation(
135-
command_history, npc_compiler, test_db
136-
):
125+
def test_execute_command_linked_list_implementation(npc_compiler, test_db):
137126
"""Test the command for querying linked list implementation in Python."""
138127
result = execute_command(
139128
" Tell me a way to implement a linked list in Python?",
140-
command_history,
141129
test_db,
142130
npc_compiler,
143131
)
144132
assert "class Node:" in str(result["output"])
145133
assert "class LinkedList:" in str(result["output"])
146134

147135

148-
def test_execute_command_inquiry_with_npcs(command_history, npc_compiler, test_db):
136+
def test_execute_command_inquiry_with_npcs(npc_compiler, test_db):
149137
"""Test inquiry using NPCs."""
150138
result = execute_command(
151139
"/search -p duckduckgo who is the current us president",
152-
command_history,
153140
test_db,
154141
npc_compiler,
155142
)
156143
assert "President" in result["output"] # Check for presence of expected output
157144

158145

159-
def test_execute_command_rag_search(command_history, npc_compiler, test_db):
146+
def test_execute_command_rag_search(npc_compiler, test_db):
160147
"""Test the command for a RAG search."""
161148
result = execute_command(
162149
"/rag -f dummy_linked_list.py linked list",
163-
command_history,
164150
test_db,
165151
npc_compiler,
166152
)

0 commit comments

Comments
 (0)