From 0148e03d6a8c7a7382e39ec7357eeb183d128d9d Mon Sep 17 00:00:00 2001 From: narawat Date: Thu, 16 Jul 2026 23:31:36 +0700 Subject: [PATCH] update --- src/interface.jl | 10 +++++----- src/llmfunction.jl | 10 +++------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/interface.jl b/src/interface.jl index 4cb306d..92ea76b 100644 --- a/src/interface.jl +++ b/src/interface.jl @@ -154,7 +154,7 @@ function decisionMaker(a::T; recentevents::Integer=20, maxattempt=10 continue end else - println("\nERROR YiemAgent decisionMaker() $errornote --(not qualify response)-> $responsedict", @__FILE__, ":", @__LINE__, " $(Dates.now())\n") + println("\nERROR YiemAgent decisionMaker() $errornote --(not qualify response)-> $responsedict ", @__FILE__, ":", @__LINE__, " $(Dates.now())\n") continue end @info "YiemAgent decisionMaker() 8 " @__LINE__ @@ -166,7 +166,7 @@ function decisionMaker(a::T; recentevents::Integer=20, maxattempt=10 @info "YiemAgent decisionMaker() 9 " @__LINE__ if !ispass errornote = errormsg - println("\nERROR YiemAgent decisionMaker() $errornote --(not qualify response)-> $responsedict", @__FILE__, ":", @__LINE__, " $(Dates.now())\n") + println("\nERROR YiemAgent decisionMaker() $errornote --(not qualify response)-> $responsedict ", @__FILE__, ":", @__LINE__, " $(Dates.now())\n") continue end @info "YiemAgent decisionMaker() 10 " @__LINE__ @@ -316,7 +316,7 @@ function evaluator(a::T1, timeline, decisiondict, evaluateecontext ispass, errormsg = checkAgentResponse_JSON(responsedict, requiredKeys) if !ispass errornote = errormsg - println("\nERROR YiemAgent evaluator() $errornote --(not qualify response)> $responsedict", @__FILE__, ":", @__LINE__, " $(Dates.now())\n") + println("\nERROR YiemAgent evaluator() $errornote --(not qualify response)> $responsedict ", @__FILE__, ":", @__LINE__, " $(Dates.now())\n") continue end @@ -757,7 +757,7 @@ function generatechat!(a::T; maxattempt::Integer=10 continue end else - println("\nERROR YiemAgent generatechat() $errornote --(not qualify response)> $responsedict", @__FILE__, ":", @__LINE__, " $(Dates.now())\n") + println("\nERROR YiemAgent generatechat() $errornote --(not qualify response)> $responsedict ", @__FILE__, ":", @__LINE__, " $(Dates.now())\n") continue end @@ -766,7 +766,7 @@ function generatechat!(a::T; maxattempt::Integer=10 ispass, errormsg = GeneralUtils.checkAgentResponse_JSON(responsedict, requiredKeys) if !ispass errornote = errormsg - println("\nERROR YiemAgent generatechat() $errornote --(not qualify response)> $responsedict", @__FILE__, ":", @__LINE__, " $(Dates.now())\n") + println("\nERROR YiemAgent generatechat() $errornote --(not qualify response)> $responsedict ", @__FILE__, ":", @__LINE__, " $(Dates.now())\n") continue end @info "YiemAgent generatechat!() 5 " @__LINE__ diff --git a/src/llmfunction.jl b/src/llmfunction.jl index 3c3fb65..21b566b 100644 --- a/src/llmfunction.jl +++ b/src/llmfunction.jl @@ -287,11 +287,11 @@ function search_wine_database!(a::T, thoughtdict::AbstractDict; useSQLLLM::Bool= )::NamedTuple{(:thoughtdict, :result_raw), Tuple{OrderedDict, Any}} where {T<:agent} println("\ncheckinventory order: $(thoughtdict["action_input"]) ", @__FILE__, ":", @__LINE__, " $(Dates.now())") - # wineattributes_1 = extractWineAttributes_1(a, thoughtdict["action_input"]) + wineattributes_1 = extractWineAttributes_1(a, thoughtdict["action_input"]) wineattributes_2 = extractWineAttributes_2(a, thoughtdict["action_input"]) retrieve_attributes = ["winery", "wine_name", "wine_id", "vintage", "region", "country", "wine_type", "grape", "serving_temperature", "sweetness", "intensity", "tannin", "acidity", "tasting_notes", "price", "currency", "image_url", "retailer_name", "retailer_id"] - _inventoryquery = "$(thoughtdict["action_input"]), $wineattributes_2, retailer_name: $(a.retailername), retailerid: $(a.retailerid)" + _inventoryquery = "$(thoughtdict["action_input"]), $wineattributes_1, $wineattributes_2, retailer_name: $(a.retailername), retailerid: $(a.retailerid)" inventoryquery = "Retrieves $retrieve_attributes of wines that match the following criteria - {$_inventoryquery}" println("\ncheckinventory input: $inventoryquery ", @__FILE__, ":", @__LINE__, " $(Dates.now())") @@ -698,7 +698,6 @@ function extractWineAttributes_1(a::T1, input::T2; maxattempt=10 wine_name: name of the wine winery: name of the winery vintage: the year of the wine - region: a region, such as Burgundy, Bordeaux, Champagne, Napa Valley, Tuscany, California, Oregon, etc. Use "or" if there are multiple regions. country: a country where wine is produced. Can be "Austria", "Australia", "France", "Germany", "Italy", "Portugal", "Spain", "United States". Use "or" if there are multiple countries. wine_type: can be one of: "red", "white", "sparkling", "rose", "dessert" or "fortified" grape_varietal: the name of the primary grape used to make the wine @@ -713,7 +712,6 @@ function extractWineAttributes_1(a::T1, input::T2; maxattempt=10 "wine_name": "...", "winery": "...", "vintage": "...", - "region": "...", "country": "...", "wine_type": "...", "grape_varietal": "...", @@ -728,7 +726,6 @@ function extractWineAttributes_1(a::T1, input::T2; maxattempt=10 "wine_name": "N/A", "winery": "N/A", "vintage": "N/A", - "region": "Tuscany or Napa Valley", "country": "Italy or United States", "wine_type": "red or white", "grape_varietal": "Chenin Blanc or Riesling", @@ -742,7 +739,6 @@ function extractWineAttributes_1(a::T1, input::T2; maxattempt=10 "wine_name": "Saumur Blanc", "winery": "Domaine du Collier", "vintage": "2019", - "region": "N/A", "country": "France", "wine_type": "white", "grape_varietal": "Merlot", @@ -753,7 +749,7 @@ function extractWineAttributes_1(a::T1, input::T2; maxattempt=10 "food_to_be_paired_with_wine": "N/A" """ - requiredKeys = ["wine_name", "winery", "vintage", "region", "country", "wine_type", "grape_varietal", "tasting_notes", "wine_price_min", "wine_price_max", "occasion", "food_to_be_paired_with_wine"] + requiredKeys = ["wine_name", "winery", "vintage", "country", "wine_type", "grape_varietal", "tasting_notes", "wine_price_min", "wine_price_max", "occasion", "food_to_be_paired_with_wine"] errornote = "" context = """