update
This commit is contained in:
@@ -1,23 +1,30 @@
|
||||
using Revise
|
||||
using SQLLLM, LLMMCTS, DataStructures
|
||||
|
||||
function testf(a)::NamedTuple{(:a, :b), Tuple{Union{Nothing, Int}, Int}}
|
||||
if a == 1
|
||||
return (a=nothing, b=5)
|
||||
else
|
||||
return (a=5, b=5)
|
||||
end
|
||||
initialstate = Dict{Symbol, Any}(
|
||||
:reward=> 0,
|
||||
:isterminal=> false,
|
||||
:evaluation=> "None",
|
||||
:evaluationscore=> 0,
|
||||
: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
|
||||
|
||||
|
||||
q = testf(1)
|
||||
w = testf(2)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
println("\n done")
|
||||
Reference in New Issue
Block a user