added similarity for vector databses

This commit is contained in:
Saifeddine ALOUI 2024-12-15 19:01:47 +01:00
parent a4fc04060b
commit db85d91ca8

View File

@ -1386,7 +1386,7 @@ class LOLLMSWebUI(LOLLMSElfServer):
similarity = source["similarity"]
sources_text += f'''
<div class="source-item">
<button onclick="var details = document.getElementById('source-details-{title}'); details.style.display = details.style.display === 'none' ? 'block' : 'none';" style="text-align: left; font-weight: bold;"><strong>{title}</strong></button>
<button onclick="var details = document.getElementById('source-details-{title}'); details.style.display = details.style.display === 'none' ? 'block' : 'none';" style="text-align: left; font-weight: bold;"><strong>{title}</strong> - ({similarity*100:.2f}%)</button>
<div id="source-details-{title}" style="display:none;">
<div style="max-height: 200px; overflow-y: auto;">
<p><strong>Path:</strong> {path}</p>