update
This commit is contained in:
@@ -499,7 +499,7 @@ julia>
|
|||||||
function evaluator(state::T1, text2textInstructLLM::Function;
|
function evaluator(state::T1, text2textInstructLLM::Function;
|
||||||
addSQLVectorDB::Union{Function, Nothing}=nothing
|
addSQLVectorDB::Union{Function, Nothing}=nothing
|
||||||
) where {T1<:AbstractDict}
|
) where {T1<:AbstractDict}
|
||||||
|
println("Evaluating state", @__FILE__, " ", @__LINE__)
|
||||||
# systemmsg =
|
# systemmsg =
|
||||||
# """
|
# """
|
||||||
# You are a helpful assistant that analyzes agent's trajectories to find solutions and observations (i.e., the results of actions) to answer the user's questions.
|
# You are a helpful assistant that analyzes agent's trajectories to find solutions and observations (i.e., the results of actions) to answer the user's questions.
|
||||||
@@ -982,7 +982,7 @@ function transition(state::T, args::NamedTuple
|
|||||||
if actionname == "listalltables"
|
if actionname == "listalltables"
|
||||||
# deepcopy(state[:virtualCustomerChatHistory]) because I want to keep it clean
|
# deepcopy(state[:virtualCustomerChatHistory]) because I want to keep it clean
|
||||||
# so that other simulation start from this same node is not contaminated with actioninput
|
# so that other simulation start from this same node is not contaminated with actioninput
|
||||||
listAllTable_json(executeSQLF) # virtual customer
|
listAllTable_json(executeSQLF)
|
||||||
elseif actionname == "TABLEINFO"
|
elseif actionname == "TABLEINFO"
|
||||||
input = copy(JSON3.read(actioninput))
|
input = copy(JSON3.read(actioninput))
|
||||||
tableinfo(executeSQLF, input)
|
tableinfo(executeSQLF, input)
|
||||||
@@ -1002,7 +1002,7 @@ function transition(state::T, args::NamedTuple
|
|||||||
success::Bool = haskey(response, :success) ? response[:success] : false
|
success::Bool = haskey(response, :success) ? response[:success] : false
|
||||||
|
|
||||||
newNodeKey, newstate = makeNewState(state, thoughtDict, JSON3.write(result), select, reward, isterminal)
|
newNodeKey, newstate = makeNewState(state, thoughtDict, JSON3.write(result), select, reward, isterminal)
|
||||||
|
println("SQLLLM transition() 1 ", @__FILE__, " ", @__LINE__)
|
||||||
progressvalue::Integer = evaluatorF(newstate, text2textInstructLLM;
|
progressvalue::Integer = evaluatorF(newstate, text2textInstructLLM;
|
||||||
addSQLVectorDB=addSQLVectorDBF)
|
addSQLVectorDB=addSQLVectorDBF)
|
||||||
|
|
||||||
@@ -1090,8 +1090,8 @@ function query(query::T, executeSQL::Function, text2textInstructLLM::Function;
|
|||||||
addSQLVectorDB::Union{Function, Nothing}=nothing,
|
addSQLVectorDB::Union{Function, Nothing}=nothing,
|
||||||
querySQLVectorDB::Union{Function, Nothing}=nothing
|
querySQLVectorDB::Union{Function, Nothing}=nothing
|
||||||
)::String where {T<:AbstractString}
|
)::String where {T<:AbstractString}
|
||||||
# add extra context for Evaluator so that it knows the observation is from seaching a database
|
#[WORKING] add extra context for Evaluator so that it knows the observation is from seaching a database
|
||||||
query = "Search the database for " * query
|
query = "Search the database for {$query}"
|
||||||
initialstate = Dict{Symbol, Any}(
|
initialstate = Dict{Symbol, Any}(
|
||||||
:reward=> 0,
|
:reward=> 0,
|
||||||
:isterminal=> false,
|
:isterminal=> false,
|
||||||
|
|||||||
@@ -341,7 +341,7 @@ function getdata_transition(state::T, args::NamedTuple
|
|||||||
reward=0,
|
reward=0,
|
||||||
isterminal=false)
|
isterminal=false)
|
||||||
end
|
end
|
||||||
|
println("getdata_transition() 1 ", @__FILE__, " ", @__LINE__)
|
||||||
newstate[:code] = sql
|
newstate[:code] = sql
|
||||||
newstate[:response] = response
|
newstate[:response] = response
|
||||||
newstate[:errorexplain] = thought
|
newstate[:errorexplain] = thought
|
||||||
@@ -352,7 +352,7 @@ function getdata_transition(state::T, args::NamedTuple
|
|||||||
extracted = extractContent_dataframe(response, context, text2textInstructLLM)
|
extracted = extractContent_dataframe(response, context, text2textInstructLLM)
|
||||||
newstate[:response] = extracted
|
newstate[:response] = extracted
|
||||||
end
|
end
|
||||||
|
println("getdata_transition() 2 ", @__FILE__, " ", @__LINE__)
|
||||||
stateevaluation = "None"
|
stateevaluation = "None"
|
||||||
progressvalue = 0
|
progressvalue = 0
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user