From 0547143de77cf71c712efed4ac6d713d9a22a9ad Mon Sep 17 00:00:00 2001 From: xm0onh Date: Tue, 24 Dec 2024 15:14:54 -0800 Subject: [PATCH 1/2] support new type for conv thread --- .../src/components/memories/ApprovedMemory.tsx | 14 ++++++++------ .../src/components/memories/SkippedMemory.tsx | 14 ++++++++------ .../frontend/src/types/index.ts | 2 ++ 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/auto-kol/agent-memory-viewer/frontend/src/components/memories/ApprovedMemory.tsx b/auto-kol/agent-memory-viewer/frontend/src/components/memories/ApprovedMemory.tsx index cbd96c6..d72024c 100644 --- a/auto-kol/agent-memory-viewer/frontend/src/components/memories/ApprovedMemory.tsx +++ b/auto-kol/agent-memory-viewer/frontend/src/components/memories/ApprovedMemory.tsx @@ -159,15 +159,15 @@ export function ApprovedMemoryView({ memory }: Props) { - {memory.mentions && memory.mentions.length > 0 && ( + {(memory.mentions || memory.tweet?.thread) && ( <> Conversation Thread - {memory.mentions.map((mention) => ( + {(memory.tweet?.thread || memory.mentions)?.map((item) => ( - @{mention.author_username}:{' '} - {mention.text} + + @{item.author_username}: + {' '} + {item.text} - {new Date(mention.created_at).toLocaleString()} + {new Date(item.created_at).toLocaleString()} ))} diff --git a/auto-kol/agent-memory-viewer/frontend/src/components/memories/SkippedMemory.tsx b/auto-kol/agent-memory-viewer/frontend/src/components/memories/SkippedMemory.tsx index 2d0c8be..93106a1 100644 --- a/auto-kol/agent-memory-viewer/frontend/src/components/memories/SkippedMemory.tsx +++ b/auto-kol/agent-memory-viewer/frontend/src/components/memories/SkippedMemory.tsx @@ -95,15 +95,15 @@ export function SkippedMemoryView({ memory }: Props) { - {memory.mentions && memory.mentions.length > 0 && ( + {(memory.mentions || memory.tweet?.thread) && ( <> Conversation Thread - {memory.mentions.map((mention) => ( + {(memory.tweet?.thread || memory.mentions)?.map((item) => ( - @{mention.author_username}:{' '} - {mention.text} + + @{item.author_username}: + {' '} + {item.text} - {new Date(mention.created_at).toLocaleString()} + {new Date(item.created_at).toLocaleString()} ))} diff --git a/auto-kol/agent-memory-viewer/frontend/src/types/index.ts b/auto-kol/agent-memory-viewer/frontend/src/types/index.ts index b13c96e..50108ef 100644 --- a/auto-kol/agent-memory-viewer/frontend/src/types/index.ts +++ b/auto-kol/agent-memory-viewer/frontend/src/types/index.ts @@ -11,6 +11,7 @@ export interface Tweet { author_username: string; created_at: string; mention?: boolean; + thread?: Array; } export interface WorkflowDecision { @@ -45,6 +46,7 @@ export interface BaseMemory { author_id: string; author_username: string; created_at: string; + thread?: Array; }; previousCid: string | null; signature: string; From cca68867e457d3de4e18a1af3262b62bf118cac9 Mon Sep 17 00:00:00 2001 From: xm0onh Date: Tue, 24 Dec 2024 15:18:29 -0800 Subject: [PATCH 2/2] Update the conditions on showing the conv thread --- .../frontend/src/components/memories/ApprovedMemory.tsx | 2 +- .../frontend/src/components/memories/SkippedMemory.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/auto-kol/agent-memory-viewer/frontend/src/components/memories/ApprovedMemory.tsx b/auto-kol/agent-memory-viewer/frontend/src/components/memories/ApprovedMemory.tsx index d72024c..a275fc0 100644 --- a/auto-kol/agent-memory-viewer/frontend/src/components/memories/ApprovedMemory.tsx +++ b/auto-kol/agent-memory-viewer/frontend/src/components/memories/ApprovedMemory.tsx @@ -159,7 +159,7 @@ export function ApprovedMemoryView({ memory }: Props) { - {(memory.mentions || memory.tweet?.thread) && ( + {( (memory.mentions && memory.mentions.length > 0) || (memory.tweet?.thread && memory.tweet?.thread.length > 0)) && ( <> Conversation Thread diff --git a/auto-kol/agent-memory-viewer/frontend/src/components/memories/SkippedMemory.tsx b/auto-kol/agent-memory-viewer/frontend/src/components/memories/SkippedMemory.tsx index 93106a1..465bf1e 100644 --- a/auto-kol/agent-memory-viewer/frontend/src/components/memories/SkippedMemory.tsx +++ b/auto-kol/agent-memory-viewer/frontend/src/components/memories/SkippedMemory.tsx @@ -95,7 +95,7 @@ export function SkippedMemoryView({ memory }: Props) { - {(memory.mentions || memory.tweet?.thread) && ( + {( (memory.mentions && memory.mentions.length > 0) || (memory.tweet?.thread && memory.tweet?.thread.length > 0)) && ( <> Conversation Thread