update
This commit is contained in:
100
src/mcts.jl
100
src/mcts.jl
@@ -267,106 +267,6 @@ end
|
||||
isLeaf(node::MCTSNode)::Bool = isempty(node.children)
|
||||
|
||||
|
||||
|
||||
"""
|
||||
|
||||
Arguments\n
|
||||
-----
|
||||
|
||||
Return\n
|
||||
-----
|
||||
|
||||
Example\n
|
||||
-----
|
||||
```jldoctest
|
||||
julia>
|
||||
```
|
||||
|
||||
TODO\n
|
||||
-----
|
||||
[] update docstring
|
||||
[WORKING] implement the function
|
||||
|
||||
Signature\n
|
||||
-----
|
||||
"""
|
||||
function iterativeprompting(a::T, prompt::String, verification::Function) where {T<:agent}
|
||||
|
||||
msgMeta = GeneralUtils.generate_msgMeta(
|
||||
a.config[:thirdPartyService][:text2textinstruct],
|
||||
senderName= "iterativeprompting",
|
||||
senderId= a.id,
|
||||
receiverName= "text2textinstruct",
|
||||
)
|
||||
|
||||
outgoingMsg = Dict(
|
||||
:msgMeta,
|
||||
:payload=> Dict(
|
||||
:text=> prompt,
|
||||
)
|
||||
)
|
||||
|
||||
# iteration loop
|
||||
while true
|
||||
# send prompt to LLM
|
||||
response = GeneralUtils.sendReceiveMqttMsg()
|
||||
|
||||
# check for correctness and get feedback
|
||||
|
||||
if correct
|
||||
|
||||
break
|
||||
else
|
||||
# get LLM critique
|
||||
|
||||
# add critique to prompt
|
||||
end
|
||||
|
||||
|
||||
|
||||
end
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
""" Check JSON format correctness, provide
|
||||
|
||||
Arguments\n
|
||||
-----
|
||||
|
||||
Return\n
|
||||
-----
|
||||
|
||||
Example\n
|
||||
-----
|
||||
```jldoctest
|
||||
julia>
|
||||
```
|
||||
|
||||
TODO\n
|
||||
-----
|
||||
[] update docstring
|
||||
[WORKING] implement the function
|
||||
|
||||
Signature\n
|
||||
-----
|
||||
"""
|
||||
function syntaxcheck_json(jsonstring::String)::NamedTuple
|
||||
success, result, errormsg, st = GeneralUtils.showstracktrace(JSON3.read, jsonstring)
|
||||
if !success # gives feedback
|
||||
|
||||
|
||||
|
||||
else
|
||||
|
||||
|
||||
end
|
||||
|
||||
|
||||
return (success, result, critique)
|
||||
end
|
||||
|
||||
|
||||
"""
|
||||
|
||||
Arguments\n
|
||||
|
||||
Reference in New Issue
Block a user