This commit is contained in:
narawat lamaiin
2024-08-01 13:09:42 +07:00
parent 03d7032651
commit ca81e4496b
3 changed files with 39 additions and 16 deletions

View File

@@ -219,17 +219,20 @@ function decisionMaker(a::T)::Dict{Symbol, Any} where {T<:agent}
Context: ...
Your earlier conversation with the user: ...
You SHOULD follow the following guidelines:
- If the user interrupts, prioritize the user then get back to the guidelines.
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
- Get to know type of wine the user is looking for e.g. red, white, sparkling, rose, dessert, fortified
- 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 mentioning any wine until you've check your inventory
- Do not ask what the user already told you
You should then respond to the user with interleaving Thought, Plan, Action and Observation:
- thought:
@@ -253,9 +256,11 @@ 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"
usermsg =
"""
Context: None
Context: $context
Your earlier conversation with the user: $(vectorOfDictToText(a.chathistory))
"""
@@ -1014,6 +1019,10 @@ julia>
"""
function think(a::T)::NamedTuple{(:actionname, :result), Tuple{String, String}} where {T<:agent}
thoughtDict = decisionMaker(a)
println("")
println("--> think ", @__FILE__, " ", @__LINE__)
pprintln(thoughtDict)
actionname = thoughtDict[:action_name]
actioninput = thoughtDict[:action_input]
@@ -1193,8 +1202,8 @@ function generatechat(memory::Dict, chathistory::Vector, text2textInstructLLM::F
At each round of conversation, the user will give you the current situation:
Context: ...
Your current thoughts in your mind: ...
Your earlier conversation with the user: ...
Your current thoughts in your mind: ...
You must follow the following guidelines:
- Do not mentioning any wine until you've check your inventory.
@@ -1219,9 +1228,7 @@ function generatechat(memory::Dict, chathistory::Vector, text2textInstructLLM::F
Your earlier conversation with the user: $(vectorOfDictToText(chathistory))
Your thoughts: $(memory[:chatbox])
"""
println("")
println("--> think ", @__FILE__, " ", @__LINE__)
println(memory[:chatbox])
_prompt =
[
Dict(:name=> "system", :text=> systemmsg),