mirror of
https://github.com/KoboldAI/KoboldAI-Client.git
synced 2024-12-11 16:27:01 +01:00
35 lines
909 B
Lua
35 lines
909 B
Lua
-- Default core script
|
|
-- Runs all input modifiers and generation modifiers in forward order, and
|
|
-- runs all output modifiers in reverse order
|
|
|
|
kobold, koboldcore = require("bridge")() -- This line is optional and is only for EmmyLua type annotations
|
|
|
|
---@class KoboldCoreScript
|
|
local corescript = {}
|
|
|
|
|
|
-- Run all the input modifiers from bottom to top
|
|
function corescript.inmod()
|
|
for i = #koboldcore.userscripts, 1, -1 do
|
|
local userscript = koboldcore.userscripts[i]
|
|
userscript.inmod()
|
|
end
|
|
end
|
|
|
|
-- Run all the generation modifiers from top to bottom
|
|
function corescript.genmod()
|
|
for i, userscript in ipairs(koboldcore.userscripts) do
|
|
userscript.genmod()
|
|
end
|
|
end
|
|
|
|
-- Run all the generation modifiers from top to bottom
|
|
function corescript.outmod()
|
|
for i, userscript in ipairs(koboldcore.userscripts) do
|
|
userscript.outmod()
|
|
end
|
|
end
|
|
|
|
|
|
return corescript
|