mirror of
https://github.com/KoboldAI/KoboldAI-Client.git
synced 2025-06-05 21:59:24 +02:00
Add Lua API for reading the text the user submitted to the AI
This commit is contained in:
18
bridge.lua
18
bridge.lua
@@ -129,6 +129,7 @@ return function(_python, _bridged)
|
||||
|
||||
---@class KoboldLib
|
||||
---@field memory string
|
||||
---@field submission string
|
||||
local kobold = setmetatable({}, metawrapper)
|
||||
local KoboldLib_mt = setmetatable({}, metawrapper)
|
||||
local KoboldLib_getters = setmetatable({}, metawrapper)
|
||||
@@ -809,6 +810,23 @@ return function(_python, _bridged)
|
||||
end
|
||||
|
||||
|
||||
--==========================================================================
|
||||
-- Userscript API: User-submitted text (after applying input formatting)
|
||||
--==========================================================================
|
||||
|
||||
---@param t KoboldLib
|
||||
---@return string
|
||||
function KoboldLib_getters.submission(t)
|
||||
return bridged.vars.submission
|
||||
end
|
||||
|
||||
---@param t KoboldLib
|
||||
---@param v string
|
||||
function KoboldLib_setters.submission(t, v)
|
||||
error("`KoboldLib.submission` is a read-only attribute")
|
||||
end
|
||||
|
||||
|
||||
--==========================================================================
|
||||
-- Userscript API: Utilities
|
||||
--==========================================================================
|
||||
|
||||
Reference in New Issue
Block a user