fix bug
This commit is contained in:
@@ -384,12 +384,16 @@ function conversation(a::T, usermsg::String) where {T<:agent}
|
||||
prompt = generatePrompt_react_mistral_openorca(a, usermsg)
|
||||
@show prompt
|
||||
respond = work(a, prompt)
|
||||
|
||||
|
||||
|
||||
error("wine done")
|
||||
else # continue thought
|
||||
|
||||
|
||||
end
|
||||
|
||||
error("wine done")
|
||||
|
||||
elseif userintend == "thought"
|
||||
|
||||
else
|
||||
@@ -423,10 +427,10 @@ function work(a::T, prompt::String) where {T<:agent}
|
||||
while true
|
||||
respond = sendReceivePrompt(a, prompt)
|
||||
@show respond
|
||||
header = detectCharacters(respond,
|
||||
headers = detectCharacters(respond,
|
||||
["QTS:", "Plan:", "Thought:", "Act:", "ActInput:", "Obs:", ".....", "ANS:"])
|
||||
|
||||
|
||||
@show headers
|
||||
break
|
||||
|
||||
|
||||
|
||||
@@ -447,7 +451,7 @@ function work(a::T, prompt::String) where {T<:agent}
|
||||
|
||||
|
||||
|
||||
|
||||
return respond
|
||||
end
|
||||
|
||||
"""
|
||||
@@ -486,7 +490,7 @@ function conversationSummary(a::T) where {T<:agent}
|
||||
{context}
|
||||
|
||||
<|im_start|>user
|
||||
Please make a detailed bullet summary of the following earlier conversation between you and the user.
|
||||
Please make a detailed bullet summary of the following earlier conversation between you and a user.
|
||||
{conversation}
|
||||
<|im_end|>
|
||||
<|im_start|>I
|
||||
@@ -771,8 +775,11 @@ function detectCharacters(text::T1, characters::Vector{T2}) where {T1<:AbstractS
|
||||
if char_endInd > length(text)
|
||||
# skip
|
||||
else
|
||||
if text[char_startInd: char_endInd] == char
|
||||
push!(result, (char=char, start=char_startInd, stop=char_endInd))
|
||||
try # some time StringIndexError: invalid index [535], valid nearby indices [534]=>'é', [536]=>' '
|
||||
if text[char_startInd: char_endInd] == char
|
||||
push!(result, (char=char, start=char_startInd, stop=char_endInd))
|
||||
end
|
||||
catch
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user