This commit is contained in:
narawat lamaiin
2024-08-03 22:47:26 +07:00
parent c4864a22ed
commit d86468c6c8
3 changed files with 15 additions and 13 deletions

View File

@@ -302,7 +302,7 @@ function decisionMaker(a::T)::Dict{Symbol, Any} where {T<:agent}
end
for i [:thought, :plan, :action_name]
if length(JSON3.write(responsedict[i])) == 0
if length(responsedict[i]) == 0
error("$i is empty ", @__LINE__)
end
end
@@ -321,8 +321,8 @@ function decisionMaker(a::T)::Dict{Symbol, Any} where {T<:agent}
isMemEmpty = isempty(a.memory[:shortmem])
if occursin("Yes", responsedict[:recommending_wine]) && isMemEmpty &&
responsedict[:action_name] != "CHECKINVENTORY"
checkinventory_flag = "You must check inventory before recommending wine to the user."
error( "You must check inventory before recommending wine")
checkinventory_flag = "You must check your inventory before recommending wine to the user."
error( "You must check your inventory before recommending wine")
else
checkinventory_flag = ""
end