This commit is contained in:
narawat lamaiin
2024-10-13 06:38:43 +07:00
parent 015e7b757c
commit 2e2eccff8b
3 changed files with 11 additions and 4 deletions

View File

@@ -232,7 +232,7 @@ function decisionMaker(a::T; recent::Integer=5)::Dict{Symbol, Any} where {T<:age
systemmsg =
"""
Your name is $(a.name). You are a helpful assistant acting as a polite, website-based sommelier for Yiem's online wine store.
Your name is $(a.name). You are a helpful assistant acting as a polite, website-based sommelier for $(a.retailername) store.
Your goal includes:
1) Get to know the user preferences about wine
2) Help them select the best wines from your inventory that align with their preferences
@@ -1422,6 +1422,9 @@ function generatequestion(a, text2textInstructLLM::Function; recent=nothing)::St
q_number = count("Q", response)
if q_number < 3
error("too few questions only $q_number questions are generated ", @__FILE__, " ", @__LINE__)
# check whether "A1" is in the response, if not error.
elseif !occursin("A1", response)
error("no answer found in the response ", @__FILE__, " ", @__LINE__)
end
# response = string(split(response, "Please")[1]) # LLM usually add comments which is no need.
responsedict = GeneralUtils.textToDict(response,