This commit is contained in:
narawat lamaiin
2025-05-17 21:36:29 +07:00
parent 68c2c2f12b
commit 3a88e0e7d4
2 changed files with 13 additions and 11 deletions

View File

@@ -99,7 +99,7 @@ julia> output_thoughtDict = Dict(
""" """
function decisionMaker(a::T; recentevents::Integer=20, maxattempt=10 function decisionMaker(a::T; recentevents::Integer=20, maxattempt=10
) where {T<:agent} ) where {T<:agent}
println("\nExecuting YiemAgent decisionMaker()")
# lessonDict = copy(JSON3.read("lesson.json")) # lessonDict = copy(JSON3.read("lesson.json"))
# lesson = # lesson =
@@ -859,9 +859,9 @@ function evaluator(a::T1, timeline, decisiondict, evaluateecontext
</You should then respond to the user with> </You should then respond to the user with>
<You should only respond in JSON format as described below> <You should only respond in JSON format as described below>
{ {
"trajectory_evaluation": "..." "trajectory_evaluation": "...",
"decision_evaluation": "..." "decision_evaluation": "...",
"approved": "..." "approved": "...",
"suggestion": "..." "suggestion": "..."
} }
</You should only respond in format as described below> </You should only respond in format as described below>
@@ -1215,14 +1215,14 @@ function think(a::T)::NamedTuple{(:actionname, :result),Tuple{String,String}} wh
a.memory[:shortmem][:scratchpad] *= a.memory[:shortmem][:scratchpad] *=
""" """
<database_search_result> <database_search_result>
I searched the database with this search term: $actioninput This is what I found: $result I searched the database with this search term: $actioninput \nThis is what I found: $result
</database_search_result> </database_search_result>
""" """
else else
a.memory[:shortmem][:scratchpad] *= a.memory[:shortmem][:scratchpad] *=
""" """
<database_search_result> <database_search_result>
I searched the database with this search term: $actioninput This is what I found: $result I searched the database with this search term: $actioninput \nThis is what I found: $result
</database_search_result> </database_search_result>
""" """
end end

View File

@@ -295,7 +295,9 @@ function checkinventory(a::T1, input::T2
wineattributes_1 = extractWineAttributes_1(a, input) wineattributes_1 = extractWineAttributes_1(a, input)
wineattributes_2 = extractWineAttributes_2(a, input) wineattributes_2 = extractWineAttributes_2(a, input)
_inventoryquery = "retailer name: $(a.retailername), $wineattributes_1, $wineattributes_2" #CHANGE if you want to add retailer name
# _inventoryquery = "retailer name: $(a.retailername), $wineattributes_1, $wineattributes_2"
_inventoryquery = "$wineattributes_1, $wineattributes_2"
inventoryquery = "Retrieves winery, wine_name, wine_id, vintage, region, country, wine_type, grape, serving_temperature, sweetness, intensity, tannin, acidity, tasting_notes, price and currency of wines that match the following criteria - {$_inventoryquery}" inventoryquery = "Retrieves winery, wine_name, wine_id, vintage, region, country, wine_type, grape, serving_temperature, sweetness, intensity, tannin, acidity, tasting_notes, price and currency of wines that match the following criteria - {$_inventoryquery}"
println("\ncheckinventory input: $inventoryquery ", @__FILE__, ":", @__LINE__, " $(Dates.now())") println("\ncheckinventory input: $inventoryquery ", @__FILE__, ":", @__LINE__, " $(Dates.now())")
# add suppport for similarSQLVectorDB # add suppport for similarSQLVectorDB
@@ -304,7 +306,7 @@ function checkinventory(a::T1, input::T2
insertSQLVectorDB=a.func[:insertSQLVectorDB], insertSQLVectorDB=a.func[:insertSQLVectorDB],
similarSQLVectorDB=a.func[:similarSQLVectorDB], similarSQLVectorDB=a.func[:similarSQLVectorDB],
llmFormatName="qwen3") llmFormatName="qwen3")
#[PENDING] sometime wine data comeout {wine name, price, wine_id} and nothing else. I need to make sure that wine data include all of its attributes
println("\ncheckinventory result ", @__FILE__, ":", @__LINE__, " $(Dates.now())") println("\ncheckinventory result ", @__FILE__, ":", @__LINE__, " $(Dates.now())")
println(textresult) println(textresult)
#[PENDING] if there is no wine id, it is not a valid result #[PENDING] if there is no wine id, it is not a valid result
@@ -671,11 +673,11 @@ function extractWineAttributes_2(a::T1, input::T2)::String where {T1<:agent, T2<
"sweetness_keyword": "N/A", "sweetness_keyword": "N/A",
"sweetness": "N/A", "sweetness": "N/A",
"acidity_keyword": "low acidity", "acidity_keyword": "low acidity",
"acidity": 1-2, "acidity": "1-2",
"tannin_keyword": "medium tannin", "tannin_keyword": "medium tannin",
"tannin": 3-4, "tannin": "3-4",
"intensity_keyword": "medium-bodied", "intensity_keyword": "medium-bodied",
"intensity": 3-4 "intensity": "3-4"
} }
User's query: German red wine, under 100, pairs with spicy food User's query: German red wine, under 100, pairs with spicy food