This commit is contained in:
narawat lamaiin
2024-08-17 22:32:16 +07:00
parent e1592f9d8e
commit 9d805fb3e7
3 changed files with 198 additions and 43 deletions

View File

@@ -445,6 +445,16 @@ function extractWineAttributes_1(a::T1, input::T2)::String where {T1<:agent, T2<
end
end
# check if region is mentioned in the input
if !occursin("NA", responsedict[:region]) && !occursin(responsedict[:region], input)
if attempt < maxattempt
errornote = "You are halucinating, $(responsedict[:region]) is not mentioned in the input"
error("$(responsedict[:region]) is not mentioned in the input")
else
responsedict[:region] = "NA"
end
end
responsedict[:flavors] = replace(responsedict[:flavors], "notes"=>"")
delete!(responsedict, :reasoning)
delete!(responsedict, :tasting_notes)