update
This commit is contained in:
14
src/mcts.jl
14
src/mcts.jl
@@ -47,7 +47,7 @@ julia> state = Dict(
|
||||
|
||||
# Signature
|
||||
"""
|
||||
struct MCTSNode{T<:AbstractDict}
|
||||
mutable struct MCTSNode{T<:AbstractDict}
|
||||
nodekey::String
|
||||
state::T
|
||||
visits::Integer
|
||||
@@ -272,14 +272,14 @@ julia> thoughtDict = Dict(
|
||||
```
|
||||
|
||||
# TODO
|
||||
- [PENDING] add other actions
|
||||
- [x] add other actions
|
||||
- [] add embedding of newstate and store in newstate[:embedding]
|
||||
|
||||
# Signature
|
||||
"""
|
||||
function MCTStransition(a::T1, state::T2, thoughtDict::T3, isterminal::Function
|
||||
)::Tuple{String, Dict{Symbol, <:Any}, Bool, <:Number} where {T1<:agent, T2<:AbstractDict, T3<:AbstractDict}
|
||||
pprint(thoughtDict)
|
||||
|
||||
actionname = thoughtDict[:Action][:name]
|
||||
actioninput = thoughtDict[:Action][:input]
|
||||
|
||||
@@ -288,11 +288,11 @@ function MCTStransition(a::T1, state::T2, thoughtDict::T3, isterminal::Function
|
||||
if actionname == "chatbox"
|
||||
virtualWineCustomerChatbox(a, actioninput) # virtual customer
|
||||
elseif actionname == "winestock"
|
||||
|
||||
elseif actionname == "finish"
|
||||
|
||||
winestock(a, actioninput)
|
||||
elseif actionname == "reccommendbox"
|
||||
virtualWineCustomerReccommendbox(a, actioninput)
|
||||
else
|
||||
|
||||
error("undefined LLM function. Requesting $actionname")
|
||||
end
|
||||
|
||||
latestThoughtKey, latestThoughtIndice = GeneralUtils.findHighestIndexKey(state[:thoughtHistory],
|
||||
|
||||
Reference in New Issue
Block a user