Skip to content

Commit

Permalink
feat(frontend): display chat origin
Browse files Browse the repository at this point in the history
  • Loading branch information
634750802 committed Sep 20, 2024
1 parent 363c1ac commit b99abeb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions frontend/app/src/api/chats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export interface Chat {
updated_at: Date;
created_at: Date;
id: string;
origin: string | null;
}

export interface ChatDetail {
Expand Down Expand Up @@ -61,6 +62,7 @@ export const chatSchema = z.object({
updated_at: zodJsonDate(),
created_at: zodJsonDate(),
id: z.string(),
origin: z.string().nullable(),
}) satisfies ZodType<Chat, any, any>;

const chatMessageSourceSchema = z.object({
Expand Down
1 change: 1 addition & 0 deletions frontend/app/src/components/chat/chats-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const columns = [
helper.accessor('title', {
cell: link({ url: chat => `/c/${chat.id}` }),
}),
helper.accessor('origin', {}),
helper.accessor('created_at', { cell: datetime }),
helper.accessor('engine_id', {}),
helper.accessor('engine_options', { cell: metadataCell }),
Expand Down
1 change: 1 addition & 0 deletions frontend/app/src/components/chat/debug-info.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export function DebugInfo ({ group }: DebugInfoProps) {
<section className="space-y-2">
<div className="space-y-2 text-sm">
<div className="space-y-2 text-sm">
<OptionDetail title="Origin" value={chat.origin} />
<OptionDetail title="Chat Created At" value={<DateFormat date={chat.created_at} />} />
<OptionDetail title="Message Created At" value={<DateFormat date={createdAt} />} />
<OptionDetail title="Message Finished In" value={(createdAt && finishedAt) && `${differenceInSeconds(finishedAt, createdAt)} seconds`} />
Expand Down

0 comments on commit b99abeb

Please sign in to comment.