diff --git a/src/interface.jl b/src/interface.jl index 1370baf..d3dcb26 100644 --- a/src/interface.jl +++ b/src/interface.jl @@ -220,7 +220,7 @@ function decisionMaker(a::T)::Dict{Symbol, Any} where {T<:agent} Context: ... Your earlier conversation with the user: ... - You should follow the following DO guidelines: + You must follow the following DO guidelines: - If the user interrupts, prioritize the user then get back to the guidelines. - Get to know how much the user willing to spend - Get to know type of wine the user is looking for e.g. red, white, sparkling, rose, dessert, fortified diff --git a/src/llmfunction.jl b/src/llmfunction.jl index 6659046..0104d3d 100644 --- a/src/llmfunction.jl +++ b/src/llmfunction.jl @@ -366,6 +366,10 @@ function winestock(a::T1, input::T2 )::Union{Tuple{String, Number, Number, Bool}, Tuple{String, Nothing, Number, Bool}} where {T1<:agent, T2<:AbstractString} wineattributes = extractWineAttributes(a, input) + + # replace because SQLLLM didn't know what food_paired means + result = replace(wineattributes, "food_pairing" => "food_to_be_paired_with_wine") + result = SQLLLM.query(Dict(:text=> wineattributes), a.executeSQL, a.text2textInstructLLM) return result end @@ -439,7 +443,7 @@ function extractWineAttributes(a::T1, input::T2 - wine_type: Can be one of: red, white, sparkling, rose, dessert or fortified - price: ... - occasion: ... - - food_paired: food that will be served with wine + - food_pairing: food that will be served with wine - country: wine's country of origin - grape_variety: ... - tasting_notes: wine's flavors @@ -453,7 +457,7 @@ function extractWineAttributes(a::T1, input::T2 wine_type: ... price: ... occasion: ... - food_paired: ... + food_pairing: ... country: ... grape_variety: ... tasting_notes: ... @@ -492,7 +496,7 @@ function extractWineAttributes(a::T1, input::T2 <|start_header_id|>assistant<|end_header_id|> """ - attributes = ["repeat", "wine_type", "price", "occasion", "food_paired", "country", "grape_variety", "sweetness", "acidity", "tannin", "intensity"] + attributes = ["repeat", "wine_type", "price", "occasion", "food_pairing", "country", "grape_variety", "sweetness", "acidity", "tannin", "intensity"] for attempt in 1:5 try @@ -522,9 +526,6 @@ function extractWineAttributes(a::T1, input::T2 result = result[1:end-2] # remove the ending ", " - # replace because SQLLLM didn't know what food_paired means - result = replace(result, "food_paired" => "food_to_be_paired_with_wine") - return result catch e io = IOBuffer() diff --git a/test/runtest.jl b/test/runtest.jl index 943ed32..992ce66 100644 --- a/test/runtest.jl +++ b/test/runtest.jl @@ -94,7 +94,9 @@ end # main() -input = "query=\"off dry, medium tannin, French Rosé\"" + + +# input = "query=\"off dry, medium tannin, French Rosé\"" input = "wine_type: rose, country: France, sweetness: 2, tannin: 3" YiemAgent.winestock(a, input)