update
This commit is contained in:
40
src/util.jl
40
src/util.jl
@@ -229,7 +229,7 @@ end
|
||||
|
||||
|
||||
|
||||
""" Check JSON format correctness, provide
|
||||
""" Check JSON format correctness and provide feedback
|
||||
|
||||
Arguments\n
|
||||
-----
|
||||
@@ -237,6 +237,7 @@ end
|
||||
|
||||
Return\n
|
||||
-----
|
||||
(correct, critique)
|
||||
|
||||
Example\n
|
||||
-----
|
||||
@@ -254,18 +255,18 @@ end
|
||||
"""
|
||||
function syntaxcheck_json(jsonstring::T)::NamedTuple where {T<:AbstractString}
|
||||
error("--> syntaxcheck_json")
|
||||
# success, result, errormsg, st = GeneralUtils.showstracktrace(JSON3.read, jsonstring)
|
||||
# if !success # gives feedback
|
||||
success, result, errormsg, st = GeneralUtils.showstracktrace(JSON3.read, jsonstring)
|
||||
if !success # gives feedback
|
||||
|
||||
|
||||
|
||||
# else
|
||||
else
|
||||
|
||||
|
||||
# end
|
||||
end
|
||||
|
||||
|
||||
# return (success, result, critique)
|
||||
return (success, critique)
|
||||
end
|
||||
|
||||
|
||||
@@ -306,27 +307,29 @@ function iterativeprompting(a::T, prompt::String, verification::Function) where
|
||||
)
|
||||
)
|
||||
|
||||
result = nothing
|
||||
success = nothing
|
||||
|
||||
# iteration loop
|
||||
while true
|
||||
# send prompt to LLM
|
||||
response = GeneralUtils.sendReceiveMqttMsg(outgoingMsg)
|
||||
error("--> iterativeprompting")
|
||||
# check for correctness and get feedback
|
||||
success, critique = verification(response)
|
||||
|
||||
# if correct
|
||||
|
||||
# break
|
||||
# else
|
||||
# # get LLM critique
|
||||
|
||||
# # add critique to prompt
|
||||
# end
|
||||
if success
|
||||
result = response
|
||||
break
|
||||
else
|
||||
# add critique to prompt
|
||||
end
|
||||
|
||||
|
||||
|
||||
end
|
||||
|
||||
return response
|
||||
return (success=sucess, result=response)
|
||||
end
|
||||
|
||||
|
||||
@@ -364,13 +367,6 @@ end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user