update
This commit is contained in:
@@ -406,7 +406,7 @@ function isUseTools(a::agentReflex)
|
||||
response = sendReceivePrompt(a, prompt, temperature=0.0)
|
||||
response = split(response, "<|im_end|>")[1]
|
||||
for (toolname, v) in a.tools
|
||||
if occursin(toolname, response)
|
||||
if occursin(toolname, String(response))
|
||||
isusetool = true
|
||||
break
|
||||
end
|
||||
@@ -867,6 +867,7 @@ end
|
||||
Arguments:
|
||||
text = a text you want to split
|
||||
headers = a list of keywords you want to add step and substep to
|
||||
step = a number you want to add
|
||||
|
||||
Return:
|
||||
a leftmost text after split
|
||||
@@ -884,11 +885,10 @@ function replaceHeaders(text::T, headers, step::Int) where {T<:AbstractString}
|
||||
header = i[1:end-1] # not include ":"
|
||||
if occursin(header, newtext)
|
||||
startind = findfirst(header, newtext)[1]
|
||||
stopind = findnext(":", newtext, startind+1)[end]
|
||||
stopind = findnext(":", newtext, startind+1)[end] #BUG MethodError: no method matching lastindex(::Nothing)
|
||||
word = newtext[startind: stopind]
|
||||
newword = "$header $step:"
|
||||
newtext = replace(newtext, word=> newword)
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user