enhanced ui

This commit is contained in:
Saifeddine ALOUI 2024-08-07 17:15:59 +02:00
parent 70d6fcb10c
commit 1aa5357213
11 changed files with 257 additions and 268 deletions

2
app.py
View File

@ -23,7 +23,7 @@ if not PackageManager.check_package_installed_with_version("pipmaster", expected
PackageManager.install_or_update("pipmaster")
ASCIIColors.success("OK")
expected_lollmsvectordb_version = "0.7.7"
expected_lollmsvectordb_version = "0.7.9"
ASCIIColors.yellow(f"Checking lollmsvectordb ({expected_lollmsvectordb_version}) ...", end="", flush=True)
if not PackageManager.check_package_installed_with_version("lollmsvectordb", expected_lollmsvectordb_version):
PackageManager.install_or_update("lollmsvectordb")

View File

@ -1,5 +1,5 @@
# =================== Lord Of Large Language Multimodal Systems Configuration file ===========================
version: 132
version: 133
binding_name: null
model_name: null
model_variant: null
@ -275,6 +275,8 @@ rag_activate_multi_hops: false #if true, we use multi hops algorithm to do multi
rag_min_nb_tokens_in_chunk: 10 #this removed any useless junk ith less than x tokens
rag_max_n_hops: 3 #We set the maximum number of hop in multi hops rag
rag_deactivate: false # if you have a large context model, you can activate this to use your document as a whole
contextual_summary: false #If activated this will completely replace the rag and instead will use contextual summary
activate_skills_lib: false # Activate vectorizing previous conversations

@ -1 +1 @@
Subproject commit f186a2cdc3443eb3e41cd62eecc1b30756b213dd
Subproject commit afad6aeb9215759dca7b9f892bff6f3555628118

File diff suppressed because one or more lines are too long

8
web/dist/assets/index-7142a84c.css vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

4
web/dist/index.html vendored
View File

@ -6,8 +6,8 @@
<script src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>LoLLMS WebUI</title>
<script type="module" crossorigin src="/assets/index-cd740302.js"></script>
<link rel="stylesheet" href="/assets/index-2e424166.css">
<script type="module" crossorigin src="/assets/index-92851a5b.js"></script>
<link rel="stylesheet" href="/assets/index-7142a84c.css">
</head>
<body>
<div id="app"></div>

View File

@ -1,29 +1,24 @@
<template>
<div v-if="isContentPresent">
<div class="collapsible-section cursor-pointer mb-4 font-bold hover:text-gray-900" @click="toggleCollapsible">
<span class="toggle-icon mr-1">
<i v-if="collapsed" class="fas fa-plus-circle text-gray-600"></i>
<i v-else class="fas fa-minus-circle text-gray-600"></i>
<div v-if="isContentPresent" class="json-viewer">
<div class="collapsible-section" @click="toggleCollapsible">
<span class="toggle-icon">
<i :class="collapsed ? 'fas fa-chevron-right' : 'fas fa-chevron-down'"></i>
</span>
{{ jsonFormText }}
</div>
<div v-show="!collapsed">
<div class="json-viewer max-h-64 overflow-auto p-4 bg-gray-100 border border-gray-300 rounded dark:bg-gray-600">
<template v-if="isObject">
<span @click="toggleCollapsed" class="toggle-icon cursor-pointer mr-1">
<i v-if="collapsed" class="fas fa-plus-circle text-gray-600"></i>
<i v-else class="fas fa-minus-circle text-gray-600"></i>
</span>
</template>
<pre v-html="formattedJson"></pre>
</div>
<div v-show="!collapsed" class="json-content">
<json-tree-view :data="parsedJsonData" :depth="0"></json-tree-view>
</div>
</div>
</template>
<script>
import JsonTreeView from './JsonTreeView.vue';
export default {
components: {
JsonTreeView
},
props: {
jsonData: {
type: [Object, Array, String],
@ -31,7 +26,7 @@ export default {
},
jsonFormText: {
type: String,
default: "JSON Form",
default: "JSON Viewer",
},
},
data() {
@ -40,83 +35,61 @@ export default {
};
},
computed: {
formattedJson() {
if (typeof this.jsonData==='string'){
let jsonData = JSON.stringify(JSON.parse(this.jsonData), null, '\t').replace(/\n/g, '<br>')
return jsonData;
}
else{
let jsonData = JSON.stringify(this.jsonData, null, '\t').replace(/\n/g, '<br>')
return jsonData;
}
},
isObject() {
return typeof this.jsonData === 'object' && this.jsonData !== null;
},
isContentPresent() {
return (
this.jsonData !== null &&
(typeof this.jsonData !== 'string' || this.jsonData.trim() !== '')
);
},
parsedJsonData() {
if (typeof this.jsonData === 'string') {
try {
return JSON.parse(this.jsonData);
} catch (error) {
console.error('Error parsing JSON string:', error);
return { error: 'Invalid JSON string' };
}
}
return this.jsonData;
}
},
methods: {
toggleCollapsed() {
this.collapsed = !this.collapsed;
},
toggleCollapsible() {
this.collapsed = !this.collapsed;
this.collapsed = !this.collapsed;
},
},
};
</script>
<style>
<style scoped>
.json-viewer {
font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
font-size: 14px;
line-height: 1.5;
color: #333;
}
.collapsible-section {
cursor: pointer;
margin-bottom: 10px;
font-weight: bold;
padding: 8px;
background-color: #f0f0f0;
border-radius: 4px;
display: flex;
align-items: center;
transition: background-color 0.2s;
}
.collapsible-section:hover {
color: #1a202c;
background-color: #e0e0e0;
}
.collapsible-section .toggle-icon {
margin-right: 0.25rem;
.toggle-icon {
margin-right: 8px;
transition: transform 0.2s;
}
.collapsible-section .toggle-icon i {
color: #4a5568;
.json-content {
margin-top: 8px;
padding-left: 16px;
}
.collapsible-section .toggle-icon i:hover {
color: #1a202c;
}
.json-viewer {
max-height: 300px;
max-width: 700px;
flex: auto;
overflow-y: auto;
padding: 10px;
background-color: #f1f1f1;
border: 1px solid #ccc;
border-radius: 4px;
}
.json-viewer .toggle-icon {
cursor: pointer;
margin-right: 0.25rem;
}
.json-viewer .toggle-icon i {
color: #4a5568;
}
.json-viewer .toggle-icon i:hover {
color: #1a202c;
}
</style>
</style>

View File

@ -267,7 +267,7 @@ export default {
async handleOpenFolder(pers){
const data = {
client_id:this.$store.state.client_id,
personality_folder: pers.personality.folder
personality_folder: pers.personality.category+"/"+pers.personality.folder
}
console.log(data)
await axios.post("/open_personality_folder",

View File

@ -1285,7 +1285,21 @@
class="w-5 mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"
>
</td>
</tr>
<tr>
<td style="min-width: 200px;">
<label for="rag_deactivate" class="text-sm font-bold" style="margin-right: 1rem;" title="Useful for very big contexts and global tasks that require the whole document">Use all the document content (No split):</label>
</td>
<td>
<input v-model="configFile.rag_deactivate"
type="checkbox"
@change="settingsChanged=true"
class="w-5 mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"
>
</td>
</tr>
</table>
</Card>

@ -1 +1 @@
Subproject commit 80e55fcd0413488588fe7a83623796378b07955c
Subproject commit 7334a772e06db329fed9d0f94cb5b361e16a1476