mirror of
https://github.com/KoboldAI/KoboldAI-Client.git
synced 2025-06-05 21:59:24 +02:00
Make KoboldStory
iterators methods instead of static functions
This commit is contained in:
@ -623,7 +623,7 @@ return function(_python, _bridged)
|
|||||||
local KoboldStory_mt = setmetatable({}, metawrapper)
|
local KoboldStory_mt = setmetatable({}, metawrapper)
|
||||||
|
|
||||||
---@return fun(): KoboldStoryChunk, table, nil
|
---@return fun(): KoboldStoryChunk, table, nil
|
||||||
function KoboldStory.forward_iter()
|
function KoboldStory:forward_iter()
|
||||||
local nxt, iterator = _python.iter(bridged.vars.actions)
|
local nxt, iterator = _python.iter(bridged.vars.actions)
|
||||||
local run_once = false
|
local run_once = false
|
||||||
local f = function()
|
local f = function()
|
||||||
@ -647,7 +647,7 @@ return function(_python, _bridged)
|
|||||||
end
|
end
|
||||||
|
|
||||||
---@return fun(): KoboldStoryChunk, table, nil
|
---@return fun(): KoboldStoryChunk, table, nil
|
||||||
function KoboldStory.reverse_iter()
|
function KoboldStory:reverse_iter()
|
||||||
local nxt, iterator = _python.iter(_python.builtins.reversed(bridged.vars.actions))
|
local nxt, iterator = _python.iter(_python.builtins.reversed(bridged.vars.actions))
|
||||||
local last_run = false
|
local last_run = false
|
||||||
local f = function()
|
local f = function()
|
||||||
|
Reference in New Issue
Block a user