diff --git a/src/interface.jl b/src/interface.jl index f2e4eda..989538a 100755 --- a/src/interface.jl +++ b/src/interface.jl @@ -220,7 +220,8 @@ function planner_mistral_openorca(a::agentReflex) Plan: """ - plan = sendReceivePrompt(a, assistant_plan_prompt, max_tokens=1024, temperature=0.1, stopword=["<|user|>", "", " 5 # print all check_1 to check_6 - println("check_1: $check_1, check_2: $check_2, check_3: $check_3, check_4: $check_4, check_5: $check_5, check_6: $check_6") + println("check_1: $check_1, check_2: $check_2, check_3: $check_3, check_4: $check_4, + check_5: $check_5, check_6: $check_6, check_7: $check_7") - if check_1 && check_2 && check_3 && check_4 && check_5 && check_6 + if check_1 && check_2 && check_3 && check_4 && check_5 && check_6 && check_7 + #WORKING paraphrase selfaware break end + @show response end toolname = toolNameBeingCalled(chunkedtext["Act $latestTask:"], a.tools) @@ -920,7 +927,7 @@ function work(a::agentReflex) latestTask = shortMemLatestTask(a.memory[:shortterm]) if haskey(a.memory[:shortterm], "Act $latestTask:") if occursin("askbox", a.memory[:shortterm]["Act $latestTask:"]) - a.memory[:shortterm]["Obs $latestTask:"] = a.messages[end][:content] + a.memory[:shortterm]["Obs $latestTask:"] = "(user response) " * a.messages[end][:content] end end end @@ -1202,7 +1209,7 @@ function grading(a, guideline::T, text::T) where {T<:AbstractString} prompt_grading = prompt @show prompt_grading println("") - response = sendReceivePrompt(a, prompt) + response = sendReceivePrompt(a, prompt, timeout=180) response = "{" * split(response, "}")[1] * "}" @show response @show jsonresponse = JSON3.read(response) diff --git a/src/llmfunction.jl b/src/llmfunction.jl index 8f7e03a..dc4028a 100644 --- a/src/llmfunction.jl +++ b/src/llmfunction.jl @@ -152,7 +152,7 @@ function winestock(a::agentReflex, query::Dict) Consult the conversion table then write a specific SQL command using only available info from a JSON-format query. - List of keywords not allowed in SQL: ["BETWEEN", "--", "WHEN] + List of keywords not allowed in SQL: ["BETWEEN", "--", "WHEN", "IN"] query: {\"wine type\": \"white\", \"wine characteristics\": \"full-bodied | off-dry | low acidity | medium tannin\", \"price\": {\"max\": \"50\"}} @@ -177,13 +177,14 @@ function winestock(a::agentReflex, query::Dict) # check for valid SQL command check_1 = occursin("BETWEEN", _sql) check_2 = occursin("--", _sql) + check_3 = occursin("IN", _sql) - if check_1 == false && check_2 == false + if check_1 == false && check_2 == false && check_3 == false break end end println("") - @show db_sql = replace(_sql, '\n'=>'') + @show db_sql = replace(_sql, '\n'=>"") # remove any blank character in front of a string newsql = nothing