Fix behaviour of `kobold.outputs` with read-only and no prompt gen

This commit is contained in:
Gnome Ann 2021-12-17 12:59:01 -05:00
parent d15b43e20e
commit 769333738d
2 changed files with 5 additions and 0 deletions

View File

@ -1908,6 +1908,8 @@ def actionsubmit(data, actionmode=0, force_submit=False):
else: else:
# Save this first action as the prompt # Save this first action as the prompt
vars.prompt = data vars.prompt = data
for i in range(vars.numseqs):
vars.lua_koboldbridge.outputs[i+1] = ""
execute_outmod() execute_outmod()
if(vars.lua_koboldbridge.regeneration_required): if(vars.lua_koboldbridge.regeneration_required):
vars.lua_koboldbridge.regeneration_required = False vars.lua_koboldbridge.regeneration_required = False
@ -1943,6 +1945,8 @@ def actionsubmit(data, actionmode=0, force_submit=False):
calcsubmit(data) calcsubmit(data)
emit('from_server', {'cmd': 'scrolldown', 'data': ''}, broadcast=True) emit('from_server', {'cmd': 'scrolldown', 'data': ''}, broadcast=True)
else: else:
for i in range(vars.numseqs):
vars.lua_koboldbridge.outputs[i+1] = ""
execute_outmod() execute_outmod()
set_aibusy(0) set_aibusy(0)
if(vars.lua_koboldbridge.regeneration_required): if(vars.lua_koboldbridge.regeneration_required):

View File

@ -1671,6 +1671,7 @@ return function(_python, _bridged)
setmetatable(koboldbridge.outputs, nil) setmetatable(koboldbridge.outputs, nil)
for k, v in old_next, koboldbridge.outputs, nil do for k, v in old_next, koboldbridge.outputs, nil do
if type(v) ~= "string" then if type(v) ~= "string" then
error("`kobold.outputs` must be a 1D list of strings, but found a non-string element at index " .. k)
return r return r
end end
if v ~= _outputs[k] then if v ~= _outputs[k] then