This commit is contained in:
narawat lamaiin
2024-08-01 19:03:45 +07:00
parent ca81e4496b
commit 16b491d67b
3 changed files with 14 additions and 18 deletions

View File

@@ -93,7 +93,7 @@ julia> output_thoughtDict = Dict(
- [] implement RAG to pull similar experience
- [] use customerinfo
- [] user storeinfo
- [x] add try block. check result that it is expected before returning
- BUG LLM recommend wine before check inventory
# Signature
"""
@@ -219,6 +219,10 @@ function decisionMaker(a::T)::Dict{Symbol, Any} where {T<:agent}
Context: ...
Your earlier conversation with the user: ...
You MUST follow the following guidelines:
- Check your inventory before recommending any wine to the user
- Only recommending wine from your inventory.
You should follow the following guidelines as you see fit:
- If the user interrupts, prioritize the user.
- Get to know how much the user willing to spend
@@ -226,13 +230,8 @@ function decisionMaker(a::T)::Dict{Symbol, Any} where {T<:agent}
- Get to know what occasion the user is buying wine for
- Get to know what characteristics of wine the user is looking for e.g. tannin, sweetness, intensity, acidity
- Get to know what food will be served with wine
- With enough user information, search your inventory
- Recommend the wines to the user
- After recommending wine to the user, ask the customer if there is anything else you can help with. If the customer doesnt need anything else, finish the conversation.
You MUST follow the following guidelines:
- Do not mentioning any wine until you've check your inventory
- Do not ask what the user already told you
- Based on the user's information, check your inventory and recommend a suitable wine from your stock.
- After recommending wine to the user, ask the customer if there is anything else you can help with. If the customer doesn't need anything else, finish the conversation.
You should then respond to the user with interleaving Thought, Plan, Action and Observation:
- thought:
@@ -256,7 +255,7 @@ function decisionMaker(a::T)::Dict{Symbol, Any} where {T<:agent}
Let's begin!
"""
context = length(a.memory[:shortmem]) > 0 ? vectorOfDictToText(memory[:shortmem], withkey=false) : "None"
context = length(a.memory[:shortmem]) > 0 ? vectorOfDictToText(a.memory[:shortmem], withkey=false) : "None"
usermsg =
"""
@@ -995,8 +994,6 @@ function conversation(a::T, userinput::Dict) where {T<:agent}
return chatresponse
end
end
"""
@@ -1206,8 +1203,7 @@ function generatechat(memory::Dict, chathistory::Vector, text2textInstructLLM::F
Your current thoughts in your mind: ...
You must follow the following guidelines:
- Do not mentioning any wine until you've check your inventory.
- Check your inventory before recommending any specific wine.
- Check your inventory before mentioning any wine or region to the user
- Your thoughts matter.
- Do not offer the user to try wine as you are internet-based agent.
@@ -1220,11 +1216,11 @@ function generatechat(memory::Dict, chathistory::Vector, text2textInstructLLM::F
Let's begin!
"""
context = length(memory[:shortmem]) > 0 ? vectorOfDictToText(memory[:shortmem], withkey=false) : "None"
context_1 = length(memory[:shortmem]) > 0 ? vectorOfDictToText(memory[:shortmem], withkey=false) : "None"
usermsg =
"""
Context: $context
Context: $context_1
Your earlier conversation with the user: $(vectorOfDictToText(chathistory))
Your thoughts: $(memory[:chatbox])
"""

View File

@@ -477,7 +477,7 @@ function extractWineAttributes_2(a::T1, input::T2
3) Do not generate other comments.
You should then respond to the user with the following points:
- repeat: repeat the user query exactly
- repeat: State the user query
- sweetness: S where S are integers represent the range of sweetness levels
Example: 1-2
- acidity: D where D are integers represent the range of acidity level