Merge pull request #1 from letta-ai/christina/allow-convo-on-create
allow new convo creation on createSession
This commit is contained in:
@@ -104,6 +104,9 @@ await using session4 = resumeSession(agentId, { defaultConversation: true });
|
||||
|
||||
// Resume last used session (agent + conversation)
|
||||
await using session5 = createSession({ continue: true });
|
||||
|
||||
// Create new agent with a new (non-default) conversation
|
||||
await using session6 = createSession({ newConversation: true });
|
||||
```
|
||||
|
||||
**Key concepts:**
|
||||
|
||||
@@ -182,14 +182,6 @@ export class SubprocessTransport {
|
||||
);
|
||||
}
|
||||
|
||||
// newConversation requires agentId
|
||||
if (this.options.newConversation && !this.options.agentId) {
|
||||
throw new Error(
|
||||
"'newConversation' requires agentId. " +
|
||||
"Use resumeSession(agentId, { newConversation: true })."
|
||||
);
|
||||
}
|
||||
|
||||
// Conversation and agent handling
|
||||
if (this.options.continue) {
|
||||
// Resume last session (agent + conversation)
|
||||
@@ -210,6 +202,10 @@ export class SubprocessTransport {
|
||||
} else {
|
||||
// Create new agent
|
||||
args.push("--new-agent");
|
||||
if (this.options.newConversation) {
|
||||
// Also create new conversation (not default)
|
||||
args.push("--new");
|
||||
}
|
||||
}
|
||||
|
||||
// Model
|
||||
|
||||
Reference in New Issue
Block a user