File tree 2 files changed +4
-4
lines changed
templates/types/streaming/nextjs/app/components/ui/chat
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -122,7 +122,7 @@ export default function Markdown({
122
122
) ;
123
123
} ,
124
124
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
126
126
if ( href ?. startsWith ( backend + "/api/files" ) ) {
127
127
return (
128
128
< DocumentInfo
Original file line number Diff line number Diff line change @@ -23,16 +23,16 @@ export type DocumentFileType = "csv" | "pdf" | "txt" | "docx";
23
23
24
24
export type UploadedFileMeta = {
25
25
id : string ;
26
- name : string ;
26
+ name : string ; // The uploaded file name in the backend (including uuid and sanitized)
27
27
url ?: string ;
28
28
refs ?: string [ ] ;
29
29
} ;
30
30
31
31
export type DocumentFile = {
32
- filename : string ;
32
+ filename : string ; // The original file name
33
33
filesize : number ;
34
34
filetype : DocumentFileType ;
35
- metadata ?: UploadedFileMeta ;
35
+ metadata ?: UploadedFileMeta ; // undefined when the file is not uploaded yet
36
36
} ;
37
37
38
38
export type DocumentFileData = {
You can’t perform that action at this time.
0 commit comments