Skip to content

Commit 1bd4be1

Browse files
committed
the fix i promised: show which files was used per response
1 parent ac06d0a commit 1bd4be1

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

src/client/components/ChatV2/Conversation.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,10 +208,9 @@ const AssistantMessage = ({
208208
<Typography variant="body1" fontStyle="italic" color="#cc0000">{`\n\n ${error}`}</Typography>
209209
</Box>
210210
)}
211-
{/* {ragDisplay ? t('chat:hideSources') : t('chat:displaySources')} */}
212211
{fileSearchResult?.status === "completed" &&
213212
<OutlineButtonBlack sx={{ mt: 3 }} startIcon={<FormatQuoteIcon />} onClick={() => setActiveFileSearchResult(fileSearchResult)}>
214-
<Typography variant='body2'>Lähteet: <em>{fileSearchResult.id}</em></Typography>
213+
<Typography variant='body2'>{`${t('chat:displaySources')}: `}<em>{fileSearchResult.searchedFiles.join(', ')}</em></Typography>
215214
</OutlineButtonBlack>
216215
}
217216
</Box>

src/client/locales/en.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
"confirmResetChat": "Are you sure you want to empty this conversation?",
9191
"copyToClipboard": "Copy to clipboard",
9292
"sources": "Source materials",
93-
"displaySources": "Display sources"
93+
"displaySources": "Sources"
9494
},
9595
"settings": {
9696
"prompt": "Conversation prompt",

src/client/locales/fi.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,7 @@
9090
"confirmResetChat": "Oletko varma, että haluat tyhjentää tämän keskustelun?",
9191
"copyToClipboard": "Kopioi leikepöydälle",
9292
"sources": "Lähdemateriaali",
93-
"displaySources": "Näytä lähteet",
94-
"hideSources": "Piilota lähteet"
93+
"displaySources": "Lähteet"
9594
},
9695
"settings": {
9796
"prompt": "Keskustelun alustus",

src/client/locales/sv.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
"confirmResetChat": "Är du säker på att du vill avsluta den här konversationen?",
9898
"copyToClipboard": "Kopiera till urklipp",
9999
"sources": "Källmaterial",
100-
"displaySources": "Visa källor"
100+
"displaySources": "Källor"
101101
},
102102
"settings": {
103103
"prompt": "Samtalsstart",

src/server/util/azure/ResponsesAPI.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ export class ResponsesClient {
167167
queries: event.item.queries,
168168
status: event.item.status,
169169
type: event.item.type,
170+
searchedFiles: [...new Set(event.item.results?.map((result) => result.filename))], // Set() datastructure keeps each item unique
170171
ragIndexId: this.ragIndex.id,
171172
},
172173
},

src/shared/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ export type FileCitation = {
4848
}
4949

5050
export type FileSearchCompletedData = Omit<ResponseFileSearchToolCall, 'results'> & {
51+
searchedFiles: ResponseFileSearchToolCall.Result['filename'][]
5152
ragIndexId: number
5253
}
5354

0 commit comments

Comments
 (0)