This commit is contained in:
narawat lamaiin
2024-06-01 00:37:25 +07:00
parent 3196842296
commit 97c566a9d5
5 changed files with 36 additions and 19 deletions

View File

@@ -728,9 +728,9 @@ julia>
# Signature
"""
function jsoncorrection(a::T1, input::T2, correctJsonExample::T3;
function jsoncorrection(config::T1, input::T2, correctJsonExample::T3;
maxattempt::Integer=3
) where {T1<:agent, T2<:AbstractString, T3<:AbstractString}
) where {T1<:AbstractDict, T2<:AbstractString, T3<:AbstractString}
incorrectjson = deepcopy(input)
correctjson = nothing
@@ -762,7 +762,7 @@ function jsoncorrection(a::T1, input::T2, correctJsonExample::T3;
"""
# apply LLM specific instruct format
externalService = a.config[:externalservice][:text2textinstruct]
externalService = config[:externalservice][:text2textinstruct]
llminfo = externalService[:llminfo]
prompt =
if llminfo[:name] == "llama3instruct"
@@ -775,10 +775,10 @@ function jsoncorrection(a::T1, input::T2, correctJsonExample::T3;
msgMeta = GeneralUtils.generate_msgMeta(
externalService[:mqtttopic],
senderName= "jsoncorrection",
senderId= a.id,
senderId= string(uuid4()),
receiverName= "text2textinstruct",
mqttBroker= a.config[:mqttServerInfo][:broker],
mqttBrokerPort= a.config[:mqttServerInfo][:port],
mqttBroker= config[:mqttServerInfo][:broker],
mqttBrokerPort= config[:mqttServerInfo][:port],
)
outgoingMsg = Dict(