update
This commit is contained in:
+10
-2
@@ -73,7 +73,7 @@ OrderedDict{String, Any} with 4 entries:
|
||||
"action_result" => "1) winery: Terrazze dell Etna, wine_name: Rose Brut.
|
||||
```
|
||||
"""
|
||||
function decisionMaker(a::T; recentevents::Integer=20, maxattempt=10
|
||||
function decisionMaker(a::T; recentevents::Integer=20, maxattempt=3
|
||||
) where {T<:agent}
|
||||
@info "YiemAgent decisionMaker() start " @__LINE__
|
||||
# lessonDict = copy(JSON.parsefile("lesson.json"))
|
||||
@@ -187,7 +187,14 @@ function decisionMaker(a::T; recentevents::Integer=20, maxattempt=10
|
||||
@info "YiemAgent decisionMaker() end " @__LINE__
|
||||
return responsedict
|
||||
end
|
||||
error("DecisionMaker failed to generate a thought ", response)
|
||||
|
||||
# in case decisionMaker failed, force to use generatechat!()
|
||||
responsedict = OrderedDict(
|
||||
"plan"=> "N/A",
|
||||
"action_name"=> "CHAT_BOX",
|
||||
"action_input"=> "N/A"
|
||||
)
|
||||
return responsedict
|
||||
end
|
||||
|
||||
|
||||
@@ -803,6 +810,7 @@ function generatechat!(a::T; maxattempt::Integer=10
|
||||
@info "YiemAgent generatechat!() end " @__LINE__
|
||||
return (thoughtdict=responsedict, result_raw=responsedict["action_input"])
|
||||
end
|
||||
@info "YiemAgent generatechat() failed to generate a thought " @__LINE__
|
||||
error("YiemAgent generatechat() failed to generate a thought ", response)
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user