update
This commit is contained in:
@@ -212,8 +212,8 @@ function agentReflex(
|
||||
maxUserMsg::Int=10,
|
||||
)
|
||||
|
||||
#NEXTVERSION publish to agentConfigTopic to get a config.
|
||||
#NEXTVERSION get a config message in a.mqttMsgList
|
||||
#NEXTVERSION publish to a.config[:configtopic] to get a config.
|
||||
#NEXTVERSION get a config message in a.mqttMsg_internal
|
||||
#NEXTVERSION set agent according to config
|
||||
|
||||
newAgent = agentReflex(
|
||||
|
||||
@@ -98,9 +98,9 @@ function sendReceivePrompt(a::T1, prompt::String, sendtopic::String;
|
||||
while true #WORKING check how to receive msg , should i use :text or :message?
|
||||
timepass = (Dates.now() - starttime).value / 1000.0
|
||||
if isready(a.mqttMsg_internal)
|
||||
topic, payload = take!(payloadChannel)
|
||||
if payload[:msgMeta][:repondToMsgId] == outgoing_msg[:msgMeta][:msgId]
|
||||
result = haskey(payload, :txt) ? payload[:txt] : nothing
|
||||
topic, payload = take!(a.mqttMsg_internal)
|
||||
if payload[:msgMeta][:replyToMsgId] == outgoing_msg[:msgMeta][:msgId]
|
||||
result = haskey(payload, :text) ? payload[:text] : nothing
|
||||
break
|
||||
end
|
||||
elseif timepass <= timeout
|
||||
@@ -112,8 +112,9 @@ function sendReceivePrompt(a::T1, prompt::String, sendtopic::String;
|
||||
else
|
||||
error("undefined condition. timepass=$timepass timeout=$timeout $(@__LINE__)")
|
||||
end
|
||||
sleep(0.1) # allow other threads to run
|
||||
end
|
||||
sleep(0.1) # allow other threads to run
|
||||
|
||||
|
||||
return result
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user