From 03d703265177823d7fb0b336e3b0312ef40ba7ae Mon Sep 17 00:00:00 2001 From: narawat lamaiin Date: Wed, 31 Jul 2024 22:09:14 +0700 Subject: [PATCH] update --- src/interface.jl | 11 +++++------ src/llmfunction.jl | 2 ++ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/interface.jl b/src/interface.jl index 8469745..2b409ea 100644 --- a/src/interface.jl +++ b/src/interface.jl @@ -226,9 +226,7 @@ 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 - - Search for wines that match the user preferences - - Recommend 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. + - 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 MUST follow the following guidelines: - Do not mentioning any wine until you've check your inventory. @@ -963,9 +961,10 @@ function conversation(a::T, userinput::Dict) where {T<:agent} # some time LLM said to user that it (checking inventory) but it is not. # if chatresponse want to check inventory but think() didn't checkinventory then do it - if occursin("(check", chatresponse) && occursin("inventory)", chatresponse) && - actionname != "checkinventory" + llmCheckInv = occursin("(check", chatresponse) || occursin("*check", chatresponse) || + occursin("inventory)", chatresponse) || occursin("inventory*", chatresponse) + if llmCheckInv && actionname != "checkinventory" actionname, result = forceInventoryCheck(a) if actionname == "CHATBOX" a.memory[:chatbox] = result @@ -1194,7 +1193,7 @@ function generatechat(memory::Dict, chathistory::Vector, text2textInstructLLM::F At each round of conversation, the user will give you the current situation: Context: ... - Your thoughts: Your current thinking in your mind + Your current thoughts in your mind: ... Your earlier conversation with the user: ... You must follow the following guidelines: diff --git a/src/llmfunction.jl b/src/llmfunction.jl index 02a3800..220d3aa 100644 --- a/src/llmfunction.jl +++ b/src/llmfunction.jl @@ -474,12 +474,14 @@ 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 - sweetness: S where S are integers represent the range of sweetness levels e.g. 1-2 - acidity: D where D are integers represent the range of acidity level e.g. 3-4 - tannin: T where T are integers represent the range of tannin level e.g. 4-5 - intensity: I where I are integers represent the range of intensity level e.g. 3-4 You should only respond in the form as described below: + repeat: ... sweetness: ... acidity: ... tannin: ...