v0.7.4 #36
+34
-8
@@ -776,16 +776,14 @@ 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.
|
- 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.
|
- 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.
|
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.
|
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.
|
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
|
# available actions
|
||||||
"plan": "...",
|
"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.
|
||||||
"action_name": "...",
|
|
||||||
"action_input": "..."
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
system_msg = Dict(
|
system_msg = Dict(
|
||||||
@@ -807,11 +805,39 @@ function generatechat!(a::T; maxattempt::Integer=10
|
|||||||
if attempt > 1
|
if attempt > 1
|
||||||
println("\nYiemAgent generatechat() attempt $attempt/$maxattempt ", @__FILE__, ":", @__LINE__, " $(Dates.now())")
|
println("\nYiemAgent generatechat() attempt $attempt/$maxattempt ", @__FILE__, ":", @__LINE__, " $(Dates.now())")
|
||||||
end
|
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" => "action_name 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(
|
msg = Dict(
|
||||||
"model" => "gemma-4-E4B-it-UD-Q4_K_XL",
|
"model" => "gemma-4-E4B-it-UD-Q4_K_XL",
|
||||||
"messages" => chathistory,
|
"messages" => chathistory,
|
||||||
"temperature" => 0.7
|
"temperature" => 0.7,
|
||||||
|
"response_format"=> response_format,
|
||||||
)
|
)
|
||||||
|
|
||||||
response = a.context.text2textInstructLLM(a.id, msg)
|
response = a.context.text2textInstructLLM(a.id, msg)
|
||||||
|
|||||||
+1
-1
@@ -226,7 +226,7 @@ function sommelier(
|
|||||||
|
|
||||||
return newAgent
|
return newAgent
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
mutable struct virtualcustomer <: agent
|
mutable struct virtualcustomer <: agent
|
||||||
name::String # agent name
|
name::String # agent name
|
||||||
|
|||||||
Reference in New Issue
Block a user