diff --git a/src/interface.jl b/src/interface.jl index 6f0b0ea..f7ed806 100644 --- a/src/interface.jl +++ b/src/interface.jl @@ -733,15 +733,18 @@ function evaluator(state::T1, text2textInstructLLM::Function; # mark as terminal state when the answer is achieved if accepted_as_answer == "Yes" + + # add to vectorDB only if the answer is achieved and the state is terminal + # (found some row in the database) + if addSQLVectorDB !== nothing && state[:isterminal] == true + addSQLVectorDB(state) + end + + # mark the state as terminal state because the evaluation say so. state[:isterminal] = true # user score as reward because different answers hold different value for the user. state[:reward] = responsedict[:score] - - # add to vectorDB - if addSQLVectorDB !== nothing - addSQLVectorDB(state) - end end println("\n~~~ Evaluator() ", @__FILE__, " ", @__LINE__) pprintln(Dict(responsedict))