feat: implement Agentic Skill and Negative Prompt injection

This commit is contained in:
2026-04-28 10:17:04 +09:00
parent 72666ea0bc
commit e6d34a5cb6
4 changed files with 204 additions and 7 deletions
+8 -2
View File
@@ -85,7 +85,9 @@ export class AgentExecutor {
visionContent?: any[],
temperature?: number,
systemPrompt?: string,
runId?: number
runId?: number,
agentSkillContext?: string,
negativePrompt?: string
}
) {
const {
@@ -191,7 +193,11 @@ export class AgentExecutor {
const internetCtx = internetEnabled
? `\n\n[CRITICAL: INTERNET ACCESS ENABLED]\nYou can use <read_url> to search. Current time: ${new Date().toLocaleString()}`
: '';
const fullSystemPrompt = `${systemPrompt}${internetCtx}\n\n[CONTEXT]\n${brainContext}\n${contextBlock}`;
const agentSkillCtx = options.agentSkillContext ? `\n\n[AGENT PERSONA & SKILLS]\n${options.agentSkillContext}` : '';
const negativeCtx = options.negativePrompt ? `\n\n[STRICT NEGATIVE PROMPT - DO NOT DO THIS]\n${options.negativePrompt}` : '';
const fullSystemPrompt = `${systemPrompt}${internetCtx}\n\n[CONTEXT]\n${brainContext}\n${contextBlock}${agentSkillCtx}${negativeCtx}`;
const messagesForRequest: ChatMessage[] = [
{ role: 'system', content: fullSystemPrompt, internal: true },
...reqMessages