system prompt
This commit is contained in:
@@ -25,6 +25,7 @@ export type ClientMessage =
|
||||
// Server → Client
|
||||
export type ServerMessage =
|
||||
| { type: 'session:init'; sessionId: string; model: string }
|
||||
| { type: 'system:prompt'; text: string }
|
||||
| { type: 'assistant:text'; text: string }
|
||||
| { type: 'assistant:partial'; text: string }
|
||||
| { type: 'tool:use'; toolName: string; toolInput: Record<string, unknown>; toolUseId: string }
|
||||
|
||||
@@ -135,6 +135,7 @@ async function handleChat({
|
||||
const workingDir = state.cwd ?? homeDir;
|
||||
|
||||
const skillsAppend = await buildSkillsPrompt(ws.data.email);
|
||||
if (skillsAppend) send(ws, { type: 'system:prompt', text: skillsAppend });
|
||||
|
||||
// Build prompt: use AsyncIterable<SDKUserMessage> with image content blocks when images are present
|
||||
let promptInput: string | AsyncIterable<SDKUserMessage> = prompt;
|
||||
|
||||
@@ -401,7 +401,8 @@ async function handleChat({ ws, prompt, sessionId, model, attachmentIds, images,
|
||||
}
|
||||
|
||||
const skillsAppend = await buildSkillsPrompt(ws.data.email);
|
||||
const fullPrompt = skillsAppend ? `${skillsAppend}\n\n${prompt}` : prompt;
|
||||
if (skillsAppend) send(ws, { type: 'system:prompt', text: skillsAppend });
|
||||
const fullPrompt = skillsAppend ? `<system>${skillsAppend}</system>\n\n${prompt}` : prompt;
|
||||
|
||||
const parts: Record<string, unknown>[] = [];
|
||||
if (images?.length) {
|
||||
|
||||
Reference in New Issue
Block a user