This commit is contained in:
narawat lamaiin
2024-04-29 17:55:13 +07:00
parent 85240c5fb8
commit 8f95f08695
4 changed files with 21 additions and 22 deletions

View File

@@ -8,30 +8,24 @@ config = copy(JSON3.read("config.json"))
instanceInternalTopic = config[:serviceInternalTopic][:mqtttopic] * "/1"
client, connection = MakeConnection(config[:mqttServerInfo][:value][:broker],
config[:mqttServerInfo][:value][:port])
client, connection = MakeConnection(config[:mqttServerInfo][:broker],
config[:mqttServerInfo][:port])
receiveUserMsgChannel = Channel{Dict}(4)
receiveInternalMsgChannel = Channel{Dict}(4)
msgMeta = GeneralUtils.generate_msgMeta(
"N/A",
replyTopic = config[:servicetopic][:value] # ask frontend reply to this instance_chat_topic
replyTopic = config[:servicetopic][:mqtttopic] # ask frontend reply to this instance_chat_topic
)
agentConfig = Dict(
:mqttServerInfo=> Dict(
:broker=> config[:mqttServerInfo][:value][:broker],
:port=> config[:mqttServerInfo][:value][:port],
),
:mqttServerInfo=> config[:mqttServerInfo],
:receivemsg=> Dict(
:prompt=> config[:servicetopic][:value], # topic to receive prompt i.e. frontend send msg to this topic
:prompt=> config[:servicetopic][:mqtttopic], # topic to receive prompt i.e. frontend send msg to this topic
:internal=> instanceInternalTopic,
),
:externalService=> Dict(
:text2textinstruct=> config[:externalService][:text2textinstruct][:value],
:text2textchat=> config[:externalService][:text2textchat][:value],
),
:externalService=> config[:externalService],
)
# Instantiate an agent