This commit is contained in:
2023-12-12 01:33:02 +00:00
parent fa2b46f617
commit 47618a45f6

View File

@@ -75,7 +75,7 @@ end
function clearMessage(a::T) where {T<:agent}
for i in eachindex(a.messages)
if length(a.messages) > 1 # system instruction will NOT be deleted
if length(a.messages) > 0
pop!(a.messages)
else
break
@@ -83,6 +83,7 @@ function clearMessage(a::T) where {T<:agent}
end
a.memory[:shortterm] = OrderedDict{String, Any}()
a.memory[:log] = OrderedDict{String, Any}()
@show a.messages
end
function removeLatestMsg(a::T) where {T<:agent}