feat: add system prompt customization options in SDK and CLI

This commit is contained in:
DragonnZhang 2026-03-16 02:47:06 +08:00
parent 110fcd7b7b
commit ee33a3c35e
17 changed files with 529 additions and 14 deletions

View file

@ -298,6 +298,8 @@ export interface ConfigParameters {
debugMode: boolean;
includePartialMessages?: boolean;
question?: string;
systemPrompt?: string;
appendSystemPrompt?: string;
coreTools?: string[];
allowedTools?: string[];
excludeTools?: string[];
@ -451,6 +453,8 @@ export class Config {
private readonly outputFormat: OutputFormat;
private readonly includePartialMessages: boolean;
private readonly question: string | undefined;
private readonly systemPrompt: string | undefined;
private readonly appendSystemPrompt: string | undefined;
private readonly coreTools: string[] | undefined;
private readonly allowedTools: string[] | undefined;
private readonly excludeTools: string[] | undefined;
@ -561,6 +565,8 @@ export class Config {
this.outputFormat = normalizedOutputFormat ?? OutputFormat.TEXT;
this.includePartialMessages = params.includePartialMessages ?? false;
this.question = params.question;
this.systemPrompt = params.systemPrompt;
this.appendSystemPrompt = params.appendSystemPrompt;
this.coreTools = params.coreTools;
this.allowedTools = params.allowedTools;
this.excludeTools = params.excludeTools;
@ -1208,6 +1214,14 @@ export class Config {
return this.question;
}
getSystemPrompt(): string | undefined {
return this.systemPrompt;
}
getAppendSystemPrompt(): string | undefined {
return this.appendSystemPrompt;
}
getCoreTools(): string[] | undefined {
return this.coreTools;
}