Files
YiemAgent/test/test_1.jl
narawat lamaiin 2e0d8dd7f2 update
2024-05-08 18:25:04 +07:00

176 lines
3.0 KiB
Julia

using Revise
using YiemAgent, GeneralUtils, JSON3, DataStructures
msgMeta = Dict(:requestResponse => nothing,
:msgPurpose => nothing,
:receiverId => nothing,
:getPost => nothing,
:msgId => "4c7111e0-c30e-44c3-8f85-1c8b3f03a8be",
:acknowledgestatus => nothing,
:replyToMsgId => "dummyid",
:msgFormatVersion => nothing,
:mqttServerInfo => Dict(:port => 1883, :broker => "mqtt.yiem.cc"),
:sendTopic => "/testingSessionID",
:receiverName => "wineassistant",
:replyTopic => nothing,
:senderName => "test_1",
:senderSelfnote => nothing,
:senderId => nothing,
:timeStamp => "2024-05-04T08:06:23.561"
)
outgoingMsg = Dict(
:msgMeta=> msgMeta,
:payload=> Dict(
:text=> "We are holding a wedding party",
:select=> nothing,
:reward=> 0,
:isterminal=> false,
)
)
result = GeneralUtils.sendMqttMsg(outgoingMsg)
outgoingMsg = Dict(
:msgMeta=> msgMeta,
:payload=> Dict(
:text=> "It will be Thai dishes.",
:select=> nothing,
:reward=> 0,
:isterminal=> false,
)
)
result = GeneralUtils.sendMqttMsg(outgoingMsg)
outgoingMsg = Dict(
:msgMeta=> msgMeta,
:payload=> Dict(
:text=> "I would spend up to 50 bucks.",
:select=> nothing,
:reward=> 0,
:isterminal=> false,
)
)
result = GeneralUtils.sendMqttMsg(outgoingMsg)
outgoingMsg = Dict(
:msgMeta=> msgMeta,
:payload=> Dict(
:text=> "I like full-bodied Red wine with low tannin.",
:select=> nothing,
:reward=> 0,
:isterminal=> false,
)
)
result = GeneralUtils.sendMqttMsg(outgoingMsg)
outgoingMsg = Dict(
:msgMeta=> msgMeta,
:payload=> Dict(
:text=> "What do you have?",
:select=> nothing,
:reward=> 0,
:isterminal=> false,
)
)
result = GeneralUtils.sendMqttMsg(outgoingMsg)
outgoingMsg = Dict(
:msgMeta=> msgMeta,
:payload=> Dict(
:text=> "Dry please.",
:select=> nothing,
:reward=> 0,
:isterminal=> false,
)
)
result = GeneralUtils.sendMqttMsg(outgoingMsg)
outgoingMsg = Dict(
:msgMeta=> msgMeta,
:payload=> Dict(
:text=> "You did not gave me any choice.",
:select=> nothing,
:reward=> -1,
:isterminal=> true,
)
)
result = GeneralUtils.sendMqttMsg(outgoingMsg)
outgoingMsg = Dict(
:msgMeta=> msgMeta,
:payload=> Dict(
:text=> "Are there any other options?",
:select=> nothing,
:reward=> 0,
:isterminal=> false,
)
)
result = GeneralUtils.sendMqttMsg(outgoingMsg)
outgoingMsg = Dict(
:msgMeta=> msgMeta,
:payload=> Dict(
:text=> "Yep.",
:select=> nothing,
:reward=> 0,
:isterminal=> false,
)
)
result = GeneralUtils.sendMqttMsg(outgoingMsg)
outgoingMsg = Dict(
:msgMeta=> msgMeta,
:payload=> Dict(
:text=> "OK, I'll take it.",
:select=> 1,
:reward=> 1,
:isterminal=> true,
)
)
result = GeneralUtils.sendMqttMsg(outgoingMsg)
outgoingMsg = Dict(
:msgMeta=> msgMeta,
:payload=> Dict(
:text=> "I don't like the one you recommend. I want dry wine.",
:select=> nothing,
:reward=> -1,
:isterminal=> true,
)
)
result = GeneralUtils.sendMqttMsg(outgoingMsg)