chore: add embedding model to createAgent (#26)
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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") {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user