Skip to content

Commit 120893b

Browse files
authored
Merge pull request #81 from cagostino/chris/llm_funcs_cleaning
Chris/llm funcs cleaning
2 parents f6b14d7 + 99ef262 commit 120893b

28 files changed

+3868
-2690
lines changed

README.md

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ Here is an example of what the .npcshrc file might look like after this has been
9898
```bash
9999
# NPCSH Configuration File
100100
export NPCSH_INITIALIZED=1
101-
export NPCSH_PROVIDER='ollama'
102-
export NPCSH_MODEL='llama3.2'
101+
export NPCSH_CHAT_PROVIDER='ollama'
102+
export NPCSH_CHAT_MODEL='llama3.2'
103103
export NPCSH_DB_PATH='~/npcsh_history.db'
104104
```
105105
`npcsh` also comes with a set of tools and NPCs that are used in processing. It will generate a folder at ~/.npcsh/ that contains the tools and NPCs that are used in the shell and these will be used in the absence of other project-specific ones. Additionally, `npcsh` records interactions and compiled information about npcs within a local SQLite database at the path specified in the .npcshrc file. This will default to ~/npcsh_history.db if not specified. When the data mode is used to load or analyze data in CSVs or PDFs, these data will be stored in the same database for future reference.
@@ -142,6 +142,28 @@ For cases where you wish to set up a project specific set of NPCs, tools, and as
142142
└── assembly_lines/ # Project workflows
143143
```
144144

145+
## IMPORTANT: migrations and deprecations
146+
147+
### v0.3.4
148+
-In v0.3.4, the structure for tools was adjusted. If you have made custom tools please refer to the structure within npc_compiler to ensure that they are in the correct format. Otherwise, do the following
149+
```bash
150+
rm ~/.npcsh/npc_team/tools/*.tool
151+
```
152+
and then
153+
```bash
154+
npcsh
155+
```
156+
and the updated tools will be copied over into the correct location.
157+
158+
### v0.3.5
159+
-Version 0.3.5 included a complete overhaul and refactoring of the llm_funcs module. This was done to make it not as horribly long and to make it easier to add new models and providers
160+
161+
162+
-in version 0.3.5, a change was introduced to the database schema for messages to add npcs, models, providers, and associated attachments to data. If you have used `npcsh` before this version, you will need to run this migration script to update your database schema: [migrate_conversation_history_v0.3.5.py](https://github.com/cagostino/npcsh/blob/cfb9dc226e227b3e888f3abab53585693e77f43d/npcsh/migrations/migrate_conversation_history_%3Cv0.3.4-%3Ev0.3.5.py)
163+
164+
-additionally, NPCSH_MODEL and NPCSH_PROVIDER have been renamed to NPCSH_CHAT_MODEL and NPCSH_CHAT_PROVIDER
165+
to provide a more consistent naming scheme now that we have additionally introduced `NPCSH_VISION_MODEL` and `NPCSH_VISION_PROVIDER`, `NPCSH_EMBEDDING_MODEL`, `NPCSH_EMBEDDING_PROVIDER`, `NPCSH_REASONING_MODEL`, `NPCSH_REASONING_PROVIDER`, `NPCSH_IMAGE_GEN_MODEL`, and `NPCSH_IMAGE_GEN_PROVIDER`.
166+
- In addition, we have added NPCSH_API_URL to better accommodate openai-like apis that require a specific url to be set as well as `NPCSH_STREAM_OUTPUT` to indicate whether or not to use streaming in one's responses. It will be set to 0 (false) by default as it has only been tested and verified for a small subset of the models and providers we have available (openai, anthropic, and ollama). If you try it and run into issues, please post them here so we can correct them as soon as possible !
145167

146168

147169
## npcsh usage
@@ -477,12 +499,15 @@ npcsh> /sample What is the capital of France?
477499

478500

479501
### Search
480-
Search can be accomplished through the `/search` macro. You can specify the provider as being "google" or "perplexity" or "duckduckgo". The default is google.
502+
Search can be accomplished through the `/search` macro. You can specify the provider as being "perplexity" or "duckduckgo". For the former,
503+
you must set a perplexity api key as an environment variable as described above. The default provider is duckduckgo.
481504

505+
NOTE: while google is an available search engine, they recently implemented changes (early 2025) that make the python google search package no longer as reliable.
506+
For now, we will use duckduckgo and revisit this issue when other more critical aspects are handled.
482507

483508

484509
```npcsh
485-
npcsh!> /search -p google who is the current us president
510+
npcsh!> /search -p duckduckgo who is the current us president
486511
487512
488513
President Donald J. Trump entered office on January 20, 2025. News, issues, and photos of the President Footer Disclaimer This is the official website of the U.S. Mission to the United Nations. External links to other Internet sites should not be construed as an endorsement of the views or privacy policies contained therein.

examples/data_analyst.npc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: data_analyst
22
primary_directive: Assist users with data analysis tasks, including data loading, plotting, and statistical computations.
33
model: llama3.2
44
provider: ollama
5-
suggested_tools_to_use:
5+
tools:
66
- data_loader
77
- data_plotter
88
- stats_calculator

examples/datacollector.npc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: DataCollector
22
primary_directive: Collect user feedback regarding UI preferences.
3-
suggested_tools_to_use:
3+
tools:
44
- feedback_gatherer
55
model: claude-3-haiku-latest
66
provider: anthropic

examples/market_analyst.npc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: market_analyst
22
primary_directive: You are an AI assistant focused on monitoring and analyzing market trends. Provide de
3-
suggested_tools_to_use:
3+
tools:
44
- market trend analysis
55
- report generation
66
model: llama3.2

examples/npc_team/factory/csv_generator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import pandas as pd
1+
import pandas as Enter
22
import random
33
import os
44
from faker import Faker
55

66
fake = Faker()
77

8-
import pandas as pd
8+
import pandas as Enter
99
import sqlite3
1010
from datetime import datetime
1111
from npcsh.npc_compiler import NPCCompiler, NPCSQLOperations, NPCDBTAdapter

examples/presenter.npc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: presenter
22
primary_directive: Create a presentation deck summarizing the analysis.
3-
suggested_tools_to_use:
3+
tools:
44
- deck_creator
55
model: claude-3-haiku-20240307
66
provider: anthropic

0 commit comments

Comments
 (0)