update
This commit is contained in:
@@ -441,10 +441,19 @@ function extractWineAttributes_1(a::T1, input::T2)::String where {T1<:agent, T2<
|
||||
end
|
||||
|
||||
# check whether max wine_price is in the input
|
||||
maxprice = split(responsedict[:wine_price], '-')[end]
|
||||
pricerange = split(responsedict[:wine_price], '-')
|
||||
minprice = pricerange[1]
|
||||
maxprice = pricerange[end]
|
||||
if !occursin(maxprice, input)
|
||||
responsedict[:wine_price] = "NA"
|
||||
end
|
||||
# price range like 100-100 is not good
|
||||
if minprice == maxprice
|
||||
errornote = "wine_price with minimum equals to maximum is not valid"
|
||||
println("Attempt $attempt $errornote ", Dates.now(), " ", @__FILE__, " ", @__LINE__)
|
||||
checkFlag = true
|
||||
break
|
||||
end
|
||||
end
|
||||
else
|
||||
content = responsedict[j]
|
||||
@@ -457,7 +466,7 @@ function extractWineAttributes_1(a::T1, input::T2)::String where {T1<:agent, T2<
|
||||
content = [content]
|
||||
end
|
||||
|
||||
for x in content #BUG why x is "0-1500"
|
||||
for x in content #check whether price are mentioned in the input
|
||||
if !occursin("NA", responsedict[j]) && !occursin(x, input)
|
||||
errornote = "$x is not mentioned in the user query, you must only use the info from the query."
|
||||
println("Attempt $attempt $errornote ", Dates.now(), " ", @__FILE__, " ", @__LINE__)
|
||||
@@ -468,7 +477,7 @@ function extractWineAttributes_1(a::T1, input::T2)::String where {T1<:agent, T2<
|
||||
end
|
||||
end
|
||||
end
|
||||
checkFlag == true ? continue : nothing
|
||||
checkFlag == true ? continue : nothing # skip the rest code if true
|
||||
|
||||
# remove (some text)
|
||||
for (k, v) in responsedict
|
||||
|
||||
Reference in New Issue
Block a user