update
This commit is contained in:
@@ -307,6 +307,8 @@ function checkinventory(a::T1, input::T2
|
||||
println("\n~~~ checkinventory result ", Dates.now(), " ", @__FILE__, " ", @__LINE__)
|
||||
println(textresult)
|
||||
|
||||
#[WORKING] when rawresponse is nothing, AI get errors
|
||||
|
||||
return (result=textresult, rawresponse=rawresponse, success=true, errormsg=nothing)
|
||||
end
|
||||
|
||||
@@ -412,6 +414,8 @@ function extractWineAttributes_1(a::T1, input::T2)::String where {T1<:agent, T2<
|
||||
|
||||
responsedict = copy(JSON3.read(response))
|
||||
|
||||
# convert
|
||||
|
||||
delete!(responsedict, :reasoning)
|
||||
delete!(responsedict, :tasting_notes)
|
||||
delete!(responsedict, :occasion)
|
||||
@@ -444,7 +448,9 @@ function extractWineAttributes_1(a::T1, input::T2)::String where {T1<:agent, T2<
|
||||
end
|
||||
else
|
||||
content = responsedict[j]
|
||||
if occursin(',', content)
|
||||
if typeof(content) <: AbstractVector
|
||||
content = strip.(content)
|
||||
elseif occursin(',', content)
|
||||
content = split(content, ",") # sometime AI generates multiple values e.g. "Chenin Blanc, Riesling"
|
||||
content = strip.(content)
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user