This commit is contained in:
narawat lamaiin
2025-04-27 22:32:22 +07:00
parent d9c842bba5
commit bf223b64b2
2 changed files with 47 additions and 48 deletions
+9 -6
View File
@@ -856,7 +856,7 @@ function compareState(question::String, highValueStateList::Vector{T},
Result: 50 red wines
Comparison: The second attempt counts only German red wines while the first attempt includes all German wines.
Rationale: The user is asking for the number of German wines without specifying a type, so the most accurate response is the first attempt because it includes all German wines.
Selected_response_number: 1
Selected_response_number:1
</Here are some examples>
Let's begin!
@@ -908,6 +908,7 @@ function compareState(question::String, highValueStateList::Vector{T},
"""
Question: $question
Attempts: $potentialSolutionStr
P.S. $errornote
"""
_prompt =
@@ -933,21 +934,23 @@ function compareState(question::String, highValueStateList::Vector{T},
for i in header
detected = GeneralUtils.detect_keyword(i, response)
if detected === nothing
errornote = "Your previous response didn't provide $i"
errornote = "Your previous attempt didn't provide $i"
errorFlag = true
end
end
if errorFlag
if errorFlag
println("\nERROR SQLLLM compareState() Attempt $attempt $errornote ", @__FILE__, ":", @__LINE__, " $(Dates.now())")
continue # skip to the next iteration
end
responsedict = GeneralUtils.textToDict(response, header;
dictKey=dictkey, symbolkey=true)
responsedict = GeneralUtils.textToDict(response, header; dictKey=dictkey, symbolkey=true)
responsedict[:selected_response_number] = responsedict[:selected_response_number][1] # some time "6\nThe trajectories are incomplete" is generated but I only need the number.
try
responsedict[:selected_response_number] = parse(Int, responsedict[:selected_response_number]) # convert string "5" into integer 5
catch
errornote = "In your previous attempt, Selected_response_number was not a number. It must be a number."
println("\nERROR SQLLLM compareState() Attempt $attempt. $errornote ", @__FILE__, ":", @__LINE__, " $(Dates.now())")
continue
end