From 197b1c328836584aa1acbebadb706311acad59ff Mon Sep 17 00:00:00 2001 From: narawat lamaiin Date: Fri, 19 Jul 2024 20:18:27 +0700 Subject: [PATCH] update --- src/interface.jl | 2 +- src/llmfunction.jl | 12 ++++++------ test/runtest.jl | 3 ++- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/interface.jl b/src/interface.jl index d5a2cdb..8cf9c27 100644 --- a/src/interface.jl +++ b/src/interface.jl @@ -235,7 +235,7 @@ function decisionMaker(a::T)::Dict{Symbol, Any} where {T<:agent} You should then respond to the user with interleaving Thought, Plan, Action and Observation: - thought: 1) State your reasoning about the current situation. - - plan: Based on the current situation, what would you do to complete the task? Be specific. + - plan: Based on the current situation, state a complete plan to complete the task. Be specific. - action (Must be aligned with your plan): Can be one of the following functions: 1) CHATBOX[text], which you can use to talk with the user. "text" is in verbal English. 2) WINESTOCK[query], which you can use to find info about wine in your inventory. "query" is a search term in verbal English. The best query must includes "budget", "type of wine", "characteristics of wine" and "food pairing". diff --git a/src/llmfunction.jl b/src/llmfunction.jl index 06319f2..c49a536 100644 --- a/src/llmfunction.jl +++ b/src/llmfunction.jl @@ -437,7 +437,7 @@ function extractWineAttributes(a::T1, input::T2 You should then respond to the user with the following points: - wine_type: Can be one of: red, white, sparkling, rose, dessert or fortified - - budget: ... + - price: ... - occasion: ... - food_pairing: food that will be served with wine - country: wine's country of origin @@ -451,7 +451,7 @@ function extractWineAttributes(a::T1, input::T2 You should only respond in format as described below: repeat: repeat the user's query wine_type: ... - budget: ... + price: ... occasion: ... food_pairing: ... country: ... @@ -465,10 +465,10 @@ function extractWineAttributes(a::T1, input::T2 Here are some examples: user: "price < 25, for wedding party, full-bodied white wine with sweetness level 2, apple and honey notes, low tannin level and medium acidity level, Pizza, France, Riesling" - assistant: repeat: ... \n wine_type: white\n budget: less than 25\n occasion: wedding party\n food_pairing: Pizza\n country: France\n grape_variety: Riesling\n tasting_notes: apple, honey\n sweetness: 2\n acidity: 3\n tannin: 1\n intensity: 5 + assistant: repeat: ... \n wine_type: white\n price: less than 25\n occasion: wedding party\n food_pairing: Pizza\n country: France\n grape_variety: Riesling\n tasting_notes: apple, honey\n sweetness: 2\n acidity: 3\n tannin: 1\n intensity: 5 user: body=full-bodied, dry, acidity=medium and low tannin - assistant: repeat: ... \n wine_type: NA\n budget: NA\n occasion: NA\n food_pairing: NA\n country: NA\n grape_variety: NA\n tasting_notes: NA\n sweetness: 1\n acidity: 3\n tannin: 1\n intensity: 5 + assistant: repeat: ... \n wine_type: NA\n price: NA\n occasion: NA\n food_pairing: NA\n country: NA\n grape_variety: NA\n tasting_notes: NA\n sweetness: 1\n acidity: 3\n tannin: 1\n intensity: 5 Let's begin! """ @@ -492,7 +492,7 @@ function extractWineAttributes(a::T1, input::T2 <|start_header_id|>assistant<|end_header_id|> """ - attributes = ["repeat", "wine_type", "budget", "occasion", "food_pairing", "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 @@ -515,7 +515,7 @@ function extractWineAttributes(a::T1, input::T2 result = "" for (k, v) in responsedict - if k != :repeat && v != "NA" + if k != :repeat && !occursin("NA", v) result *= "$k: $v, " end end diff --git a/test/runtest.jl b/test/runtest.jl index e15f823..943ed32 100644 --- a/test/runtest.jl +++ b/test/runtest.jl @@ -94,7 +94,8 @@ end # main() -input = "query=\"off dry, medium tannin, French Rosé and spicy Thai food pairing under 30 dollars\"" +input = "query=\"off dry, medium tannin, French Rosé\"" +input = "wine_type: rose, country: France, sweetness: 2, tannin: 3" YiemAgent.winestock(a, input)