Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ddbb135b6b | |||
| afda364484 | |||
| af73d955eb |
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
name = "YiemAgent"
|
name = "YiemAgent"
|
||||||
uuid = "e012c34b-7f78-48e0-971c-7abb83b6f0a2"
|
uuid = "e012c34b-7f78-48e0-971c-7abb83b6f0a2"
|
||||||
version = "0.7.0"
|
version = "0.7.2"
|
||||||
authors = ["narawat lamaiin <narawat@outlook.com>"]
|
authors = ["narawat lamaiin <narawat@outlook.com>"]
|
||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
|
|||||||
+10
-2
@@ -73,7 +73,7 @@ OrderedDict{String, Any} with 4 entries:
|
|||||||
"action_result" => "1) winery: Terrazze dell Etna, wine_name: Rose Brut.
|
"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}
|
) where {T<:agent}
|
||||||
@info "YiemAgent decisionMaker() start " @__LINE__
|
@info "YiemAgent decisionMaker() start " @__LINE__
|
||||||
# lessonDict = copy(JSON.parsefile("lesson.json"))
|
# lessonDict = copy(JSON.parsefile("lesson.json"))
|
||||||
@@ -187,7 +187,14 @@ function decisionMaker(a::T; recentevents::Integer=20, maxattempt=10
|
|||||||
@info "YiemAgent decisionMaker() end " @__LINE__
|
@info "YiemAgent decisionMaker() end " @__LINE__
|
||||||
return responsedict
|
return responsedict
|
||||||
end
|
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
|
end
|
||||||
|
|
||||||
|
|
||||||
@@ -803,6 +810,7 @@ function generatechat!(a::T; maxattempt::Integer=10
|
|||||||
@info "YiemAgent generatechat!() end " @__LINE__
|
@info "YiemAgent generatechat!() end " @__LINE__
|
||||||
return (thoughtdict=responsedict, result_raw=responsedict["action_input"])
|
return (thoughtdict=responsedict, result_raw=responsedict["action_input"])
|
||||||
end
|
end
|
||||||
|
@info "YiemAgent generatechat() failed to generate a thought " @__LINE__
|
||||||
error("YiemAgent generatechat() failed to generate a thought ", response)
|
error("YiemAgent generatechat() failed to generate a thought ", response)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user