Hi, I have been running code locally. I am getting errors in 2 different code blocks.
First in
chat_memory.list_block_names()
AttributeError: ‘ChatMemory’ object has no attribute ‘list_block_names’
Secondly in
task_agent_name = “task_agent”
task_agent_state = client.create_agent(
name=task_agent_name,
system = open(“task_queue_system_prompt.txt”, “r”).read(),
memory=TaskMemory(
human=“My name is Sarah”,
persona=“You are an agent that must clear its tasks.”,
tasks=
)
)
AttributeError: ‘TaskMemory’ object has no attribute ‘link_block’
Kindly let me know what I am done. Should I downgrade to versions asked in requireents.txt?
Okay, I have made changes as workaround which helped but now I have another set of problems.
As mentioned by another user, I made following changes:
for first part:
Using list_block_labels() instead of list_block_names()
for second part:
from letta.schemas.embedding_config import EmbeddingConfig
# Set the default embedding config
client.set_default_embedding_config(EmbeddingConfig.default_config("text-embedding-ada-002"))
class TaskMemory(ChatMemory):
def __init__(self, human: str, persona: str, tasks: List[str]):
super().__init__(human=human, persona=persona, limit=2000)
self.set_block(
Block(
limit=2000,
value=json.dumps(tasks),
label="tasks"
)
)
And they work, but then when I run the below command, I get error
AttributeError: ‘_asyncio.Task’ object has no attribute ‘choices’
response = client.send_message(
agent_id=task_agent_state.id,
role=“user”,
message=message
)
nb_print(response.messages)
Please let me know what can be the fix.