feat: Add file metadata processing status (#2665)

This commit is contained in:
Matthew Zhou
2025-06-06 11:11:39 -07:00
committed by GitHub
parent 9a20aa3aae
commit 841aad48ae
10 changed files with 305 additions and 167 deletions

View File

@@ -215,7 +215,7 @@ def test_attach_existing_files_creates_source_blocks_correctly(client: LettaSDKC
agent_state = client.agents.retrieve(agent_id=agent_state.id)
blocks = agent_state.memory.file_blocks
assert len(blocks) == 1
assert "test" in [b.value for b in blocks]
assert any("test" in b.value for b in blocks)
assert any(re.fullmatch(r"test_[a-z0-9]+\.txt", b.label) for b in blocks)
# Detach the source
@@ -225,7 +225,7 @@ def test_attach_existing_files_creates_source_blocks_correctly(client: LettaSDKC
agent_state = client.agents.retrieve(agent_id=agent_state.id)
blocks = agent_state.memory.file_blocks
assert len(blocks) == 0
assert "test" not in [b.value for b in blocks]
assert not any("test" in b.value for b in blocks)
assert not any(re.fullmatch(r"test_[a-z0-9]+\.txt", b.label) for b in blocks)
@@ -254,7 +254,7 @@ def test_delete_source_removes_source_blocks_correctly(client: LettaSDKClient, a
agent_state = client.agents.retrieve(agent_id=agent_state.id)
blocks = agent_state.memory.file_blocks
assert len(blocks) == 1
assert "test" in [b.value for b in blocks]
assert any("test" in b.value for b in blocks)
assert any(re.fullmatch(r"test_[a-z0-9]+\.txt", b.label) for b in blocks)
# Remove file from source
@@ -264,7 +264,7 @@ def test_delete_source_removes_source_blocks_correctly(client: LettaSDKClient, a
agent_state = client.agents.retrieve(agent_id=agent_state.id)
blocks = agent_state.memory.file_blocks
assert len(blocks) == 0
assert "test" not in [b.value for b in blocks]
assert not any("test" in b.value for b in blocks)
assert not any(re.fullmatch(r"test_[a-z0-9]+\.txt", b.label) for b in blocks)