Skip to content

Commit

Permalink
push everything
Browse files Browse the repository at this point in the history
  • Loading branch information
ydamit committed Oct 21, 2024
1 parent c0a80b7 commit c9bd596
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/app/[rc_id]/conversations/[conv_id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default async function ChatServerPage({ params }: { params: { rc_id: stri

const researchContextsDTOs = listResearchContextsDTO.data;
const researchContextIDs = researchContextsDTOs.map((rcDTO) => rcDTO.success ? rcDTO.data.id : -1);
if (!researchContextIDs.includes(researchContextID)) {
if (!researchContextIDs.includes(researchContextID)) {
notFound();
}

Expand Down
6 changes: 3 additions & 3 deletions src/app/_components/chat-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,10 @@ export function ChatClientPage(props: { listMessagesViewModel: TListMessagesForC
<ChatPage
messages={listMessagesViewModel.messages.map((message) => {
return {
role: message.senderType,
content: message.content,
role: message.sender_type,
message_contents: message.message_contents,
type: "text", // TODO: fix this after KP has been refactored
timestamp: Number(message.timestamp),
timestamp: Number(message.created_at),
isLoading: false,
};
})}
Expand Down
3 changes: 2 additions & 1 deletion src/lib/core/entity/kernel-models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ export const MessageSchema = z.object({
id: z.number(),
message_contents: z.array(BaseMessageContentSchema),
sender: z.string(),
senderType: z.union([z.literal("user"), z.literal("agent")]),
sender_type: z.union([z.literal("user"), z.literal("agent")]),
created_at: z.string().optional(),
});

export type TMessage = z.infer<typeof MessageSchema>;
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default class BrowserSendMessageToConversationUseCase implements SendMess
content: request.messageToSendContent,
sender: "", // TODO: this should be obtained from the auth gateway at some point
timestamp: request.messageToSendTimestamp,
senderType: "user"
sender_type: "user"
};

// TODO: finish secondary side, then come back here
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,15 +172,15 @@ export default class KernelConversationGateway implements ConversationGatewayOut
id: createMessageViewModel.message_id,
message_contents: message.message_contents,
sender: message.sender,
senderType: message.senderType,
sender_type: message.sender_type,
},
type: "success",
conversationID: conversationID,
response: { // TODO: this shouldn't be needed here, so is doing this OK?
id: -1,
message_contents: message.message_contents,
sender: message.sender,
senderType: message.senderType,
sender_type: message.sender_type,
}
},
};
Expand Down Expand Up @@ -228,7 +228,8 @@ export default class KernelConversationGateway implements ConversationGatewayOut
id: kpMessage.id,
message_contents: kpMessage.message_contents,
sender: kpMessage.sender,
senderType: kpMessage.sender_type,
sender_type: kpMessage.sender_type,
created_at: kpMessage.created_at,
};
});

Expand Down

0 comments on commit c9bd596

Please sign in to comment.