This commit is contained in:
narawat lamaiin
2024-08-10 18:02:01 +07:00
parent 9251fbf7cc
commit 07cd336d0a
2 changed files with 21 additions and 11 deletions

View File

@@ -221,13 +221,14 @@ function decisionMaker(a::T)::Dict{Symbol, Any} where {T<:agent}
At each round of conversation, you will be given the current situation:
Your conversation with the user: ...
Context: ...
Your Q&A: Your Q&A about the situation
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 your store carries until you check your inventory.
- All wines in your inventory are always in stock.
- Use the "understand-then-check" inventory strategy to understand the user, as there are many wines in the inventory.
- Do not ask the user about wine's flavor e.g. floral, citrusy, nutty or some thing similar.
- After the user chose the wine, congratulate the user and end the conversation politely. Don't offer any extra services.
- Do not ask the user about wine's flavor e.g. floral, citrusy, nutty or some thing similar as these terms cannot be used to search the database.
- Once the user has selected their wine, if they dont require any further assistance, use the ENDCONVERSATION function to end the conversation.
You should follow the following guidelines as you see fit:
- If the user interrupts, prioritize the user.
@@ -275,6 +276,7 @@ function decisionMaker(a::T)::Dict{Symbol, Any} where {T<:agent}
"""
Your conversation with the user: $chathistory
$context
Your Q&A: $QandA
$errornote
"""
@@ -301,7 +303,7 @@ function decisionMaker(a::T)::Dict{Symbol, Any} where {T<:agent}
# action_name = string(split(responsedict[:action_name], '[')[1])
# end
if responsedict[:action_name] ["PRESENTBOX", "CHATBOX", "CHECKINVENTORY"]
if responsedict[:action_name] ["ENDCONVERSATION", "CHATBOX", "CHECKINVENTORY"]
errornote = "You must use the given functions"
error("You must use the given functions ", @__FILE__, " ", @__LINE__)
end
@@ -1049,7 +1051,7 @@ function think(a::T)::NamedTuple{(:actionname, :result), Tuple{String, String}}
response =
if actionname == "CHATBOX"
(result=actioninput, errormsg=nothing, success=true)
elseif actionname == "PRESENTBOX"
elseif actionname == "ENDCONVERSATION"
(result=actioninput, errormsg=nothing, success=true)
# recommendbox(a, actioninput)
# (result="Compare and recommend wines to the user, providing reasons why each wine is a suitable match for their specific needs.", errormsg=nothing, success=true)
@@ -1243,7 +1245,7 @@ function generatechat(memory::Dict, chathistory::Vector, text2textInstructLLM::F
Context: ...
You MUST follow the following guidelines:
- After the user chose the wine, congratulate the user and end the conversation politely. Don't offer any extra services.
- Once the user has selected their wine, congratulate them on their choice. If they dont require any further assistance, politely conclude the conversation without offering additional services.
You should follow the following guidelines:
- When recommending wines, compare each option and provide reasons why each one is a suitable match for the user's specific needs.
@@ -1344,11 +1346,14 @@ end
function generatequestion(a, text2textInstructLLM::Function)::String
"""
3) ENDCONVERSATION which you can use to end the conversation with the user. The input is "NA"
"""
systemmsg =
"""
You are a helpful assistant acting as a polite, website-based sommelier for an online wine store.
Your task is to self questioning about the current situation.
You are not responsible for sales.
At each round of conversation, you will be given the current situation:
Your conversation with the user: ...
@@ -1356,8 +1361,13 @@ function generatequestion(a, text2textInstructLLM::Function)::String
You must follow the following guidelines:
1) Ask at least two questions but no more than five.
3) Your question should be specific, self-contained and not require any additional context.
4) Do not generate any question or comments at the end.
2) Your question should be specific, self-contained and not require any additional context.
3) Do not generate any question or comments at the end.
4) Once the user has selected their wine, congratulate them on their choice. If they dont require any further assistance, politely the conversation without offering additional services.
You should follow the following guidelines:
- Do not ask the user about wine's flavor e.g. floral, citrusy, nutty or some thing similar as these terms cannot be used to search the database.
- All wines in your inventory are always in stock.
You should then respond to the user with:
- Reasoning: State your detailed reasoning of the current situation