This commit is contained in:
2024-01-15 15:00:13 +00:00
parent 4052fe92b3
commit 0f59725ac4
2 changed files with 308 additions and 25 deletions

View File

@@ -151,16 +151,16 @@ function winestock(a::agentReflex, query::Dict)
acidity = 5, high acidity
</You have the following conversion table>
<Your job>
Consult the conversion table then write a specific SQL command from a JSON-format query.
List of keywords not allowed in SQL: ["BETWEEN", "--"]
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]
</Your job>
<Example 1>
query: {\"wine type\": \"white\", \"wine characteristics\": \"full-bodied | off-dry | low acidity | medium tannin\", \"price\": {\"max\": \"50\"}}
assistant: SELECT * FROM White WHERE intensity = 5 AND sweetness = 2 AND acidity = 1 AND tannin = 3 AND price <= 50;
</Example 1>
<Example 2>
query: {\"wine characteristics\":\"low-bodied | semi-sweet | low tannin\",\"price\":\"22 USD\",\"occasion\":\"anniversary\",\"wine type\":\"Rose\",\"food\":\"American dishes\"}
assistant: SELECT * FROM Rose WHERE intensity = 1 AND sweetness = 3 AND tannin = 1 AND price <= 22;
query: {\"wine characteristics\":\"low-bodied | semi-sweet | low-medium tannin\",\"price\":\"22 USD\",\"occasion\":\"anniversary\",\"wine type\":\"Rose\",\"food\":\"American dishes\"}
assistant: SELECT * FROM Rose WHERE intensity = 1 AND sweetness = 3 AND (tannin = 2 OR tannin = 3) AND price <= 22;
</Example 2>
</s>
<|query|>
@@ -183,7 +183,7 @@ function winestock(a::agentReflex, query::Dict)
end
end
println("")
@show db_sql = _sql
@show db_sql = replace(_sql, '\n'=>'')
# remove any blank character in front of a string
newsql = nothing