update
This commit is contained in:
@@ -152,7 +152,7 @@ function winestock(a::agentReflex, query::Dict)
|
||||
</You have the following conversion table>
|
||||
<Your job>
|
||||
Consult the conversion table then write a specific SQL command using only available info from a JSON-format query.
|
||||
List of keywords not allowed in SQL: ["BETWEEN", "--", "WHEN]
|
||||
List of keywords not allowed in SQL: ["BETWEEN", "--", "WHEN", "IN"]
|
||||
</Your job>
|
||||
<Example 1>
|
||||
query: {\"wine type\": \"white\", \"wine characteristics\": \"full-bodied | off-dry | low acidity | medium tannin\", \"price\": {\"max\": \"50\"}}
|
||||
@@ -177,13 +177,14 @@ function winestock(a::agentReflex, query::Dict)
|
||||
# check for valid SQL command
|
||||
check_1 = occursin("BETWEEN", _sql)
|
||||
check_2 = occursin("--", _sql)
|
||||
check_3 = occursin("IN", _sql)
|
||||
|
||||
if check_1 == false && check_2 == false
|
||||
if check_1 == false && check_2 == false && check_3 == false
|
||||
break
|
||||
end
|
||||
end
|
||||
println("")
|
||||
@show db_sql = replace(_sql, '\n'=>'')
|
||||
@show db_sql = replace(_sql, '\n'=>"")
|
||||
|
||||
# remove any blank character in front of a string
|
||||
newsql = nothing
|
||||
|
||||
Reference in New Issue
Block a user