feat: system prompt swapping (#131)

This commit is contained in:
Charles Packer
2025-11-27 01:30:11 -08:00
committed by GitHub
parent 8330534f00
commit 135c19c7d7
10 changed files with 665 additions and 4 deletions

View File

@@ -262,3 +262,38 @@ export async function unlinkToolsFromAgent(
};
}
}
export interface SystemPromptUpdateResult {
success: boolean;
message: string;
}
/**
* Updates an agent's system prompt.
*
* @param agentId - The agent ID
* @param systemPrompt - The new system prompt content
* @returns Result with success status and message
*/
export async function updateAgentSystemPrompt(
agentId: string,
systemPrompt: string,
): Promise<SystemPromptUpdateResult> {
try {
const client = await getClient();
await client.agents.update(agentId, {
system: systemPrompt,
});
return {
success: true,
message: "System prompt updated successfully",
};
} catch (error) {
return {
success: false,
message: `Failed to update system prompt: ${error instanceof Error ? error.message : String(error)}`,
};
}
}