chore: Add --system flag for existing agents + update system prompt variable names (#328)
This commit is contained in:
@@ -53,7 +53,7 @@ export async function createAgent(
|
||||
skillsDirectory?: string,
|
||||
parallelToolCalls = true,
|
||||
enableSleeptime = false,
|
||||
systemPrompt?: string,
|
||||
systemPromptId?: string,
|
||||
initBlocks?: string[],
|
||||
baseTools?: string[],
|
||||
) {
|
||||
@@ -202,13 +202,13 @@ export async function createAgent(
|
||||
const modelUpdateArgs = getModelUpdateArgs(modelHandle);
|
||||
const contextWindow = (modelUpdateArgs?.context_window as number) || 200_000;
|
||||
|
||||
// Resolve system prompt (ID, subagent name, or literal content)
|
||||
const resolvedSystemPrompt = await resolveSystemPrompt(systemPrompt);
|
||||
// Resolve system prompt ID to content
|
||||
const systemPromptContent = await resolveSystemPrompt(systemPromptId);
|
||||
|
||||
// Create agent with all block IDs (existing + newly created)
|
||||
const agent = await client.agents.create({
|
||||
agent_type: "letta_v1_agent" as AgentType,
|
||||
system: resolvedSystemPrompt,
|
||||
system: systemPromptContent,
|
||||
name,
|
||||
description: `Letta Code agent created in ${process.cwd()}`,
|
||||
embedding: embeddingModel,
|
||||
|
||||
Reference in New Issue
Block a user