This commit is contained in:
narawat lamaiin
2025-01-15 06:13:18 +07:00
parent a29e8049a7
commit 2206831bab
4 changed files with 298 additions and 40 deletions

View File

@@ -198,18 +198,20 @@ function eventdict(;
end
function createTimeline(memory::T1, recent) where {T1<:AbstractVector}
totalevents = length(memory)
ind =
if totalevents > recent
start = totalevents - recent
start:totalevents
else
1:totalevents
end
function createTimeline(memory::T1; skiprecent::Integer=0) where {T1<:AbstractVector}
# totalevents = length(memory)
# ind =
# if totalevents > skiprecent
# start = totalevents - skiprecent
# start:totalevents
# else
# 1:totalevents
# end
events = memory[1:end-skiprecent]
timeline = ""
for (i, event) in enumerate(memory[ind])
for (i, event) in enumerate(events)
if event[:outcome] === nothing
timeline *= "$i) $(event[:subject])> $(event[:actioninput])\n"
else