This commit is contained in:
2026-07-15 18:47:18 +07:00
parent 3acf46964b
commit 686b9b2e92
6 changed files with 39 additions and 38 deletions
-13
View File
@@ -154,19 +154,6 @@ function decisionMaker(a::T; recentevents::Integer=20, maxattempt=10
println("\nERROR YiemAgent decisionMaker() failed to parse response: $response ", @__FILE__, ":", @__LINE__, " $(Dates.now())")
continue
end
# fall back to normal text because LLM default to natural chat when it didn't use action_call
else
try
responsedict = OrderedDict(
"plan"=> "I will talk to the user",
"action_name"=> "CHAT_BOX",
"action_input"=> response[2:end-1] # remove { } at the front and back that added by clean_json_response
)
catch e
println("\nERROR YiemAgent decisionMaker(). $e --(not qualify response)-> $response", @__FILE__, ":", @__LINE__, " $(Dates.now())\n")
continue
end
end
# check whether all answer's key points are in responsedict
+4 -5
View File
@@ -530,9 +530,8 @@ function generatesql(a::T, searchterm::String,
related_tables = a.context.find_related_tables_for_user_question(searchterm)
table_schema = ""
for table in related_tables
_table_schema_df = GeneralUtils.get_db_table_schema(a.context.pg_conn_str, table)
table_schema_df = _table_schema_df[:, [:column_name, :data_type, :constraint_type]]
table_schema_str = sprint(show, table_schema_df) * "\n"
_table_schema_str = GeneralUtils.get_db_table_schema_simple(a.context.pg_conn_str, table)
table_schema_str = sprint(show, _table_schema_str) * "\n"
table_schema = table_schema * table_schema_str
end
@@ -756,11 +755,11 @@ function extractWineAttributes_1(a::T1, input::T2; maxattempt=10
"wine_name": "Saumur Blanc",
"winery": "Domaine du Collier",
"vintage": "2019",
"region": "Saumur",
"region": "N/A",
"country": "France",
"wine_type": "white",
"grape_varietal": "Merlot",
"tasting_notes": "plum",
"tasting_notes": "N/A",
"wine_price_min": "N/A",
"wine_price_max": "N/A",
"occasion": "N/A",
+1 -1
View File
@@ -306,7 +306,7 @@ function sommelier(
end
mutable struct virtualcustomer <: agent
mutable f virtualcustomer <: agent
name::String # agent name
id::String # agent id
systemmsg::String # system message