update
This commit is contained in:
@@ -145,7 +145,7 @@ function decisionMaker(a::T1, state::T2)::String where {T1<:agent, T2<:AbstractD
|
||||
prompt = formatLLMtext_llama3instruct("system", _prompt)
|
||||
|
||||
msgMeta = GeneralUtils.generate_msgMeta(
|
||||
a.config[:externalService][:text2textinstruct],
|
||||
a.config[:externalService][:text2textinstruct][:mqtttopic],
|
||||
senderName= "decisionMaker",
|
||||
senderId= a.id,
|
||||
receiverName= "text2textinstruct",
|
||||
|
||||
@@ -21,12 +21,15 @@ julia>
|
||||
|
||||
# TODO
|
||||
- [] update docstring
|
||||
- [] implement the function
|
||||
- [WORKING] implement the function
|
||||
|
||||
# Signature
|
||||
"""
|
||||
function chatbox(input::T) where {T<:AbstractString}
|
||||
function chatbox(a::T1, input::T2) where {T1<:agent, T2<:AbstractString}
|
||||
error("--> chatbox")
|
||||
# put in model format
|
||||
if a.config[:externalService][]
|
||||
GeneralUtils.formatLLMtext_llama3instruct
|
||||
end
|
||||
|
||||
""" Search wine in stock.
|
||||
|
||||
16
src/mcts.jl
16
src/mcts.jl
@@ -232,18 +232,20 @@ julia>
|
||||
"""
|
||||
function transition(a::T1, state::T2, action::T3,
|
||||
actioninput::T3) where {T1<:agent, T2<:AbstractDict, T3<:AbstractString}
|
||||
error("--> transition")
|
||||
|
||||
|
||||
# map action and input() to llm function
|
||||
# result =
|
||||
# if action == "chatbox"
|
||||
# chatbox(input)
|
||||
# elseif
|
||||
result =
|
||||
if action == "chatbox"
|
||||
chatbox(a, input)
|
||||
elseif action == "winestock"
|
||||
|
||||
# else
|
||||
elseif action == "finish"
|
||||
|
||||
# end
|
||||
else
|
||||
|
||||
end
|
||||
error("--> transition")
|
||||
|
||||
end
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user