This commit is contained in:
2025-03-09 11:26:55 +07:00
parent e9f9e431a9
commit 7dd6b56e4c
2 changed files with 9 additions and 7 deletions

View File

@@ -823,7 +823,7 @@ function transition(state::T, args::NamedTuple
# so that other simulation start from this same node is not contaminated with actioninput
listAllTable_json(executeSQL)
elseif thoughtDict[:action_name] == "TABLEINFO"
input = thoughtDict[:action_input] # BUG thoughtDict[:action_input] = "\"wine\""
input = thoughtDict[:action_input]
tableinfo(executeSQL, input)
elseif thoughtDict[:action_name] == "GETDATA"
response = SQLexecution(executeSQL, thoughtDict[:action_input])
@@ -978,11 +978,13 @@ function query(query::T, executeSQL::Function, text2textInstructLLM::Function;
earlystop(state) = state[:reward] >= 8 ? true : false
_, resultState = LLMMCTS.runMCTS(initialstate, transition, transitionargs;
_, _, resultState = LLMMCTS.runMCTS(initialstate, transition, transitionargs;
horizontalSampleExpansionPhase=2,
horizontalSampleSimulationPhase=1,
maxdepth=3, maxiterations=2, explorationweight=1.0,
earlystop=earlystop)
maxSimulationDepth=3, maxiterations=2,
explorationweight=1.0,
earlystop=earlystop,
saveSimulatedNode=true)
latestKey, latestInd = GeneralUtils.findHighestIndexKey(resultState[:thoughtHistory], "observation")
action_input = Symbol("action_input_$latestInd") # latest sql
sql = resultState[:thoughtHistory][action_input]