Skip to content

Commit af54573

Browse files
author
A8065384
committed
Add --no-system-prompt flag
1 parent f11b955 commit af54573

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/subcommands/chat/index.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ type ChatCommandOptions = OptionValues &
2626
CreateClientArgs &
2727
LogLevelArgs & {
2828
prompt?: string;
29-
systemPrompt?: string;
29+
systemPrompt?: string | false;
3030
stats?: true;
3131
ttl: number;
3232
dontFetchCatalog: boolean;
@@ -175,6 +175,7 @@ const chatCommandBase = new Command<[], ChatCommandOptions>()
175175
.argument("[model]", "Model name to use")
176176
.option("-p, --prompt <prompt>", "Print response to stdout and quit")
177177
.option("-s, --system-prompt <systemPrompt>", "Custom system prompt to use for the chat")
178+
.option("--no-system-prompt", "Omit the system prompt entirely")
178179
.option("--stats", "Display detailed prediction statistics after each response")
179180
.addOption(
180181
new Option("--ttl <ttl>", "Time (in seconds) to keep the model loaded after the chat ends")
@@ -208,7 +209,9 @@ chatCommand.action(async (model, options: ChatCommandOptions) => {
208209
process.exit(1);
209210
}
210211
const chat = Chat.empty();
211-
chat.append("system", options.systemPrompt ?? DEFAULT_SYSTEM_PROMPT);
212+
if (options.systemPrompt !== false) {
213+
chat.append("system", options.systemPrompt ?? DEFAULT_SYSTEM_PROMPT);
214+
}
212215
const cliPref = await getCliPref(logger);
213216
const shouldFetchModelCatalog = await getOrAskShouldFetchModelCatalog(
214217
dontFetchCatalog,

0 commit comments

Comments
 (0)