This commit is contained in:
narawat lamaiin
2024-08-27 13:22:53 +07:00
parent a80b8e0260
commit ca0f9cd53f
5 changed files with 70 additions and 141 deletions

View File

@@ -406,6 +406,16 @@ function extractWineAttributes_1(a::T1, input::T2)::String where {T1<:agent, T2<
try
response = a.text2textInstructLLM(prompt)
# check wheter all attributes are in the response
for word in attributes
if !occursin(word, response)
noise = String(rand('a':'z', 5))
errornote = "Background noise $noise"
error("$word attribute is missing")
end
end
responsedict = GeneralUtils.textToDict(response, attributes, rightmarker=":", symbolkey=true)
for i attributes