This commit is contained in:
narawat lamaiin
2024-12-19 18:50:34 +07:00
parent bc002a3ef4
commit becda0b309
2 changed files with 8 additions and 2 deletions

View File

@@ -289,6 +289,9 @@ julia> result = checkinventory(agent, input)
"""
function checkinventory(a::T1, input::T2
) where {T1<:agent, T2<:AbstractString}
# [WORKING] make sure input has no french or german character
println("\n~~~ checkinventory order: $input ", @__FILE__, " ", @__LINE__)
wineattributes_1 = extractWineAttributes_1(a, input)
wineattributes_2 = extractWineAttributes_2(a, input)
@@ -428,6 +431,8 @@ function extractWineAttributes_1(a::T1, input::T2)::String where {T1<:agent, T2<
responsedict = GeneralUtils.textToDict(response, attributes, rightmarker=":", symbolkey=true)
#[WORKING] check if winery, wine_name, region, country, wine_type, grape_variety are in the query because sometime AI halucinates
for i attributes
if length(JSON3.write(responsedict[Symbol(i)])) == 0
error("$i is empty ", @__LINE__)