From e1c04c86054cd8d4e9af2efffd655adf60b0755d Mon Sep 17 00:00:00 2001 From: Charles Packer Date: Tue, 1 Apr 2025 10:13:21 -0700 Subject: [PATCH] fix: fix examples (py / ts) (#1506) --- examples/docs/example.py | 6 +++--- examples/docs/node/example.ts | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/docs/example.py b/examples/docs/example.py index 08424e39..68e6a1c8 100644 --- a/examples/docs/example.py +++ b/examples/docs/example.py @@ -77,8 +77,8 @@ agent_copy = client.agents.create( model="openai/gpt-4o-mini", embedding="openai/text-embedding-ada-002", ) -block = client.agents.core_memory.retrieve_block(agent.id, "human") -agent_copy = client.agents.core_memory.attach_block(agent_copy.id, block.id) +block = client.agents.blocks.retrieve(agent.id, block_label="human") +agent_copy = client.agents.blocks.attach(agent_copy.id, block.id) print(f"Created agent copy with shared memory named {agent_copy.name}") @@ -95,7 +95,7 @@ response = client.agents.messages.create( print(f"Sent message to agent {agent_copy.name}: {message_text}") -block = client.agents.core_memory.retrieve_block(agent_copy.id, "human") +block = client.agents.blocks.retrieve(agent_copy.id, block_label="human") print(f"New core memory for agent {agent_copy.name}: {block.value}") message_text = "What's my name?" diff --git a/examples/docs/node/example.ts b/examples/docs/node/example.ts index 1b52c7de..c0705077 100644 --- a/examples/docs/node/example.ts +++ b/examples/docs/node/example.ts @@ -102,8 +102,8 @@ let agentCopy = await client.agents.create({ model: 'openai/gpt-4o-mini', embedding: 'openai/text-embedding-ada-002', }); -let block = await client.agents.coreMemory.retrieveBlock(agent.id, 'human'); -agentCopy = await client.agents.coreMemory.attachBlock(agentCopy.id, block.id!); +let block = await client.agents.blocks.retrieve(agent.id, 'human'); +agentCopy = await client.agents.blocks.attach(agentCopy.id, block.id!); console.log('Created agent copy with shared memory named', agentCopy.name); @@ -120,7 +120,7 @@ response = await client.agents.messages.create(agentCopy.id, { console.log(`Sent message to agent ${agentCopy.name}: ${messageText}`); -block = await client.agents.coreMemory.retrieveBlock(agentCopy.id, 'human'); +block = await client.agents.blocks.retrieve(agentCopy.id, 'human'); console.log(`New core memory for agent ${agentCopy.name}: ${block.value}`); messageText = "What's my name?";