diff --git a/src/interface.jl b/src/interface.jl index 8a89c8b..431bd54 100644 --- a/src/interface.jl +++ b/src/interface.jl @@ -302,7 +302,7 @@ function decisionMaker(a::T)::Dict{Symbol, Any} where {T<:agent} end for i ∈ [:thought, :plan, :action_name] - if length(JSON3.write(responsedict[i])) == 0 + if length(responsedict[i]) == 0 error("$i is empty ", @__LINE__) end end @@ -321,8 +321,8 @@ function decisionMaker(a::T)::Dict{Symbol, Any} where {T<:agent} isMemEmpty = isempty(a.memory[:shortmem]) if occursin("Yes", responsedict[:recommending_wine]) && isMemEmpty && responsedict[:action_name] != "CHECKINVENTORY" - checkinventory_flag = "You must check inventory before recommending wine to the user." - error( "You must check inventory before recommending wine") + checkinventory_flag = "You must check your inventory before recommending wine to the user." + error( "You must check your inventory before recommending wine") else checkinventory_flag = "" end diff --git a/src/llmfunction.jl b/src/llmfunction.jl index ccff2de..957133c 100644 --- a/src/llmfunction.jl +++ b/src/llmfunction.jl @@ -345,9 +345,9 @@ function extractWineAttributes_1(a::T1, input::T2 - occasion: ... - food_to_be_paired_with_wine: food that will be served with wine - country: wine's country of origin - - grape_variety: ... - - tasting_notes: dry, full bodied or something similar - - flavor: what the wine tast like? e.g. floral, citrus, earthy, fruity, tropical, nutty or something similar + - grape variety: Name of grape used to make wine. + - flavors: wine's flavor + - aromas: wine's aroma You should only respond in the form as described below: wine_type: ... @@ -356,8 +356,8 @@ function extractWineAttributes_1(a::T1, input::T2 food_to_be_paired_with_wine: ... country: ... grape_variety: ... - tasting_notes: ... - flavor: ... + flavors: ... + aromas: ... Let's begin! """ @@ -380,7 +380,7 @@ function extractWineAttributes_1(a::T1, input::T2 <|start_header_id|>assistant<|end_header_id|> """ - attributes = ["wine_type", "price", "occasion", "food_to_be_paired_with_wine", "country", "grape_variety", "tasting_notes", "flavor"] + attributes = ["wine_type", "price", "occasion", "food_to_be_paired_with_wine", "country", "grape_variety", "flavors", "aromas"] for attempt in 1:5 try @@ -393,8 +393,10 @@ function extractWineAttributes_1(a::T1, input::T2 end end - #[TESTING] remove tasting_notes because the database didn't prepare to be search using it - responsedict[:tasting_notes] = responsedict[:flavor] + responsedict[:flavors] = replace(responsedict[:flavors], "notes"=>"") #BUG no method matching + responsedict[:tasting_notes] = responsedict[:flavors] + delete!(responsedict, :flavors) + delete!(responsedict, :aromas) result = "" for (k, v) in responsedict diff --git a/test/runtest.jl b/test/runtest.jl index 9c95573..f2f0d6f 100644 --- a/test/runtest.jl +++ b/test/runtest.jl @@ -88,9 +88,9 @@ end main() """ -I'm having a graduation party this evening. I have no budget limit. I want a bottle of dry white wine. +I'm having a graduation party this evening. I have unlimited budget. I want a bottle of dry white wine. The party will be casual with no food serving. -I'm open to suggestion since I have no specific idea about wine other than I like full bodied wine from France. +I'm open to suggestion since I have no specific idea about wine other than I like full bodied wine from France. The latter one seems nice. """