This commit is contained in:
narawat lamaiin
2025-04-26 06:20:09 +07:00
parent 44804041a3
commit 7ca4f5276d
2 changed files with 9 additions and 7 deletions

View File

@@ -217,7 +217,7 @@ function decisionMaker(a::T; recent::Integer=10
You should follow the following guidelines: You should follow the following guidelines:
- When searching an inventory, search as broadly as possible based on the information you have gathered so far. - When searching an inventory, search as broadly as possible based on the information you have gathered so far.
- Encourage the customer to explore different options and try new things. - Encourage the customer to explore different options and try new things.
- Sometimes, the item a user desires might not be available in your inventory. In such cases, inform the user that the item is unavailable and suggest an alternative instead. - If you are unable to locate the desired item after multiple attempts, it may not be available in your inventory. In such cases, inform the user that the item is unavailable and suggest an alternative instead.
For your information: For your information:
- Your store carries only wine. - Your store carries only wine.

View File

@@ -36,7 +36,12 @@ function executeSQLVectorDB(sql)
return result return result
end end
function text2textInstructLLM(prompt::String; maxattempt::Integer=2, modelsize::String="medium") function text2textInstructLLM(prompt::String; maxattempt::Integer=3, modelsize::String="medium",
llmkwargs=Dict(
:num_ctx => 32768,
:temperature => 0.1,
)
)
msgMeta = GeneralUtils.generate_msgMeta( msgMeta = GeneralUtils.generate_msgMeta(
config[:externalservice][:loadbalancer][:mqtttopic]; config[:externalservice][:loadbalancer][:mqtttopic];
msgPurpose="inference", msgPurpose="inference",
@@ -51,10 +56,7 @@ function text2textInstructLLM(prompt::String; maxattempt::Integer=2, modelsize::
:msgMeta => msgMeta, :msgMeta => msgMeta,
:payload => Dict( :payload => Dict(
:text => prompt, :text => prompt,
:kwargs => Dict( :kwargs => llmkwargs
:num_ctx => 16384,
:temperature => 0.2,
)
) )
) )
@@ -195,7 +197,7 @@ function insertSommelierDecision(recentevents::T1, decision::T2; maxdistance::In
row, col = size(df) row, col = size(df)
distance = row == 0 ? Inf : df[1, :distance] distance = row == 0 ? Inf : df[1, :distance]
if row == 0 || distance > maxdistance # no close enough SQL stored in the database if row == 0 || distance > maxdistance # no close enough SQL stored in the database
recentevents_embedding = a.func[:getEmbedding](recentevents)[1] recentevents_embedding = getEmbedding(recentevents)[1]
recentevents = replace(recentevents, "'" => "") recentevents = replace(recentevents, "'" => "")
decision_json = JSON3.write(decision) decision_json = JSON3.write(decision)
decision_base64 = base64encode(decision_json) decision_base64 = base64encode(decision_json)