[FIX] Update example.py to reflect breaking API changes (#2471)
This commit is contained in:
@@ -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, "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, "human")
|
||||
print(f"New core memory for agent {agent_copy.name}: {block.value}")
|
||||
|
||||
message_text = "What's my name?"
|
||||
|
||||
Reference in New Issue
Block a user