Skip to content

Commit 954113e

Browse files
committed
update comments
1 parent 3b91e7b commit 954113e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

templates/types/streaming/nextjs/app/components/ui/chat/chat-message/markdown.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ export default function Markdown({
122122
);
123123
},
124124
a({ href, children }) {
125-
// If href starts with http://localhost:8000/api/files, render DocumentPreview
125+
// If href starts with `{backend}/api/files`, then it's a local document and we use DocumenInfo for rendering
126126
if (href?.startsWith(backend + "/api/files")) {
127127
return (
128128
<DocumentInfo

templates/types/streaming/nextjs/app/components/ui/chat/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,16 @@ export type DocumentFileType = "csv" | "pdf" | "txt" | "docx";
2323

2424
export type UploadedFileMeta = {
2525
id: string;
26-
name: string;
26+
name: string; // The uploaded file name in the backend (including uuid and sanitized)
2727
url?: string;
2828
refs?: string[];
2929
};
3030

3131
export type DocumentFile = {
32-
filename: string;
32+
filename: string; // The original file name
3333
filesize: number;
3434
filetype: DocumentFileType;
35-
metadata?: UploadedFileMeta;
35+
metadata?: UploadedFileMeta; // undefined when the file is not uploaded yet
3636
};
3737

3838
export type DocumentFileData = {

0 commit comments

Comments
 (0)