diff --git a/application/retriever/classic_rag.py b/application/retriever/classic_rag.py index 3eb0f20..2b77db3 100644 --- a/application/retriever/classic_rag.py +++ b/application/retriever/classic_rag.py @@ -69,6 +69,11 @@ class ClassicRAG(BaseRetriever): else i.page_content ), "text": i.page_content, + "source": ( + i.metadata.get("source") + if i.metadata.get("source") + else "local" + ), } for i in docs_temp ] diff --git a/frontend/src/conversation/ConversationBubble.tsx b/frontend/src/conversation/ConversationBubble.tsx index 9877db6..aa9c4e3 100644 --- a/frontend/src/conversation/ConversationBubble.tsx +++ b/frontend/src/conversation/ConversationBubble.tsx @@ -22,7 +22,7 @@ const ConversationBubble = forwardRef< className?: string; feedback?: FEEDBACK; handleFeedback?: (feedback: FEEDBACK) => void; - sources?: { title: string; text: string }[]; + sources?: { title: string; text: string; source: string }[]; } >(function ConversationBubble( { message, type, className, feedback, handleFeedback, sources }, @@ -177,7 +177,13 @@ const ConversationBubble = forwardRef< : 'bg-[#D7EBFD] hover:bg-[#BFE1FF]' }`} onClick={() => - setOpenSource(openSource === index ? null : index) + source.source !== 'local' + ? window.open( + source.source, + '_blank', + 'noopener, noreferrer', + ) + : setOpenSource(openSource === index ? null : index) } >

{ ]; const chunks = ['0', '2', '4', '6', '8', '10']; const token_limits = new Map([ - [0, 'None'], - [100, 'Low'], - [1000, 'Medium'], - [2000, 'Default'], - [4000, 'High'], - [1e9, 'Unlimited'], + [0, t('settings.general.none')], + [100, t('settings.general.low')], + [1000, t('settings.general.medium')], + [2000, t('settings.general.default')], + [4000, t('settings.general.high')], + [1e9, t('settings.general.unlimited')], ]); const [prompts, setPrompts] = React.useState< { name: string; id: string; type: string }[] @@ -126,7 +126,7 @@ const General: React.FC = () => {

- Conversational history + {t('settings.general.convHistory')}

({