mirror of
https://github.com/KoboldAI/KoboldAI-Client.git
synced 2025-06-05 21:59:24 +02:00
Upload bridge.lua, default.lua and some Lua libs
base64 inspect json.lua Lua-hashings Lua-nums Moses mt19937ar-lua Penlight Serpent
This commit is contained in:
41
scripts/corescripts/default.lua
Normal file
41
scripts/corescripts/default.lua
Normal file
@ -0,0 +1,41 @@
|
||||
-- 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 top to bottom
|
||||
function corescript.inmod()
|
||||
for i, userscript in ipairs(koboldcore.userscripts) do
|
||||
if userscript.inmod ~= nil then
|
||||
userscript.inmod()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Run all the generation modifiers from top to bottom
|
||||
function corescript.genmod()
|
||||
for i, userscript in ipairs(koboldcore.userscripts) do
|
||||
if userscript.genmod ~= nil then
|
||||
userscript.genmod()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Run all the generation modifiers from bottom to top
|
||||
function corescript.outmod()
|
||||
local userscript
|
||||
for i = #koboldcore.userscripts, 1, -1 do
|
||||
userscript = koboldcore.userscripts[i]
|
||||
if userscript.outmod ~= nil then
|
||||
userscript.outmod()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
return corescript
|
Reference in New Issue
Block a user