mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-04-08 11:58:34 +02:00
fix citation title (#1900)
* fix citation title * remove title function
This commit is contained in:
parent
17005fb705
commit
33332d08f2
@ -58,7 +58,6 @@ import { ValidSources } from "@/lib/types";
|
||||
import { Tooltip } from "@/components/tooltip/Tooltip";
|
||||
import { useMouseTracking } from "./hooks";
|
||||
import { InternetSearchIcon } from "@/components/InternetSearchIcon";
|
||||
import { getTitleFromDocument } from "@/lib/sources";
|
||||
|
||||
const TOOLS_WITH_CUSTOM_HANDLING = [
|
||||
SEARCH_TOOL_NAME,
|
||||
@ -445,7 +444,8 @@ export const AIMessage = ({
|
||||
>
|
||||
<Citation link={doc.link} index={ind + 1} />
|
||||
<p className="shrink truncate ellipsis break-all ">
|
||||
{getTitleFromDocument(doc)}
|
||||
{doc.semantic_identifier ||
|
||||
doc.document_id}
|
||||
</p>
|
||||
<div className="ml-auto flex-none">
|
||||
{doc.is_internet ? (
|
||||
|
@ -301,9 +301,3 @@ function stripTrailingSlash(str: string) {
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
export const getTitleFromDocument = (document: DanswerDocument) => {
|
||||
return stripTrailingSlash(document.document_id).split("/")[
|
||||
stripTrailingSlash(document.document_id).split("/").length - 1
|
||||
];
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user