This commit is contained in:
narawat lamaiin
2024-05-10 11:59:38 +07:00
parent c7fd7bc40d
commit a4ba292fad
4 changed files with 107 additions and 44 deletions

View File

@@ -91,10 +91,17 @@ function decisionMaker(a::T1, state::T2)::Dict{Symbol, Any} where {T1<:agent, T2
$(JSON3.write(state[:storeinfo]))
"""
lessonDict = copy(JSON3.read("lesson.json"))
lesson =
if isempty(a.lesson)
if isempty(lessonDict)
""
else
lessons = Dict{Symbol, Any}()
for (k, v) in lessonDict
lessons[k] = lessonDict[k][:lesson]
end
"""
You have attempted to help the user before and failed, either because your reasoning for the
recommendation was incorrect or your response did not exactly match the user expectation.
@@ -102,7 +109,7 @@ function decisionMaker(a::T1, state::T2)::Dict{Symbol, Any} where {T1<:agent, T2
did previously. Use them to improve your strategy to help the user.
Here are some lessons:
$(JSON3.write(a.lesson[:lesson_1][:lesson]))
$(JSON3.write(lessons))
When providing the thought and action for the current trial, that into account these failed
trajectories and make sure not to repeat the same mistakes and incorrect answers.
@@ -211,8 +218,14 @@ function decisionMaker(a::T1, state::T2)::Dict{Symbol, Any} where {T1<:agent, T2
# check if dict has all required value
dummya::AbstractString = thoughtDict[:thought]
dummyb::AbstractString = thoughtDict[:action][:name]
dummyc::AbstractString = thoughtDict[:action][:input]
actionname::AbstractString = thoughtDict[:action][:name]
actioninput::AbstractString = thoughtDict[:action][:input]
if actionname ["winestock", "chatbox", "recommendbox"]
# LLM use available function
else
error("DecisionMaker use wrong function")
end
return thoughtDict
catch e