This commit is contained in:
narawat lamaiin
2025-07-14 19:33:12 +07:00
parent bad2ca35ed
commit 8a9c9606c7
3 changed files with 38 additions and 29 deletions

View File

@@ -309,10 +309,11 @@ function checkwine(a::T1, input::T2; maxattempt::Int=3
inventoryquery = "Retrieves $retrieve_attributes of wines that match the following criteria - {$_inventoryquery}"
println("\ncheckinventory input: $inventoryquery ", @__FILE__, ":", @__LINE__, " $(Dates.now())")
# add suppport for similarSQLVectorDB
textresult, rawresponse = SQLLLM.query(inventoryquery, a.func[:executeSQL],
a.func[:text2textInstructLLM];
insertSQLVectorDB=a.func[:insertSQLVectorDB],
similarSQLVectorDB=a.func[:similarSQLVectorDB],
textresult, rawresponse = SQLLLM.query(inventoryquery,
a.context.executeSQL,
a.context.text2textInstructLLM;
insertSQLVectorDB=a.context.insertSQLVectorDB,
similarSQLVectorDB=a.context.similarSQLVectorDB,
llmFormatName="qwen3")
# check if all of retrieve_attributes appears in textresult
isin = [occursin(x, textresult) for x in retrieve_attributes]
@@ -463,7 +464,7 @@ function extractWineAttributes_1(a::T1, input::T2; maxattempt=10
# add info
prompt = prompt * context
response = a.func[:text2textInstructLLM](prompt; modelsize="medium", senderId=a.id)
response = a.context.text2textInstructLLM(prompt; modelsize="medium", senderId=a.id)
response = GeneralUtils.deFormatLLMtext(response, a.llmFormatName)
response = GeneralUtils.remove_french_accents(response)
think, response = GeneralUtils.extractthink(response)
@@ -742,7 +743,7 @@ function extractWineAttributes_2(a::T1, input::T2)::String where {T1<:agent, T2<
# add info
prompt = prompt * context
response = a.func[:text2textInstructLLM](prompt; modelsize="medium", senderId=a.id)
response = a.context.text2textInstructLLM(prompt; modelsize="medium", senderId=a.id)
response = GeneralUtils.deFormatLLMtext(response, a.llmFormatName)
response = GeneralUtils.remove_french_accents(response)
think, response = GeneralUtils.extractthink(response)