Merge branch 'arc53:main' into main

This commit is contained in:
Digvijay Shelar 2024-05-30 18:22:56 +05:30 committed by GitHub
commit dcc475bbef
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 38 additions and 13 deletions

View File

@ -69,6 +69,11 @@ class ClassicRAG(BaseRetriever):
else i.page_content else i.page_content
), ),
"text": i.page_content, "text": i.page_content,
"source": (
i.metadata.get("source")
if i.metadata.get("source")
else "local"
),
} }
for i in docs_temp for i in docs_temp
] ]

View File

@ -22,7 +22,7 @@ const ConversationBubble = forwardRef<
className?: string; className?: string;
feedback?: FEEDBACK; feedback?: FEEDBACK;
handleFeedback?: (feedback: FEEDBACK) => void; handleFeedback?: (feedback: FEEDBACK) => void;
sources?: { title: string; text: string }[]; sources?: { title: string; text: string; source: string }[];
} }
>(function ConversationBubble( >(function ConversationBubble(
{ message, type, className, feedback, handleFeedback, sources }, { message, type, className, feedback, handleFeedback, sources },
@ -177,7 +177,13 @@ const ConversationBubble = forwardRef<
: 'bg-[#D7EBFD] hover:bg-[#BFE1FF]' : 'bg-[#D7EBFD] hover:bg-[#BFE1FF]'
}`} }`}
onClick={() => onClick={() =>
setOpenSource(openSource === index ? null : index) source.source !== 'local'
? window.open(
source.source,
'_blank',
'noopener, noreferrer',
)
: setOpenSource(openSource === index ? null : index)
} }
> >
<p <p

View File

@ -17,7 +17,7 @@ export interface Answer {
answer: string; answer: string;
query: string; query: string;
result: string; result: string;
sources: { title: string; text: string }[]; sources: { title: string; text: string; source: string }[];
conversationId: string | null; conversationId: string | null;
title: string | null; title: string | null;
} }
@ -27,7 +27,7 @@ export interface Query {
response?: string; response?: string;
feedback?: FEEDBACK; feedback?: FEEDBACK;
error?: string; error?: string;
sources?: { title: string; text: string }[]; sources?: { title: string; text: string; source: string }[];
conversationId?: string | null; conversationId?: string | null;
title?: string | null; title?: string | null;
} }

View File

@ -40,7 +40,14 @@
"prompt": "Active Prompt", "prompt": "Active Prompt",
"deleteAllLabel": "Delete all Conversation", "deleteAllLabel": "Delete all Conversation",
"deleteAllBtn": "Delete all", "deleteAllBtn": "Delete all",
"addNew": "Add New" "addNew": "Add New",
"convHistory":"Conversational history",
"none":"None",
"low":"Low",
"medium":"Medium",
"high":"High",
"unlimited":"Unlimited",
"default":"default"
}, },
"documents": { "documents": {
"label": "Documents", "label": "Documents",

View File

@ -40,7 +40,14 @@
"prompt": "Prompt Activo", "prompt": "Prompt Activo",
"deleteAllLabel": "Eliminar toda la Conversación", "deleteAllLabel": "Eliminar toda la Conversación",
"deleteAllBtn": "Eliminar todo", "deleteAllBtn": "Eliminar todo",
"addNew": "Agregar Nuevo" "addNew": "Agregar Nuevo",
"convHistory":"Historia conversacional",
"none":"ninguno",
"low":"Bajo",
"medium":"Medio",
"high":"Alto",
"unlimited":"Ilimitado",
"default":"predeterminada"
}, },
"documents": { "documents": {
"label": "Documentos", "label": "Documentos",

View File

@ -35,12 +35,12 @@ const General: React.FC = () => {
]; ];
const chunks = ['0', '2', '4', '6', '8', '10']; const chunks = ['0', '2', '4', '6', '8', '10'];
const token_limits = new Map([ const token_limits = new Map([
[0, 'None'], [0, t('settings.general.none')],
[100, 'Low'], [100, t('settings.general.low')],
[1000, 'Medium'], [1000, t('settings.general.medium')],
[2000, 'Default'], [2000, t('settings.general.default')],
[4000, 'High'], [4000, t('settings.general.high')],
[1e9, 'Unlimited'], [1e9, t('settings.general.unlimited')],
]); ]);
const [prompts, setPrompts] = React.useState< const [prompts, setPrompts] = React.useState<
{ name: string; id: string; type: string }[] { name: string; id: string; type: string }[]
@ -126,7 +126,7 @@ const General: React.FC = () => {
</div> </div>
<div className="mb-5"> <div className="mb-5">
<p className="mb-2 font-bold text-jet dark:text-bright-gray"> <p className="mb-2 font-bold text-jet dark:text-bright-gray">
Conversational history {t('settings.general.convHistory')}
</p> </p>
<Dropdown <Dropdown
options={Array.from(token_limits, ([value, desc]) => ({ options={Array.from(token_limits, ([value, desc]) => ({