update
This commit is contained in:
@@ -121,7 +121,8 @@ function decisionMaker(a::T1, state::T2) where {T1<:agent, T2<:AbstractDict}
|
||||
"Question": "I would like to buy a sedan",
|
||||
"Thought_1": "I have many car in my inventory suitable for several usage scenarios",
|
||||
"Thought_2": "It would be better if I know what the user intend to do with his car",
|
||||
"Thought_3": "
|
||||
"Thought_3": "I will ask the user what is the intended usecase",
|
||||
"Action_1": "Chatbox[What will you use it for?]"
|
||||
}
|
||||
|
||||
$reflect
|
||||
@@ -131,7 +132,28 @@ function decisionMaker(a::T1, state::T2) where {T1<:agent, T2<:AbstractDict}
|
||||
|
||||
prompt = formatLLMtext_llama3instruct("system", _prompt)
|
||||
|
||||
thought = iterativeprompting(a, prompt, syntaxcheck_json)
|
||||
msgMeta = GeneralUtils.generate_msgMeta(
|
||||
a.config[:externalService][:text2textinstruct],
|
||||
senderName= "iterativeprompting",
|
||||
senderId= a.id,
|
||||
receiverName= "text2textinstruct",
|
||||
mqttBroker= a.config[:mqttServerInfo][:broker],
|
||||
mqttBrokerPort= a.config[:mqttServerInfo][:port],
|
||||
)
|
||||
|
||||
outgoingMsg = Dict(
|
||||
:msgMeta=> msgMeta,
|
||||
:payload=> Dict(
|
||||
:text=> prompt,
|
||||
)
|
||||
)
|
||||
@show outgoingMsg
|
||||
thought = GeneralUtils.sendReceiveMqttMsg(outgoingMsg)
|
||||
|
||||
|
||||
|
||||
|
||||
# thought = iterativeprompting(a, prompt, syntaxcheck_json)
|
||||
|
||||
|
||||
|
||||
@@ -310,7 +332,7 @@ function conversation(a::T, userinput::Dict) where {T<:agent}
|
||||
)
|
||||
)
|
||||
bestplan = runMCTS(a, initialState, decisionMaker, stateValueEstimator, reflector,
|
||||
3, 10, 1000, 1.0)
|
||||
isterminal, 3, 10, 1000, 1.0)
|
||||
error("---> bestplan")
|
||||
|
||||
# actor loop(bestplan)
|
||||
|
||||
@@ -345,7 +345,8 @@ function runMCTS(
|
||||
isterminal::Function,
|
||||
n::Integer,
|
||||
maxDepth::Integer,
|
||||
maxIterations::Integer, w::Float64) where {T1<:agent}
|
||||
maxIterations::Integer,
|
||||
w::Float64) where {T1<:agent}
|
||||
|
||||
statetype = typeof(initialState)
|
||||
root = MCTSNode(initialState, 0, 0.0, Dict{statetype, MCTSNode}())
|
||||
|
||||
@@ -65,7 +65,7 @@ tools=Dict( # update input format
|
||||
tools=tools,
|
||||
)
|
||||
|
||||
response = YiemAgent.conversation(a, Dict(:text=> "hello", ) )
|
||||
response = YiemAgent.conversation(a, Dict(:text=> "Hello, I would like a get a bottle of wine",) )
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user