mirror of
https://github.com/KoboldAI/KoboldAI-Client.git
synced 2025-06-05 21:59:24 +02:00
Merge branch 'UI2' of https://github.com/ebolam/KoboldAI into UI2
This commit is contained in:
34
aiserver.py
34
aiserver.py
@@ -6089,13 +6089,13 @@ def generate(txt, minimum, maximum, found_entries=None):
|
||||
# Deal with a single return sequence from generate()
|
||||
#==================================================================#
|
||||
def genresult(genout, flash=True, ignore_formatting=False):
|
||||
if not koboldai_vars.quiet:
|
||||
logger.generation(genout.encode("unicode_escape").decode("utf-8"))
|
||||
|
||||
# Format output before continuing
|
||||
if not ignore_formatting:
|
||||
genout = applyoutputformatting(genout)
|
||||
|
||||
if not koboldai_vars.quiet:
|
||||
logger.generation(genout.encode("unicode_escape").decode("utf-8"))
|
||||
|
||||
koboldai_vars.lua_koboldbridge.feedback = genout
|
||||
|
||||
if(len(genout) == 0):
|
||||
@@ -8660,7 +8660,7 @@ def UI_2_edit_world_info(data):
|
||||
koboldai_vars.worldinfo_v2.edit_item(data['uid'], data['title'], data['key'],
|
||||
data['keysecondary'], data['folder'],
|
||||
data['constant'], data['manual_text'],
|
||||
data['comment'], wpp=data['wpp'], use_wpp=data['use_wpp'])
|
||||
data['comment'], wi_type=data["type"], wpp=data['wpp'], use_wpp=data['use_wpp'])
|
||||
|
||||
|
||||
#==================================================================#
|
||||
@@ -8796,6 +8796,32 @@ def UI_2_update_wi_keys(data):
|
||||
# Send to UI
|
||||
socketio.emit("world_info_entry", koboldai_vars.worldinfo_v2.world_info[uid], broadcast=True, room="UI_2")
|
||||
|
||||
@app.route("/set_wi_image/<int(signed=True):uid>", methods=["POST"])
|
||||
@logger.catch
|
||||
def UI_2_set_wi_image(uid):
|
||||
if uid < 0:
|
||||
socketio.emit("delete_new_world_info_entry", {})
|
||||
uid = koboldai_vars.worldinfo_v2.add_item(
|
||||
"New World Info Entry",
|
||||
[],
|
||||
[],
|
||||
None,
|
||||
False,
|
||||
"",
|
||||
"",
|
||||
)
|
||||
|
||||
koboldai_vars.worldinfo_v2.image_store[str(uid)] = request.get_data(as_text=True)
|
||||
return ":)"
|
||||
|
||||
@app.route("/get_wi_image/<int(signed=True):uid>", methods=["GET"])
|
||||
@logger.catch
|
||||
def UI_2_get_wi_image(uid):
|
||||
try:
|
||||
return koboldai_vars.worldinfo_v2.image_store[str(uid)]
|
||||
except KeyError:
|
||||
return ":( Couldn't find image", 204
|
||||
|
||||
@socketio.on("scratchpad_prompt")
|
||||
@logger.catch
|
||||
def UI_2_scratchpad_prompt(data):
|
||||
|
Reference in New Issue
Block a user