mirror of
https://github.com/ParisNeo/lollms-webui.git
synced 2025-02-06 10:59:23 +00:00
added new endpoint to edit title
This commit is contained in:
parent
0c25ea4876
commit
fc07e3f68e
11
app.py
11
app.py
@ -108,6 +108,7 @@ class Gpt4AllWebUI(GPT4AllAPI):
|
|||||||
self.add_endpoint("/stop_gen", "stop_gen", self.stop_gen, methods=["GET"])
|
self.add_endpoint("/stop_gen", "stop_gen", self.stop_gen, methods=["GET"])
|
||||||
|
|
||||||
self.add_endpoint("/rename", "rename", self.rename, methods=["POST"])
|
self.add_endpoint("/rename", "rename", self.rename, methods=["POST"])
|
||||||
|
self.add_endpoint("/edit_title", "edit_title", self.edit_title, methods=["POST"])
|
||||||
self.add_endpoint(
|
self.add_endpoint(
|
||||||
"/load_discussion", "load_discussion", self.load_discussion, methods=["POST"]
|
"/load_discussion", "load_discussion", self.load_discussion, methods=["POST"]
|
||||||
)
|
)
|
||||||
@ -370,7 +371,15 @@ class Gpt4AllWebUI(GPT4AllAPI):
|
|||||||
title = data["title"]
|
title = data["title"]
|
||||||
self.current_discussion.rename(title)
|
self.current_discussion.rename(title)
|
||||||
return "renamed successfully"
|
return "renamed successfully"
|
||||||
|
|
||||||
|
def edit_title(self):
|
||||||
|
data = request.get_json()
|
||||||
|
title = data["title"]
|
||||||
|
discussion_id = data["id"]
|
||||||
|
self.current_discussion = Discussion(discussion_id, self.db)
|
||||||
|
self.current_discussion.rename(title)
|
||||||
|
return "title renamed successfully"
|
||||||
|
|
||||||
def load_discussion(self):
|
def load_discussion(self):
|
||||||
data = request.get_json()
|
data = request.get_json()
|
||||||
if "id" in data:
|
if "id" in data:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user