update
This commit is contained in:
@@ -162,11 +162,29 @@ function virtualWineCustomerChatbox(a::T1, input::T2
|
||||
:text=> prompt,
|
||||
)
|
||||
)
|
||||
@show outgoingMsg
|
||||
result = GeneralUtils.sendReceiveMqttMsg(outgoingMsg; timeout=120)
|
||||
response = result[:response]
|
||||
|
||||
return (response[:text], response[:select], response[:reward], response[:isterminal])
|
||||
attempt = 0
|
||||
while attempt <= 5
|
||||
attempt += 1
|
||||
try
|
||||
result = GeneralUtils.sendReceiveMqttMsg(outgoingMsg; timeout=120)
|
||||
response = result[:response]
|
||||
|
||||
return (response[:text], response[:select], response[:reward], response[:isterminal])
|
||||
catch e
|
||||
io = IOBuffer()
|
||||
showerror(io, e)
|
||||
errorMsg = String(take!(io))
|
||||
st = sprint((io, v) -> show(io, "text/plain", v), stacktrace(catch_backtrace()))
|
||||
println("")
|
||||
@warn "Error occurred: $errorMsg\n$st"
|
||||
println("")
|
||||
end
|
||||
|
||||
if attempt > 5
|
||||
error("virtualWineCustomerChatbox failed to get a response")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user