update
This commit is contained in:
@@ -127,7 +127,7 @@ function decisionMaker(config::T1, state::T2)::Dict{Symbol, Any} where {T1<:Abst
|
|||||||
The following lesson(s) give a plan to avoid failing to help the user in the same way you
|
The following lesson(s) give a plan to avoid failing to help the user in the same way you
|
||||||
did previously. Use them to improve your strategy to help the user.
|
did previously. Use them to improve your strategy to help the user.
|
||||||
|
|
||||||
Here are some lessons:
|
Here are some lessons in JSON format:
|
||||||
$(JSON3.write(lessons))
|
$(JSON3.write(lessons))
|
||||||
|
|
||||||
When providing the thought and action for the current trial, that into account these failed
|
When providing the thought and action for the current trial, that into account these failed
|
||||||
@@ -701,6 +701,7 @@ julia> response = ChatAgent.conversation(newAgent, "Hi! how are you?")
|
|||||||
"""
|
"""
|
||||||
function conversation(a::T, userinput::Dict) where {T<:agent}
|
function conversation(a::T, userinput::Dict) where {T<:agent}
|
||||||
config = deepcopy(a.config)
|
config = deepcopy(a.config)
|
||||||
|
pprint(config)
|
||||||
if userinput[:text] == "newtopic"
|
if userinput[:text] == "newtopic"
|
||||||
clearhistory(a)
|
clearhistory(a)
|
||||||
return "Okay. What shall we talk about?"
|
return "Okay. What shall we talk about?"
|
||||||
|
|||||||
@@ -650,10 +650,10 @@ function wineattributes_wordToNumber(config::T1, input::T2
|
|||||||
# put in model format
|
# put in model format
|
||||||
prompt = formatLLMtext(chathistory, "llama3instruct")
|
prompt = formatLLMtext(chathistory, "llama3instruct")
|
||||||
prompt *=
|
prompt *=
|
||||||
"""
|
"""
|
||||||
<|start_header_id|>assistant<|end_header_id|>
|
<|start_header_id|>assistant<|end_header_id|>
|
||||||
{
|
{
|
||||||
"""
|
"""
|
||||||
|
|
||||||
pprint(prompt)
|
pprint(prompt)
|
||||||
externalService = config[:externalservice][:text2textinstruct]
|
externalService = config[:externalservice][:text2textinstruct]
|
||||||
@@ -675,7 +675,6 @@ function wineattributes_wordToNumber(config::T1, input::T2
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
attempt = 0
|
|
||||||
for attempt in 1:5
|
for attempt in 1:5
|
||||||
try
|
try
|
||||||
response = GeneralUtils.sendReceiveMqttMsg(outgoingMsg; timeout=120)
|
response = GeneralUtils.sendReceiveMqttMsg(outgoingMsg; timeout=120)
|
||||||
@@ -702,7 +701,7 @@ function wineattributes_wordToNumber(config::T1, input::T2
|
|||||||
errorMsg = String(take!(io))
|
errorMsg = String(take!(io))
|
||||||
st = sprint((io, v) -> show(io, "text/plain", v), stacktrace(catch_backtrace()))
|
st = sprint((io, v) -> show(io, "text/plain", v), stacktrace(catch_backtrace()))
|
||||||
println("")
|
println("")
|
||||||
@warn "Error occurred: $errorMsg\n$st"
|
@warn "Attempt $attempt. Error occurred: $errorMsg\n$st"
|
||||||
println("")
|
println("")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user