Skip to content

Commit

Permalink
Chat Component Unit test cases in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
Kiran-Siluveru-Microsoft committed Oct 16, 2024
1 parent c62066b commit 3585760
Show file tree
Hide file tree
Showing 6 changed files with 591 additions and 255 deletions.
62 changes: 62 additions & 0 deletions code/frontend/__mocks__/SampleData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,3 +162,65 @@ export const citationObj = {

export const AIResponseContent =
"Microsoft AI refers to the artificial intelligence capabilities and offerings provided by Microsoft. It encompasses a range of technologies and solutions that leverage AI to empower individuals and organizations to achieve more. Microsoft's AI platform, Azure AI, enables organizations to transform their operations by bringing intelligence and insights to employees and customers. It offers AI-optimized infrastructure, advanced models, and AI services designed for developers and data scientists is an ";
export const chatHistoryListData = [
{
id: "conv_id_1",
title: "mocked conversation title 1",
date: "2024-10-16T07:02:16.238267",
updatedAt: "2024-10-16T07:02:18.470231",
messages: [
{
id: "785e393a-defc-4ef4-8c0a-27ad41631c76",
role: "user",
date: "2024-10-16T07:02:16.798628",
content: "Hi",
feedback: "",
},
{
id: "dfc65527-5bb5-48a8-aaa4-5fba74b67a85",
role: "tool",
date: "2024-10-16T07:02:17.609894",
content: '{"citations": [], "intent": "Hi"}',
feedback: "",
},
{
id: "18fd8f70-ec1c-42bc-93d2-765d52c184eb",
role: "assistant",
date: "2024-10-16T07:02:18.470231",
content: "Hello! How can I assist you today?",
feedback: "",
},
],
},
{
id: "conv_id_2",
title: "mocked conversation title 2",
date: "2024-10-16T07:02:16.238267",
updatedAt: "2024-10-16T07:02:18.470231",
messages: [],
},
];

export const historyReadAPIResponse = [
{
content: "Hi",
createdAt: "2024-10-16T07:02:16.798628",
feedback: "",
id: "785e393a-defc-4ef4-8c0a-27ad41631c76",
role: "user",
},
{
content: '{"citations": [], "intent": "Hi"}',
createdAt: "2024-10-16T07:02:17.609894",
feedback: "",
id: "dfc65527-5bb5-48a8-aaa4-5fba74b67a85",
role: "tool",
},
{
content: "Hello! How can I assist you today?",
createdAt: "2024-10-16T07:02:18.470231",
feedback: "",
id: "18fd8f70-ec1c-42bc-93d2-765d52c184eb",
role: "assistant",
},
];
2 changes: 1 addition & 1 deletion code/frontend/src/api/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export type Citation = {
title: string | null;
filepath: string | null;
url: string | null;
metadata: string | null;
metadata: string | null | Record<string, string| number>;
chunk_id: string | null | number;
reindex_id?: string | null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const commandBarStyle: ICommandBarStyles = {
},
};

type ChatHistoryPanelProps = {
export type ChatHistoryPanelProps = {
onShowContextualMenu: (ev: React.MouseEvent<HTMLElement>) => void;
showContextualMenu: boolean;
clearingError: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {

const [ASSISTANT, TOOL, ERROR, USER] = ["assistant", "tool", "error", "user"];

type ChatMessageContainerProps = {
export type ChatMessageContainerProps = {
fetchingConvMessages: boolean;
answers: ChatMessage[];
activeCardIndex: number | null;
Expand Down
Loading

0 comments on commit 3585760

Please sign in to comment.