From c46f670f7ae7c0e47cb6e332c41a99f6240ef8fa Mon Sep 17 00:00:00 2001 From: narawat lamaiin Date: Mon, 14 Oct 2024 21:14:32 +0700 Subject: [PATCH] update --- src/interface.jl | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) 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))