-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fe31fca
commit a083030
Showing
1 changed file
with
0 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +0,0 @@ | ||
from letta import BasicBlockMemory, create_client | ||
|
||
client = create_client() | ||
|
||
|
||
human_block = client.create_block(label="human", value="Name: Sarah") | ||
|
||
sad_persona_block = client.create_block(label="persona", value="You are a sad and negative assistant :(") | ||
sad_block_memory = BasicBlockMemory(human=human_block, persona=sad_persona_block) | ||
|
||
|
||
happy_persona_block = client.create_block(label="persona", value="You are a happy and positive assistant!") | ||
happy_block_memory = BasicBlockMemory(human=human_block, persona=happy_persona_block) | ||
|
||
happy_agent = client.create_agent(name="happy_agent", memory=happy_block_memory) | ||
sad_agent = client.create_agent(name="sad_agent", memory=sad_block_memory) | ||
|
||
# Update the shared memory block (human) for happy agent | ||
response = client.send_message(agent_id=happy_agent.id, role="user", message="my name is actually Charles") | ||
|
||
# Use updated information | ||
response = client.send_message(agent_id=sad_agent.id, role="user", message="whats my name?") | ||
|
||
|
||
# creating block templates | ||