This commit is contained in:
narawat lamaiin
2024-05-05 12:06:32 +07:00
parent 1ac2ad1801
commit 77b590c6ad
4 changed files with 78 additions and 128 deletions

View File

@@ -1,6 +1,6 @@
module util
export clearhistory, addNewMessage, formatLLMtext, syntaxcheck_json, iterativeprompting,
export clearhistory, addNewMessage, formatLLMtext, iterativeprompting,
formatLLMtext_llama3instruct, formatLLMtext_phi3instruct
using UUIDs, Dates, DataStructures, HTTP, MQTTClient, JSON3
@@ -269,48 +269,6 @@ function formatLLMtext(messages::Vector{Dict{Symbol, T}},
end
""" Check JSON format correctness and provide feedback
Arguments\n
-----
jsonstring::T
Return\n
-----
(correct, critique)
Example\n
-----
```jldoctest
julia>
```
TODO\n
-----
[] update docstring
[PENDING] implement the function
Signature\n
-----
"""
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
else
end
return (success, critique)
end
"""
Arguments\n