mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-02 03:55:55 +00:00
fix(web): display document_name instead of file_id in retrieval results
The getTitle fallback order was reversed, always showing the UUID (file_id) since it's always truthy. Swap priority to document_name first. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -51,10 +51,10 @@ export default function KBRetrieveGeneric({
|
||||
if (getResultTitle) {
|
||||
return getResultTitle(result);
|
||||
}
|
||||
// Default: use file_id or document_name from metadata
|
||||
// Default: use document_name from metadata, fallback to file_id or id
|
||||
return (
|
||||
(result.metadata.file_id as string) ||
|
||||
(result.metadata.document_name as string) ||
|
||||
(result.metadata.file_id as string) ||
|
||||
result.id
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user