From 7b2d85da482641daf483af19505cb149433597c5 Mon Sep 17 00:00:00 2001 From: narawat lamaiin Date: Sun, 13 Oct 2024 06:39:05 +0700 Subject: [PATCH] update --- src/interface.jl | 10 +++++----- src/llmfunction.jl | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/interface.jl b/src/interface.jl index 9ce0078..80c4e31 100644 --- a/src/interface.jl +++ b/src/interface.jl @@ -499,7 +499,7 @@ julia> function evaluator(state::T1, text2textInstructLLM::Function; addSQLVectorDB::Union{Function, Nothing}=nothing ) where {T1<:AbstractDict} - + println("Evaluating state", @__FILE__, " ", @__LINE__) # 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. @@ -982,7 +982,7 @@ function transition(state::T, args::NamedTuple if actionname == "listalltables" # deepcopy(state[:virtualCustomerChatHistory]) because I want to keep it clean # 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" input = copy(JSON3.read(actioninput)) tableinfo(executeSQLF, input) @@ -1002,7 +1002,7 @@ function transition(state::T, args::NamedTuple success::Bool = haskey(response, :success) ? response[:success] : false newNodeKey, newstate = makeNewState(state, thoughtDict, JSON3.write(result), select, reward, isterminal) - + println("SQLLLM transition() 1 ", @__FILE__, " ", @__LINE__) progressvalue::Integer = evaluatorF(newstate, text2textInstructLLM; addSQLVectorDB=addSQLVectorDBF) @@ -1090,8 +1090,8 @@ function query(query::T, executeSQL::Function, text2textInstructLLM::Function; addSQLVectorDB::Union{Function, Nothing}=nothing, querySQLVectorDB::Union{Function, Nothing}=nothing )::String where {T<:AbstractString} - # add extra context for Evaluator so that it knows the observation is from seaching a database - query = "Search the database for " * query + #[WORKING] add extra context for Evaluator so that it knows the observation is from seaching a database + query = "Search the database for {$query}" initialstate = Dict{Symbol, Any}( :reward=> 0, :isterminal=> false, diff --git a/src/llmfunction.jl b/src/llmfunction.jl index 951bb57..0c55e2e 100644 --- a/src/llmfunction.jl +++ b/src/llmfunction.jl @@ -341,7 +341,7 @@ function getdata_transition(state::T, args::NamedTuple reward=0, isterminal=false) end - + println("getdata_transition() 1 ", @__FILE__, " ", @__LINE__) newstate[:code] = sql newstate[:response] = response newstate[:errorexplain] = thought @@ -352,7 +352,7 @@ function getdata_transition(state::T, args::NamedTuple extracted = extractContent_dataframe(response, context, text2textInstructLLM) newstate[:response] = extracted end - + println("getdata_transition() 2 ", @__FILE__, " ", @__LINE__) stateevaluation = "None" progressvalue = 0