update
This commit is contained in:
@@ -502,6 +502,15 @@ function actor_mistral_openorca(a::agentReflex, selfaware=nothing)
|
||||
@show iskey_Thought = haskey(chunkedtext, "Thought $latestTask:")
|
||||
@show iskey_Act = haskey(chunkedtext, "Act $latestTask:")
|
||||
@show iskey_Actinput = haskey(chunkedtext, "Actinput $latestTask:")
|
||||
|
||||
# check whether the act has valid json
|
||||
isJsonReadable = false
|
||||
try
|
||||
act = GeneralUtils.getStringBetweenCharacters(response, '{', '}', endCharLocation="end")
|
||||
act = Dict(JSON3.read(act))
|
||||
isJsonReadable = true
|
||||
catch
|
||||
end
|
||||
|
||||
if iskey_Thought && iskey_Act && iskey_Actinput
|
||||
istoolnameValid = false
|
||||
@@ -513,8 +522,7 @@ function actor_mistral_openorca(a::agentReflex, selfaware=nothing)
|
||||
end
|
||||
|
||||
if length(chunkedtext["Thought $latestTask:"]) > 5 && istoolnameValid &&
|
||||
length(chunkedtext["Actinput $latestTask:"]) > 5 &&
|
||||
occursin('{', response) && occursin('}', response)
|
||||
length(chunkedtext["Actinput $latestTask:"]) > 5 && isJsonReadable
|
||||
break
|
||||
end
|
||||
end
|
||||
@@ -547,6 +555,8 @@ function actor_mistral_openorca(a::agentReflex, selfaware=nothing)
|
||||
chunkedtext["Act $latestTask:"] = toolname
|
||||
chunkedtext["Actinput $latestTask:"] = act[Symbol(toolname)]
|
||||
toolinput = chunkedtext["Actinput $latestTask:"]
|
||||
@show toolinput
|
||||
println(typeof(toolinput))
|
||||
|
||||
return toolname, toolinput, chunkedtext
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user