update
This commit is contained in:
@@ -871,7 +871,7 @@ function query(query::T, executeSQL::Function, text2textInstructLLM::Function;
|
|||||||
|
|
||||||
earlystop(state) = state[:reward] >= 8 ? true : false
|
earlystop(state) = state[:reward] >= 8 ? true : false
|
||||||
|
|
||||||
_, _, resultState = LLMMCTS.runMCTS(initialstate, transition, transitionargs;
|
root, _, resultState = LLMMCTS.runMCTS(initialstate, transition, transitionargs;
|
||||||
horizontalSampleExpansionPhase=5,
|
horizontalSampleExpansionPhase=5,
|
||||||
horizontalSampleSimulationPhase=2,
|
horizontalSampleSimulationPhase=2,
|
||||||
maxSimulationDepth=5,
|
maxSimulationDepth=5,
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ sessionId = "555"
|
|||||||
|
|
||||||
|
|
||||||
# query = Dict(:text=> "How many wines from France do you have that can be paired with lamb?")
|
# query = Dict(:text=> "How many wines from France do you have that can be paired with lamb?")
|
||||||
query = "How many French wines do you have?"
|
query = "How many German wines do you have?"
|
||||||
# query = "retailer: Yiem, wine_type: red, sweetness: 1-2, intensity: 4-5, wine price: 20-40"
|
# query = "retailer: Yiem, wine_type: red, sweetness: 1-2, intensity: 4-5, wine price: 20-40"
|
||||||
# query = "wine_type: white, country: United States, sweetness: 1-2, tannin: 3, food to be served with wine: pizza"
|
# query = "wine_type: white, country: United States, sweetness: 1-2, tannin: 3, food to be served with wine: pizza"
|
||||||
# query = "wine_type: white, country: Austria, food to be served with wine: pork"
|
# query = "wine_type: white, country: Austria, food to be served with wine: pork"
|
||||||
|
|||||||
@@ -1,23 +1,30 @@
|
|||||||
using Revise
|
using Revise
|
||||||
|
using SQLLLM, LLMMCTS, DataStructures
|
||||||
|
|
||||||
function testf(a)::NamedTuple{(:a, :b), Tuple{Union{Nothing, Int}, Int}}
|
initialstate = Dict{Symbol, Any}(
|
||||||
if a == 1
|
:reward=> 0,
|
||||||
return (a=nothing, b=5)
|
:isterminal=> false,
|
||||||
else
|
:evaluation=> "None",
|
||||||
return (a=5, b=5)
|
:evaluationscore=> 0,
|
||||||
end
|
:suggestion=> "None",
|
||||||
|
:accepted_as_answer=> "No",
|
||||||
|
:lesson=> nothing,
|
||||||
|
|
||||||
|
# contain question, thought_1, action_1, observation_1, thought_2, ...
|
||||||
|
:thoughtHistory=> OrderedDict{Symbol, Any}(
|
||||||
|
#[] :recap=>,
|
||||||
|
:question=> "query",
|
||||||
|
),
|
||||||
|
)
|
||||||
|
|
||||||
|
root = MCTSNode("root", initialstate, 0, 0, 0, 0, false, nothing, Dict{String,MCTSNode}(),
|
||||||
|
Dict{Symbol,Any}())
|
||||||
|
|
||||||
|
field = fieldnames(typeof(root))
|
||||||
|
for f in field
|
||||||
|
println(getfield(root, f))
|
||||||
|
setfield!(root, f, 1)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
q = testf(1)
|
println("\n done")
|
||||||
w = testf(2)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user