mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-08-29 21:57:14 +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) {
|
if (getResultTitle) {
|
||||||
return getResultTitle(result);
|
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 (
|
return (
|
||||||
(result.metadata.file_id as string) ||
|
|
||||||
(result.metadata.document_name as string) ||
|
(result.metadata.document_name as string) ||
|
||||||
|
(result.metadata.file_id as string) ||
|
||||||
result.id
|
result.id
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user