mirror of
https://github.com/ParisNeo/lollms-webui.git
synced 2024-12-20 04:47:55 +00:00
updated endpoints
This commit is contained in:
parent
bb896a4717
commit
46a4f5e0d6
25
app.py
25
app.py
@ -109,6 +109,9 @@ class LoLLMsWebUI(LoLLMsAPPI):
|
|||||||
self.add_endpoint("/get_active_personality_settings", "get_active_personality_settings", self.get_active_personality_settings, methods=["GET"])
|
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("/get_active_binding_settings", "get_active_binding_settings", self.get_active_binding_settings, methods=["GET"])
|
||||||
|
|
||||||
|
self.add_endpoint("/set_active_personality_settings", "set_active_personality_settings", self.set_active_personality_settings, methods=["POST"])
|
||||||
|
self.add_endpoint("/set_active_binding_settings", "set_active_binding_settings", self.set_active_binding_settings, methods=["POST"])
|
||||||
|
|
||||||
self.add_endpoint(
|
self.add_endpoint(
|
||||||
"/disk_usage", "disk_usage", self.disk_usage, methods=["GET"]
|
"/disk_usage", "disk_usage", self.disk_usage, methods=["GET"]
|
||||||
)
|
)
|
||||||
@ -912,11 +915,11 @@ class LoLLMsWebUI(LoLLMsAPPI):
|
|||||||
if self.personality.processor is not None:
|
if self.personality.processor is not None:
|
||||||
if hasattr(self.personality.processor,"personality_config"):
|
if hasattr(self.personality.processor,"personality_config"):
|
||||||
self.personality.processor.personality_config.update_template(data)
|
self.personality.processor.personality_config.update_template(data)
|
||||||
return jsonify()
|
return jsonify({'status':True})
|
||||||
else:
|
else:
|
||||||
return jsonify({'status':False})
|
return jsonify({'status':False})
|
||||||
else:
|
else:
|
||||||
return jsonify({})
|
return jsonify({'status':False})
|
||||||
|
|
||||||
def get_active_binding_settings(self):
|
def get_active_binding_settings(self):
|
||||||
print("- Retreiving binding settings")
|
print("- Retreiving binding settings")
|
||||||
@ -928,6 +931,24 @@ class LoLLMsWebUI(LoLLMsAPPI):
|
|||||||
else:
|
else:
|
||||||
return jsonify({})
|
return jsonify({})
|
||||||
|
|
||||||
|
def set_active_binding_settings(self):
|
||||||
|
print("- Setting binding 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 self.binding is not None:
|
||||||
|
if hasattr(self.binding,"binding_config"):
|
||||||
|
self.binding.binding_config.update_template(data)
|
||||||
|
return jsonify({'status':True})
|
||||||
|
else:
|
||||||
|
return jsonify({'status':False})
|
||||||
|
else:
|
||||||
|
return jsonify({'status':False})
|
||||||
|
|
||||||
|
|
||||||
def get_personality_settings(self):
|
def get_personality_settings(self):
|
||||||
print("- Retreiving personality settings")
|
print("- Retreiving personality settings")
|
||||||
|
Loading…
Reference in New Issue
Block a user