update
This commit is contained in:
@@ -211,7 +211,7 @@ end
|
|||||||
what to do with the message.
|
what to do with the message.
|
||||||
|
|
||||||
# Arguments
|
# Arguments
|
||||||
- `sendTopic`
|
- `sendTo`
|
||||||
topic the sender sends to e.g. "/agent/wine/api/v1/prompt"
|
topic the sender sends to e.g. "/agent/wine/api/v1/prompt"
|
||||||
|
|
||||||
# Keyword Arguments
|
# Keyword Arguments
|
||||||
@@ -264,7 +264,7 @@ end
|
|||||||
# Signature
|
# Signature
|
||||||
"""
|
"""
|
||||||
function generate_msgMeta(
|
function generate_msgMeta(
|
||||||
sendTopic::T1, # topic the sender sends to e.g. "/agent/wine/api/v1/prompt"
|
sendTo::T1, # topic the sender sends to e.g. "/agent/wine/api/v1/prompt"
|
||||||
;
|
;
|
||||||
msgPurpose::T1= "nothing", # purpose of this message e.g. "updateStatus"
|
msgPurpose::T1= "nothing", # purpose of this message e.g. "updateStatus"
|
||||||
senderName::T1= "nothing", # sender name (String) e.g. "agent-wine-web-frontend"
|
senderName::T1= "nothing", # sender name (String) e.g. "agent-wine-web-frontend"
|
||||||
@@ -292,7 +292,7 @@ function generate_msgMeta(
|
|||||||
)::Dict{Symbol, Any} where {T1<:AbstractString}
|
)::Dict{Symbol, Any} where {T1<:AbstractString}
|
||||||
|
|
||||||
msgMeta::Dict=Dict(
|
msgMeta::Dict=Dict(
|
||||||
:sendTopic=> sendTopic, # topic the sender sends to e.g. "/agent/wine/api/v1/prompt"
|
:sendTo=> sendTo, # topic the sender sends to e.g. "/agent/wine/api/v1/prompt"
|
||||||
:msgPurpose=> msgPurpose, # purpose of this message e.g. "updateStatus"
|
:msgPurpose=> msgPurpose, # purpose of this message e.g. "updateStatus"
|
||||||
:senderName=> senderName, # sender name (String) e.g. "agent-wine-web-frontend"
|
:senderName=> senderName, # sender name (String) e.g. "agent-wine-web-frontend"
|
||||||
:senderId=> senderId, # sender id e.g. uuid4snakecase()
|
:senderId=> senderId, # sender id e.g. uuid4snakecase()
|
||||||
@@ -370,7 +370,7 @@ function isMqttConnectionAlive(mqttInstance::T)::Bool where {T<:mqttClientInstan
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
publish(mqttInstance.client, keepaliveMsg[:msgMeta][:sendTopic],
|
publish(mqttInstance.client, keepaliveMsg[:msgMeta][:sendTo],
|
||||||
JSON3.write(keepaliveMsg))
|
JSON3.write(keepaliveMsg))
|
||||||
timediff = 0
|
timediff = 0
|
||||||
starttime = Dates.now()
|
starttime = Dates.now()
|
||||||
@@ -524,7 +524,7 @@ end
|
|||||||
function sendMqttMsg(mqttInstance::mqttClientInstance, outgoingMsg::Dict{Symbol, T}
|
function sendMqttMsg(mqttInstance::mqttClientInstance, outgoingMsg::Dict{Symbol, T}
|
||||||
)::NamedTuple where {T<:Any}
|
)::NamedTuple where {T<:Any}
|
||||||
try
|
try
|
||||||
publish(mqttInstance.client, outgoingMsg[:msgMeta][:sendTopic], JSON3.write(outgoingMsg))
|
publish(mqttInstance.client, outgoingMsg[:msgMeta][:sendTo], JSON3.write(outgoingMsg))
|
||||||
return (success=true, error=nothing)
|
return (success=true, error=nothing)
|
||||||
catch e
|
catch e
|
||||||
return (success=false, error=e)
|
return (success=false, error=e)
|
||||||
@@ -740,7 +740,7 @@ function dataTransferOverMQTT_sender(workDict::Dict, incomingMsg::Dict; data=not
|
|||||||
:timestamp => "Tue Oct 01 2024 16:22:12 GMT+0700 (เวลาอินโดจีน)",
|
:timestamp => "Tue Oct 01 2024 16:22:12 GMT+0700 (เวลาอินโดจีน)",
|
||||||
:replyToMsgId => nothing,
|
:replyToMsgId => nothing,
|
||||||
:acknowledgestatus => nothing,
|
:acknowledgestatus => nothing,
|
||||||
:sendTopic => "/yiem_branch_1/agent/wine/backend/db/api/v1/testing",
|
:sendTo => "/yiem_branch_1/agent/wine/backend/db/api/v1/testing",
|
||||||
:mqttBrokerPort => nothing,
|
:mqttBrokerPort => nothing,
|
||||||
:receiverName => "agent_wine_backend",
|
:receiverName => "agent_wine_backend",
|
||||||
:replyTopic => "/agent/wine/frontend/514b634a_90b9_4e07_891d_fdf55b1aed25",
|
:replyTopic => "/agent/wine/frontend/514b634a_90b9_4e07_891d_fdf55b1aed25",
|
||||||
@@ -807,7 +807,7 @@ function dataTransferOverMQTT_sender(workDict::Dict, incomingMsg::Dict; data=not
|
|||||||
:timestamp => "Tue Oct 01 2024 16:34:06 GMT+0700 (เวลาอินโดจีน)",
|
:timestamp => "Tue Oct 01 2024 16:34:06 GMT+0700 (เวลาอินโดจีน)",
|
||||||
:replyToMsgId => nothing,
|
:replyToMsgId => nothing,
|
||||||
:acknowledgestatus => nothing,
|
:acknowledgestatus => nothing,
|
||||||
:sendTopic => "/yiem_branch_1/agent/wine/backend/db/api/v1/testing",
|
:sendTo => "/yiem_branch_1/agent/wine/backend/db/api/v1/testing",
|
||||||
:mqttBrokerPort => nothing,
|
:mqttBrokerPort => nothing,
|
||||||
:receiverName => "agent_wine_backend",
|
:receiverName => "agent_wine_backend",
|
||||||
:replyTopic => "/agent/wine/frontend/514b634a_90b9_4e07_891d_fdf55b1aed25",
|
:replyTopic => "/agent/wine/frontend/514b634a_90b9_4e07_891d_fdf55b1aed25",
|
||||||
|
|||||||
@@ -1298,6 +1298,9 @@ function textToDict(text::String, detectKeywords::Vector{String};
|
|||||||
error("Keyword $keyword not found in text: $text")
|
error("Keyword $keyword not found in text: $text")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
if typeof(kw[1]) <: AbstractArray
|
||||||
|
kw = reduce(vcat, kw)
|
||||||
|
end
|
||||||
|
|
||||||
od1, od2 =
|
od1, od2 =
|
||||||
if symbolkey
|
if symbolkey
|
||||||
|
|||||||
Reference in New Issue
Block a user