update
This commit is contained in:
+30
-7
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user