File tree 3 files changed +12
-4
lines changed
components/frontend_react/webapp/src
3 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ const References: React.FC<ReferencesProps> = ({ references }) => {
26
26
const map = new Map < string , T > ( )
27
27
items . forEach ( item => {
28
28
const key : string = String ( item [ dedupKey ] )
29
- map . set ( key , item )
29
+ map . set ( key , item )
30
30
} )
31
31
return Array . from ( map . values ( ) )
32
32
}
@@ -37,6 +37,8 @@ const References: React.FC<ReferencesProps> = ({ references }) => {
37
37
. replace ( "/b/" , "https://storage.googleapis.com/" )
38
38
. replace ( "/o/" , "/" )
39
39
}
40
+ if ( url . startsWith ( "gs://" ) )
41
+ return url . replace ( "gs://" , "https://storage.googleapis.com/" )
40
42
return url
41
43
}
42
44
@@ -91,7 +93,12 @@ const References: React.FC<ReferencesProps> = ({ references }) => {
91
93
className = "text-info hover:text-info-content break-all transition-colors mr-1.5" >
92
94
{ renderLinkTitle ( ref . document_url ) } :
93
95
</ a >
94
- < Markdown children = { truncateText ( ref . document_text ) } rehypePlugins = { [ rehypeRaw ] } />
96
+ { ref ?. modality === "image" ?
97
+ < img src = { renderCloudStorageUrl ( ref . chunk_url ) } /> :
98
+ // if the modality is not image assume it is text to handle
99
+ // legacy query engines that didn't set a modality
100
+ < Markdown children = { truncateText ( ref . document_text ) } rehypePlugins = { [ rehypeRaw ] } />
101
+ }
95
102
</ span >
96
103
< div className = { index < uniqueReferences . length - 1 ? "mx-2 pt-3 border-b" : "" } />
97
104
</ div >
Original file line number Diff line number Diff line change @@ -185,7 +185,6 @@ const QueryEngineEdit: React.FC<IQueryEngineProps> = ({ token }) => {
185
185
useEffect ( ( ) => {
186
186
const updateEngineEmbeddings = async ( ) => {
187
187
const llmTypes = await ( await fetchEmbeddingTypes ( token , createEngineIsMultimodal ) ) ( )
188
- console . log ( llmTypes )
189
188
if ( llmTypes === null || llmTypes === undefined ) console . error ( "Failed to retrieve embedding types" )
190
189
else setCreateEngineEmbeddingOptions ( llmTypes . map ( ( embedding ) => { return { option : embedding , value : embedding } } ) )
191
190
}
Original file line number Diff line number Diff line change @@ -105,8 +105,10 @@ export interface QueryResponse {
105
105
106
106
export interface QueryReferences {
107
107
chunk_id : string
108
+ chunk_url : string
108
109
document_url : string
109
110
document_text : string
111
+ modality : string
110
112
}
111
113
112
114
export type QueryContents = {
@@ -243,5 +245,5 @@ export type QueryEngineBuildJob = {
243
245
output_gcs_path : any
244
246
errors : any
245
247
job_logs : any
246
- metadata : any
248
+ metadata : any
247
249
}
You can’t perform that action at this time.
0 commit comments