This commit is contained in:
narawat lamaiin
2024-08-04 21:17:48 +07:00
parent 3a5c0f188a
commit 99f19c2796
3 changed files with 39 additions and 21 deletions

View File

@@ -212,8 +212,8 @@ function decisionMaker(a::T)::Dict{Symbol, Any} where {T<:agent}
systemmsg =
"""
You are an website-based polite sommelier working for an online wine store. You are currently talking with the user.
Your task is to help the user choose the best wine from your inventory that matches their tastes.
You are a website-based, attentive, and polite sommelier working for an online wine store. You are currently talking with the user.
Your task is to help the user choose the best wine from your inventory that matches the user preferences.
Definitions:
"observation" is result of the preceding immediate action.
@@ -225,8 +225,8 @@ function decisionMaker(a::T)::Dict{Symbol, Any} where {T<:agent}
You MUST follow the following guidelines:
- Generally speaking, your inventory has some wines from France, the United States, Australia, Spain, and Italy but you won't know which wines are in stock until you check your inventory.
- Use the "get to know the user's preferences, then check inventory" strategy to help the user, as there are many wines in the inventory.
- After recommending wine to the user, ask if there is anything else you can help with, but do not offer any additional services. If the user doesn't need anything else, say thank you and goodbye.
- Do not ask the user about wine's flavors
- After recommending wines to the user, ask if there is anything else you can help with, but do not offer any extra services. If the user doesn't need anything else, say thank you and goodbye.
- Do not ask the user about wine's flavor e.g. floral, citrusy, nutty or some thing similar.
You should follow the following guidelines as you see fit:
- If the user interrupts, prioritize the user.
@@ -1000,18 +1000,14 @@ function conversation(a::T, userinput::Dict) where {T<:agent}
if llmCheckInv && actionname != "checkinventory"
actionname, result = forceInventoryCheck(a)
if actionname == "CHATBOX"
a.memory[:chatbox] = result
else
push!(a.memory[:shortmem], Dict(Symbol(actionname)=> result))
end
push!(a.memory[:shortmem], Dict(Symbol(actionname)=> result))
# generate chatresponse again because we have force inventory check
chatresponse = generatechat(a.memory, a.chathistory, a.text2textInstructLLM)
else
if actionname == "CHATBOX"
a.memory[:chatbox] = result
# skip
else
push!(a.memory[:shortmem], Dict(Symbol(actionname)=> result))
end
@@ -1221,8 +1217,8 @@ julia>
function generatechat(memory::Dict, chathistory::Vector, text2textInstructLLM::Function)
systemmsg =
"""
You are an website-based polite sommelier working for an online wine store.
Your task is to help the user choose the best wine from your inventory that matches their tastes.
You are a website-based, attentive, and polite sommelier working for an online wine store. You are currently talking with the user.
Your task is to help the user choose the best wine from your inventory that matches the user preferences.
At each round of conversation, the user will give you the current situation:
Context: ...
@@ -1231,7 +1227,6 @@ function generatechat(memory::Dict, chathistory::Vector, text2textInstructLLM::F
You must follow the following guidelines:
- Your thoughts matter.
- Do not ask the user about wine's flavors
You should then respond to the user with:
- chat: what do you want to say to the user based on the current situation