This commit is contained in:
youremail@yourdomain.com
2023-12-22 14:30:57 +00:00
parent f786643fd2
commit 78e99457d0
3 changed files with 99 additions and 335 deletions

View File

@@ -1,10 +1,10 @@
module utils
export makeSummary, sendReceivePrompt, chunktext, extractStepFromPlan, checkTotalStepInPlan,
export makeSummary, sendReceivePrompt, chunktext, extractStepFromPlan, checkTotalTaskInPlan,
detectCharacters, findDetectedCharacter, extract_number, toolNameBeingCalled,
isUsePlans, conversationSummary, checkReasonableness, replaceHeaders,
addShortMem!, splittext, dictToString, removeHeaders, keepOnlyKeys, experience,
messagesToString, messagesToString_nomark, removeTrailingCharacters, shortMemLatestStep
messagesToString, messagesToString_nomark, removeTrailingCharacters, shortMemLatestTask
using UUIDs, Dates, DataStructures
using CommUtils, GeneralUtils
@@ -210,7 +210,7 @@ function extractStepFromPlan(a::agent, plan::T, step::Int) where {T<:AbstractStr
return response
end
function checkTotalStepInPlan(a::agent)
function checkTotalTaskInPlan(a::agent)
headers = []
for (k, v) in a.memory[:shortterm]
@@ -1027,10 +1027,10 @@ Return:
```jldoctest
julia> dict = OrderedDict(
"Plan 1:" => "1. Ask about the type of food that will be served at the wedding party.")
julia>shortMemLatestStep(dict)
julia>shortMemLatestTask(dict)
1
"""
function shortMemLatestStep(dict::T) where {T<:AbstractDict}
function shortMemLatestTask(dict::T) where {T<:AbstractDict}
_latest_step = keys(dict)
_latest_step = [i for i in _latest_step]
_latest_step = _latest_step[end]