This commit is contained in:
narawat lamaiin
2024-10-16 13:10:17 +07:00
parent 7ba7e0c639
commit 55701d6743
2 changed files with 166 additions and 930 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -454,8 +454,8 @@ function extractWineAttributes_1(a::T1, input::T2)::String where {T1<:agent, T2<
# check if grape_variety is mentioned in the input # check if grape_variety is mentioned in the input
if !occursin("NA", responsedict[:grape_variety]) && !occursin(responsedict[:grape_variety], input) if !occursin("NA", responsedict[:grape_variety]) && !occursin(responsedict[:grape_variety], input)
if attempt < maxattempt if attempt < maxattempt
errornote = "You are halucinating, $(responsedict[:grape_variety]) is not mentioned in the input" errornote = "$(responsedict[:grape_variety]) is not mentioned in the user query, you must only use the info from the query.."
error("$(responsedict[:grape_variety]) is not mentioned in the input") error("$(responsedict[:grape_variety]) is not mentioned in the user query, you must only use the info from the query.")
else else
responsedict[:grape_variety] = "NA" responsedict[:grape_variety] = "NA"
end end
@@ -464,8 +464,8 @@ function extractWineAttributes_1(a::T1, input::T2)::String where {T1<:agent, T2<
# check if region is mentioned in the input # check if region is mentioned in the input
if !occursin("NA", responsedict[:region]) && !occursin(responsedict[:region], input) if !occursin("NA", responsedict[:region]) && !occursin(responsedict[:region], input)
if attempt < maxattempt if attempt < maxattempt
errornote = "You are halucinating, $(responsedict[:region]) is not mentioned in the input" errornote = "$(responsedict[:region]) is not mentioned in the user query, you must only use the info from the query.."
error("$(responsedict[:region]) is not mentioned in the input") error("$(responsedict[:region]) is not mentioned in the user query, you must only use the info from the query..")
else else
responsedict[:region] = "NA" responsedict[:region] = "NA"
end end
@@ -506,7 +506,7 @@ function extractWineAttributes_1(a::T1, input::T2)::String where {T1<:agent, T2<
errorMsg = String(take!(io)) errorMsg = String(take!(io))
st = sprint((io, v) -> show(io, "text/plain", v), stacktrace(catch_backtrace())) st = sprint((io, v) -> show(io, "text/plain", v), stacktrace(catch_backtrace()))
println("") println("")
println("Attempt $attempt. Error occurred: $errorMsg\n$st") println("Attempt $attempt. Error occurred: $errorMsg\n$st ", @__FILE__, " ", @__LINE__)
println("") println("")
end end
end end