update
This commit is contained in:
@@ -389,6 +389,10 @@ function extractWineAttributes_1(a::T1, input::T2)::String where {T1<:agent, T2<
|
||||
for attempt in 1:10
|
||||
#[WORKING] I should add generatequestion()
|
||||
|
||||
if attempt > 1
|
||||
println("\nYiemAgent extractWineAttributes_1() attempt $attempt/10 ", @__FILE__, ":", @__LINE__, " $(Dates.now())")
|
||||
end
|
||||
|
||||
usermsg =
|
||||
"""
|
||||
User's query: $input
|
||||
@@ -449,7 +453,7 @@ function extractWineAttributes_1(a::T1, input::T2)::String where {T1<:agent, T2<
|
||||
# check whether wine_price is in ranged number
|
||||
if !occursin('-', responsedict[:wine_price])
|
||||
errornote = "wine_price must be a range number"
|
||||
println("Attempt $attempt $errornote ", @__FILE__, ":", @__LINE__, " $(Dates.now())")
|
||||
println("ERROR YiemAgent extractWineAttributes_1() $errornote ", @__FILE__, ":", @__LINE__, " $(Dates.now())")
|
||||
checkFlag = true
|
||||
break
|
||||
end
|
||||
@@ -464,7 +468,7 @@ function extractWineAttributes_1(a::T1, input::T2)::String where {T1<:agent, T2<
|
||||
# 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 ", @__FILE__, ":", @__LINE__, " $(Dates.now())")
|
||||
println("ERROR YiemAgent extractWineAttributes_1() $errornote ", @__FILE__, ":", @__LINE__, " $(Dates.now())")
|
||||
checkFlag = true
|
||||
break
|
||||
end
|
||||
@@ -480,14 +484,14 @@ function extractWineAttributes_1(a::T1, input::T2)::String where {T1<:agent, T2<
|
||||
content = [content]
|
||||
end
|
||||
|
||||
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 ", @__FILE__, ":", @__LINE__, " $(Dates.now())")
|
||||
checkFlag == true
|
||||
break
|
||||
end
|
||||
end
|
||||
# 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("ERROR YiemAgent extractWineAttributes_1() $errornote ", @__FILE__, ":", @__LINE__, " $(Dates.now())")
|
||||
# checkFlag == true
|
||||
# break
|
||||
# end
|
||||
# end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user