This commit is contained in:
Saifeddine ALOUI 2025-02-16 02:08:41 +01:00
parent c107b8a9fd
commit a2f5630b50
14 changed files with 147 additions and 127 deletions

View File

@ -360,6 +360,8 @@ thinking_prompt: "Use a think first process to answer the user:
mounted_function_calls: []
# { name: the function name,
# author: the author of the function
# category: the category of the function
# value: the function name without spaces,
# selected: selected or not,
# icon: the icon in form feather:icon name or img:url or b64:base64,

@ -1 +1 @@
Subproject commit 3b377449e291902b4104d67b7380871f8b68e272
Subproject commit b5092844600cacb6c0e8fd724463ae56190e3687

View File

@ -78,7 +78,7 @@ def terminate_thread(thread):
lollms_webui_version = {
"version_main":18,
"version_secondary":0,
"version_type":"beta",
"version_type":"",
"version_codename":"Matrix 💊"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

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-DibwhpMS.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-heBS-Rej.css">
<script type="module" crossorigin src="/assets/index-DuP48K9W.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-PJ0LfNP6.css">
</head>
<body>
<div id="app"></div>

View File

@ -564,21 +564,22 @@ export default {
return formattedDataSources;
},
functionCalls(){
console.log("", this.$store.state.config.function_calls);
console.log("Function calls", this.$store.state.config.mounted_function_calls);
// Extract the names from the combined array and transform them into the desired format
const formattedDataSources = this.$store.state.config.function_calls.map(functionCall => {
const formattedFunctionCalls = this.$store.state.config.mounted_function_calls.map(functionCall => {
console.log("entry", functionCall);
return {
name: functionCall.name,
value: functionCall.value || 'default_value',
value: functionCall,
dir: functionCall.dir,
is_checked: functionCall.selected,
icon: functionCall.icon,
help: functionCall.help
};
});
console.log("formatted datalake", formattedDataSources);
return formattedDataSources;
console.log("formatted function calls", formattedFunctionCalls);
return formattedFunctionCalls;
}
},
@ -829,10 +830,14 @@ export default {
console.log("Refreshed")
},
async toggleFunctionCall(cmd){
async toggleFunctionCall(func){
console.log("function call:")
console.log(cmd)
await axios.post('/toggle_mount_rag_database', {"client_id":this.$store.state.client_id,"datalake_name":cmd})
console.log(func)
await axios.post('/toggle_function_call', {
client_id: this.$store.state.client_id,
name: func.name,
dir: func.dir
})
await this.$store.dispatch('refreshConfig');
console.log("Refreshed")

View File

@ -74,7 +74,7 @@
import { nextTick } from "vue";
import feather from "feather-icons";
import { marked } from "marked"; // Correct import for marked
import botImgPlaceholder from "../assets/logo.svg";
import botImgPlaceholder from "../assets/logo.png";
import userImgPlaceholder from "../assets/default_user.svg";
import InteractiveMenu from "@/components/InteractiveMenu.vue";

View File

@ -2759,6 +2759,7 @@ export default {
scrollBottom(el) {
if (el) {
console.log("Scrolling to bottom")
el.scrollTo(
{
top: el.scrollHeight,
@ -2801,8 +2802,9 @@ export default {
this.discussionArr.push(usrMessage)
nextTick(() => {
const msgList = document.getElementById('messages-list')
this.scrollBottom(msgList)
if(msgList.length>0){
this.scrollBottom(msgList)
}
})
},
@ -3825,7 +3827,6 @@ export default {
this.$store.state.news = this.$refs.news
this.$store.state.personality_editor = this.$refs.personality_editor
this.checkChangelogUpdate()
window.addEventListener('resize', this.adjustMenuPosition);
socket.on('refresh_files',()=>{

View File

@ -54,14 +54,14 @@
<span class="text-xl text-gray-700 font-semibold">Loading...</span>
</div>
<div v-else>
<div class="container mx-auto px-4 flex flex-column pb-20">
<div class="container mx-auto px-4 flex flex-col pb-20">
<!-- Favorite Apps Section -->
<div v-if="favoriteApps.length > 0 && !searchQuery">
<h2 class="text-2xl font-bold my-8">Favorite Apps</h2>
<div v-if="favoritePersonalities.length > 0 && !searchQuery">
<h2 class="text-2xl font-bold my-8">Favorite Personalities</h2>
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-8 mb-12">
<personality-entry
ref="personalitiesZoo"
v-for="pers in favoriteApps"
v-for="pers in favoritePersonalities"
:key="pers.uid"
:personality="pers"
:select_language="true"
@ -83,7 +83,7 @@
</div>
</div>
</div>
<div class="container mx-auto px-4 flex flex-column pb-20">
<div class="container mx-auto px-4 flex flex-col pb-20">
<!-- Current Category Section -->
<h2 class="text-2xl font-bold my-8">{{ currentCategoryName }} ({{ sortedAndFilteredPersonalities.length }})</h2>
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-8 mb-12">
@ -106,7 +106,7 @@
:on-copy-personality-name="onCopyPersonalityName"
:on-copy-to_custom="onCopyToCustom"
:on-open-folder="handleOpenFolder"
:toggle-favorite="toggleFavorite"
:on-toggle-favorite="toggleFavorite"
/>
</div>
</div>
@ -220,7 +220,7 @@ export default {
});
},
favoriteApps() {
favoritePersonalities() {
return this.combinedApps.filter(app => this.favorites.includes(app.uid));
},
},

View File

@ -4499,15 +4499,14 @@
:class="fzl_collapsed ? '' : 'max-h-96'">
<TransitionGroup name="bounce">
<function-entry ref="functionsZoo" v-for="(func, index) in functionsFiltered"
:key="'index-' + index + '-' + func.name" :function="func"
:key="'index-' + index + '-' + func.name"
:function_call="func"
:on-mount="mountFunction"
:on-unmount="unmountFunction"
:on-remount="remountFunction"
:on-edit="editFunction"
:on-copy-to-custom="copyToCustom"
:on-reinstall="onFunctionReinstall"
:on-settings="onSettingsFunction"
:on-toggle-favorite="toggleFavorite" />
/>
</TransitionGroup>
</div>
</div>
@ -4854,6 +4853,7 @@ import { nextTick } from 'vue'
import ModelEntry from '@/components/ModelEntry.vue';
import PersonalityViewer from '@/components/PersonalityViewer.vue';
import PersonalityEntry from "@/components/PersonalityEntry.vue";
import FunctionEntry from "@/components/FunctionEntry.vue";
import BindingEntry from "../components/BindingEntry.vue";
import socket from '@/services/websocket.js'
import defaultModelImgPlaceholder from "../assets/default_model.png"
@ -4884,6 +4884,7 @@ export default {
// eslint-disable-next-line vue/no-unused-components
PersonalityViewer,
PersonalityEntry,
FunctionEntry,
BindingEntry,
ChoiceDialog,
Card,
@ -5059,11 +5060,15 @@ export default {
// Extract unique categories
const categories = new Set(this.allFunctions.map(func => func.category));
this.funcCatgArr = Array.from(categories);
console.log("funcCatgArr: ");
console.log(this.funcCatgArr)
// Set the default category to the first one found
if (this.funcCatgArr.length > 0) {
this.function_category = this.funcCatgArr[0];
this.function_category = this.funcCatgArr[0];
}
console.log("function_category: ")
console.log(this.function_category )
// Filter functions based on the default category
this.updateFilteredFunctions();
@ -5072,10 +5077,13 @@ export default {
}
},
updateFilteredFunctions() {
// Filter functions based on the selected category
this.functionsFiltered = this.allFunctions.filter(
func => func.category === this.function_category
);
// Filter functions based on the selected category
this.functionsFiltered = this.allFunctions.filter(
func => func.category === this.function_category
);
console.log("functionsFiltered: ");
console.log(this.functionsFiltered );
},
// Toggle favorite function
toggleFavorite(funcUid) {
@ -5091,16 +5099,16 @@ export default {
// Mount a function
async mountFunction(func) {
try {
const response = await axios.post('/mount_function', {
client_id: this.$store.state.client_id,
function_name: func.name,
});
if (response.data.status) {
this.showMessage('Function mounted successfully', true);
this.$store.dispatch('refreshMountedFunctions');
} else {
this.showMessage('Failed to mount function', false);
}
const response = await axios.post('/mount_function_call', {
client_id: this.$store.state.client_id,
function_category: func.category,
function_name: func.name,
});
if (response.data.status) {
this.showMessage('Function mounted successfully', true);
} else {
this.showMessage('Failed to mount function', false);
}
} catch (error) {
this.showMessage('Error mounting function', false);
console.error(error);
@ -5110,15 +5118,19 @@ export default {
// Unmount a function
async unmountFunction(func) {
try {
console.log("Unmounting function")
const response = await axios.post('/unmount_function', {
client_id: this.$store.state.client_id,
function_name: func.name,
});
if (response.data.status) {
this.showMessage('Function unmounted successfully', true);
this.$store.dispatch('refreshMountedFunctions');
await this.$store.dispatch('refreshConfig');
this.$store.state.toast.show('Function mounted successfully!', 4, true)
this.$store.state.messageBox.showMessage('Function unmounted successfully', true);
func.mounted = true
} else {
this.showMessage('Failed to unmount function', false);
this.$store.state.toast.show('Failed to unmount function', 4, false)
this.$store.state.messageBox.showMessage('Failed to unmount function', false);
}
} catch (error) {
this.showMessage('Error unmounting function', false);

@ -1 +1 @@
Subproject commit 3bf7e88bcff16adcc7fd8addb569266676feab17
Subproject commit 98f44bef458ca6725facdec46ac24b27be48df14

@ -1 +1 @@
Subproject commit c039a33c15eb332abb93d8fe52fdc649435abf13
Subproject commit e46da524e83e54409ef3e89137b40814bd081244