This commit is contained in:
2023-11-02 14:23:39 +00:00
parent 8c3786705e
commit 913e563660

View File

@@ -277,14 +277,14 @@ function identifyUserIntention(a::agent, usermsg::String)
payloadChannel = Channel(1)
# send prompt
CommUtils.request(a.mqttClient, msg, pubtopic=a.mqttClient.pubtopic.llmAIgpu)
CommUtils.request(a.mqttClient, msg, pubtopic=a.mqttClient.pubtopic.llmAI)
starttime = Dates.now()
timeout = 10
result = nothing
while true
timepass = (Dates.now() - starttime).value / 1000.0
CommUtils.mqttRun(mqttclient, payloadChannel)
CommUtils.mqttRun(a.mqttClient, payloadChannel)#BUG no msg received
if isready(payloadChannel)
topic, payload = take!(payloadChannel)
if payload[:msgMeta][:repondToMsgId] == msgPrompt[:msgMeta][:msgId]
@@ -300,9 +300,8 @@ function identifyUserIntention(a::agent, usermsg::String)
error("undefined condition $(@__LINE__)")
end
end
answer = getStringBetweenCharacters(result, "{", "}")
answer = result === nothing ? nothing : getStringBetweenCharacters(result, "{", "}")
@show answer
return answer
end