From c23bf8ee0d50081e07075e7967b3902edba9f239 Mon Sep 17 00:00:00 2001 From: Christina Tong Date: Fri, 6 Feb 2026 16:18:48 -0800 Subject: [PATCH] chore: add embedding model to createAgent (#26) --- src/index.ts | 2 +- src/transport.ts | 8 +++++--- src/types.ts | 5 ++++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/index.ts b/src/index.ts index 3203cb0..e2d9bd8 100644 --- a/src/index.ts +++ b/src/index.ts @@ -159,7 +159,7 @@ export async function prompt( // Use default agent behavior (like letta -p) when no agentId specified const session = agentId ? createSession(agentId) - : new Session({ promptMode: true }); + : createSession(); try { await session.send(message); diff --git a/src/transport.ts b/src/transport.ts index ae3415f..3bdefa1 100644 --- a/src/transport.ts +++ b/src/transport.ts @@ -186,9 +186,6 @@ export class SubprocessTransport { // Use agent's default conversation explicitly args.push("--default"); } - } else if (this.options.promptMode) { - // prompt() without agentId: no agent flags - // Headless will use LRU agent or create Memo (like `letta -p "msg"`) } else if (this.options.createOnly) { // createAgent() - explicitly create new agent args.push("--new-agent"); @@ -203,6 +200,11 @@ export class SubprocessTransport { args.push("-m", this.options.model); } + // Embedding model + if (this.options.embedding) { + args.push("--embedding", this.options.embedding); + } + // System prompt configuration if (this.options.systemPrompt !== undefined) { if (typeof this.options.systemPrompt === "string") { diff --git a/src/types.ts b/src/types.ts index 9c3aa81..0f19b3d 100644 --- a/src/types.ts +++ b/src/types.ts @@ -139,10 +139,10 @@ export interface InternalSessionOptions { newConversation?: boolean; defaultConversation?: boolean; createOnly?: boolean; - promptMode?: boolean; // Agent configuration model?: string; + embedding?: string; systemPrompt?: SystemPromptConfig; // Memory blocks (only for new agents) @@ -192,6 +192,9 @@ export interface CreateAgentOptions { /** Model to use (e.g., "claude-sonnet-4-20250514") */ model?: string; + /** Embedding model to use (e.g., "text-embedding-ada-002") */ + embedding?: string; + /** * System prompt configuration. * - string: Use as the complete system prompt