update
This commit is contained in:
12
src/util.jl
12
src/util.jl
@@ -307,8 +307,9 @@ function iterativeprompting(a::T, prompt::String, verification::Function) where
|
||||
)
|
||||
)
|
||||
|
||||
result = nothing
|
||||
success = nothing
|
||||
result = nothing
|
||||
critique = ""
|
||||
|
||||
# iteration loop
|
||||
while true
|
||||
@@ -316,20 +317,19 @@ function iterativeprompting(a::T, prompt::String, verification::Function) where
|
||||
response = GeneralUtils.sendReceiveMqttMsg(outgoingMsg)
|
||||
error("--> iterativeprompting")
|
||||
# check for correctness and get feedback
|
||||
success, critique = verification(response)
|
||||
success, _critique = verification(response)
|
||||
|
||||
if success
|
||||
result = response
|
||||
break
|
||||
else
|
||||
# add critique to prompt
|
||||
critique *= _critique * "\n"
|
||||
replace!(prompt, "Critique: ..." => "Critique: $critique")
|
||||
end
|
||||
|
||||
|
||||
|
||||
end
|
||||
|
||||
return (success=sucess, result=response)
|
||||
return (success=success, result=result)
|
||||
end
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user