From 4d6cdbcf4a9761e5482790ac060b87da50aea36d Mon Sep 17 00:00:00 2001 From: narawat Date: Sun, 26 Jul 2026 22:42:09 +0700 Subject: [PATCH 1/3] update --- src/type.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/type.jl b/src/type.jl index f960b78..d554f2a 100644 --- a/src/type.jl +++ b/src/type.jl @@ -226,7 +226,7 @@ function sommelier( return newAgent end - + mutable struct virtualcustomer <: agent name::String # agent name -- 2.52.0 From e0e6aced333c4f0c706c4f030406add2978aa770 Mon Sep 17 00:00:00 2001 From: narawat Date: Sun, 26 Jul 2026 23:01:51 +0700 Subject: [PATCH 2/3] update --- src/interface.jl | 37 ++++++++++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/src/interface.jl b/src/interface.jl index 4750fca..e69da79 100644 --- a/src/interface.jl +++ b/src/interface.jl @@ -776,16 +776,11 @@ function generatechat!(a::T; maxattempt::Integer=10 - Processing sales orders or engaging in any other sales-related activities. These are the job of our sales team at the store. - Answering questions or offering additional services beyond those related to your store's wine recommendations such as discounts, quantity, rewards programs, promotions, delivery options, shipping, boxes, gift wrapping, packaging, personalized messages or something similar. These are the job of our sales team at the store. - # you should then respond to the user with interleaving plan, action_name, action_input + # you should then respond to the user with interleaving plan, action_name, action_input in JSON format 1) "plan", Based on the current situation, state a complete action plan to complete the task and rationale. Be specific. 2) "action_name", Must be "CHAT_BOX 3) "action_input", Dialogue you want to chat with the user according to your plan. After the action is executed you gets "action_result". It is the output from the action you selected. - - # you should only respond in JSON format as described below - "plan": "...", - "action_name": "...", - "action_input": "..." """ system_msg = Dict( @@ -807,11 +802,39 @@ function generatechat!(a::T; maxattempt::Integer=10 if attempt > 1 println("\nYiemAgent generatechat() attempt $attempt/$maxattempt ", @__FILE__, ":", @__LINE__, " $(Dates.now())") end + + response_format = Dict( + "type"=> "json_schema", + "json_schema"=> Dict( + "name"=> "user_profile", + "strict"=> true, + "schema"=> Dict( + "type"=> "object", + "properties"=> Dict( + "plan"=> Dict( + "type"=> "string", + "description" => "Based on the current situation, state a complete action plan to complete the task and rationale. Be specific.", + ), + "action_name"=> Dict( + "type"=> "string", + "description" => "Must be CHAT_BOX", + ), + "action_input"=> Dict( + "type"=> "string", + "description" => "Dialogue you want to chat with the user according to your plan.", + ), + ), + "required"=> ["plan", "action_name", "action_input"], + "additionalProperties"=> false + ) + ) + ) msg = Dict( "model" => "gemma-4-E4B-it-UD-Q4_K_XL", "messages" => chathistory, - "temperature" => 0.7 + "temperature" => 0.7, + "response_format"=> response_format, ) response = a.context.text2textInstructLLM(a.id, msg) -- 2.52.0 From e5b8518c00e82215322a879b8b6cf3f406d69268 Mon Sep 17 00:00:00 2001 From: narawat Date: Mon, 27 Jul 2026 09:47:07 +0700 Subject: [PATCH 3/3] fix tool name --- src/interface.jl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/interface.jl b/src/interface.jl index e69da79..8c1ca5c 100644 --- a/src/interface.jl +++ b/src/interface.jl @@ -778,9 +778,12 @@ function generatechat!(a::T; maxattempt::Integer=10 # you should then respond to the user with interleaving plan, action_name, action_input in JSON format 1) "plan", Based on the current situation, state a complete action plan to complete the task and rationale. Be specific. - 2) "action_name", Must be "CHAT_BOX + 2) "action_name", action_name must be CHAT_BOX. 3) "action_input", Dialogue you want to chat with the user according to your plan. After the action is executed you gets "action_result". It is the output from the action you selected. + + # available actions + "CHAT_BOX", which you can use to talk with the user. The input is dialogue you want to chat with the user according to your plan. """ system_msg = Dict( @@ -817,7 +820,7 @@ function generatechat!(a::T; maxattempt::Integer=10 ), "action_name"=> Dict( "type"=> "string", - "description" => "Must be CHAT_BOX", + "description" => "action_name must be CHAT_BOX", ), "action_input"=> Dict( "type"=> "string", -- 2.52.0