mirror of
https://github.com/ParisNeo/lollms-webui.git
synced 2024-12-24 06:36:37 +00:00
updated
This commit is contained in:
parent
7bc3507130
commit
03ca58ab0a
45
app.py
45
app.py
@ -106,6 +106,8 @@ class LoLLMsWebUI(LoLLMsAPPI):
|
|||||||
self.add_endpoint("/select_personality", "select_personality", self.select_personality, methods=["POST"])
|
self.add_endpoint("/select_personality", "select_personality", self.select_personality, methods=["POST"])
|
||||||
self.add_endpoint("/get_personality_settings", "get_personality_settings", self.get_personality_settings, methods=["POST"])
|
self.add_endpoint("/get_personality_settings", "get_personality_settings", self.get_personality_settings, methods=["POST"])
|
||||||
|
|
||||||
|
self.add_endpoint("/get_active_personality_settings", "get_active_personality_settings", self.get_active_personality_settings, methods=["GET"])
|
||||||
|
self.add_endpoint("/get_active_binding_settings", "get_active_binding_settings", self.get_active_binding_settings, methods=["GET"])
|
||||||
|
|
||||||
self.add_endpoint(
|
self.add_endpoint(
|
||||||
"/disk_usage", "disk_usage", self.disk_usage, methods=["GET"]
|
"/disk_usage", "disk_usage", self.disk_usage, methods=["GET"]
|
||||||
@ -877,6 +879,26 @@ class LoLLMsWebUI(LoLLMsAPPI):
|
|||||||
ASCIIColors.error(f"nok : Personality not found @ {language}/{category}/{name}")
|
ASCIIColors.error(f"nok : Personality not found @ {language}/{category}/{name}")
|
||||||
return jsonify({"status": False, "error":"Couldn't unmount personality"})
|
return jsonify({"status": False, "error":"Couldn't unmount personality"})
|
||||||
|
|
||||||
|
def get_active_personality_settings(self):
|
||||||
|
print("- Retreiving personality settings")
|
||||||
|
if self.personality.processor is not None:
|
||||||
|
if hasattr(self.personality.processor,"personality_config"):
|
||||||
|
return jsonify(self.personality.processor.personality_config.config_template.template)
|
||||||
|
else:
|
||||||
|
return jsonify({})
|
||||||
|
else:
|
||||||
|
return jsonify({})
|
||||||
|
|
||||||
|
def get_active_binding_settings(self):
|
||||||
|
print("- Retreiving binding settings")
|
||||||
|
if self.binding is not None:
|
||||||
|
if hasattr(self.binding,"binding_config"):
|
||||||
|
return jsonify(self.binding.binding_config.config_template.template)
|
||||||
|
else:
|
||||||
|
return jsonify({})
|
||||||
|
else:
|
||||||
|
return jsonify({})
|
||||||
|
|
||||||
def get_personality_settings(self):
|
def get_personality_settings(self):
|
||||||
print("- Retreiving personality settings")
|
print("- Retreiving personality settings")
|
||||||
try:
|
try:
|
||||||
@ -907,6 +929,29 @@ class LoLLMsWebUI(LoLLMsAPPI):
|
|||||||
else:
|
else:
|
||||||
return jsonify({})
|
return jsonify({})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def get_binding_settings(self):
|
||||||
|
print("- Retreiving personality settings")
|
||||||
|
try:
|
||||||
|
data = request.get_json()
|
||||||
|
# Further processing of the data
|
||||||
|
except Exception as e:
|
||||||
|
print(f"Error occurred while parsing JSON: {e}")
|
||||||
|
return
|
||||||
|
|
||||||
|
if personality.processor is not None:
|
||||||
|
if hasattr(personality.processor,"personality_config"):
|
||||||
|
return jsonify(personality.processor.personality_config.config_template.template)
|
||||||
|
else:
|
||||||
|
return jsonify({})
|
||||||
|
else:
|
||||||
|
return jsonify({})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def select_personality(self):
|
def select_personality(self):
|
||||||
|
|
||||||
data = request.get_json()
|
data = request.get_json()
|
||||||
|
@ -112,6 +112,18 @@ Content-Type: application/json
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
############################################
|
||||||
|
### Get active personality settings
|
||||||
|
############################################
|
||||||
|
GET http://localhost:9600/get_active_personality_settings
|
||||||
|
|
||||||
|
############################################
|
||||||
|
### Get active binding settings
|
||||||
|
############################################
|
||||||
|
GET http://localhost:9600/get_active_binding_settings
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
####@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
####@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
####@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
####@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
###
|
###
|
||||||
|
Loading…
Reference in New Issue
Block a user