Skip to content

Commit

Permalink
Merge pull request #87 from autonomys/refactor/thread-type-memory-viewer
Browse files Browse the repository at this point in the history
support new type for conv thread
  • Loading branch information
Xm0onh authored Dec 25, 2024
2 parents 3b320a0 + 620b46a commit 85ad4d3
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,27 +159,29 @@ export function ApprovedMemoryView({ memory }: Props) {
</Text>
</VStack>

{memory.mentions && memory.mentions.length > 0 && (
{( (memory.mentions && memory.mentions.length > 0) || (memory.tweet?.thread && memory.tweet?.thread.length > 0)) && (
<>
<Text fontSize="md" fontWeight="bold" color="purple.400" mb={2}>
Conversation Thread
</Text>
<VStack align="stretch" mb={4} pl={4}>
{memory.mentions.map((mention) => (
{(memory.tweet?.thread || memory.mentions)?.map((item) => (
<VStack
key={mention.id}
key={item.id}
p={2}
border="1px solid"
borderColor="gray.600"
borderRadius="md"
align="stretch"
>
<Text>
<Text as="span" color="gray.400">@{mention.author_username}:</Text>{' '}
<Text as="span" color="white">{mention.text}</Text>
<Text as="span" color="gray.400">
@{item.author_username}:
</Text>{' '}
<Text as="span" color="white">{item.text}</Text>
</Text>
<Text fontSize="sm" color="gray.400">
{new Date(mention.created_at).toLocaleString()}
{new Date(item.created_at).toLocaleString()}
</Text>
</VStack>
))}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,27 +95,29 @@ export function SkippedMemoryView({ memory }: Props) {
</Text>
</VStack>

{memory.mentions && memory.mentions.length > 0 && (
{( (memory.mentions && memory.mentions.length > 0) || (memory.tweet?.thread && memory.tweet?.thread.length > 0)) && (
<>
<Text fontSize="md" fontWeight="bold" color="purple.400" mb={2}>
Conversation Thread
</Text>
<VStack align="stretch" mb={4} pl={4}>
{memory.mentions.map((mention) => (
{(memory.tweet?.thread || memory.mentions)?.map((item) => (
<VStack
key={mention.id}
key={item.id}
p={2}
border="1px solid"
borderColor="gray.600"
borderRadius="md"
align="stretch"
>
<Text>
<Text as="span" color="gray.400">@{mention.author_username}:</Text>{' '}
<Text as="span" color="white">{mention.text}</Text>
<Text as="span" color="gray.400">
@{item.author_username}:
</Text>{' '}
<Text as="span" color="white">{item.text}</Text>
</Text>
<Text fontSize="sm" color="gray.400">
{new Date(mention.created_at).toLocaleString()}
{new Date(item.created_at).toLocaleString()}
</Text>
</VStack>
))}
Expand Down
2 changes: 2 additions & 0 deletions auto-kol/agent-memory-viewer/frontend/src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export interface Tweet {
author_username: string;
created_at: string;
mention?: boolean;
thread?: Array<Tweet>;
}

export interface WorkflowDecision {
Expand Down Expand Up @@ -45,6 +46,7 @@ export interface BaseMemory {
author_id: string;
author_username: string;
created_at: string;
thread?: Array<Tweet>;
};
previousCid: string | null;
signature: string;
Expand Down

0 comments on commit 85ad4d3

Please sign in to comment.