update conversationSummary()
This commit is contained in:
@@ -362,7 +362,7 @@ end
|
||||
#WORKING
|
||||
function conversation(a::T, usermsg::String) where {T<:agent}
|
||||
userintend = identifyUserIntention(a, usermsg)
|
||||
@show userintend #BUG nothing sometime why? may be llm need more time to respond
|
||||
@show userintend
|
||||
respond = nothing
|
||||
|
||||
# AI thinking mode
|
||||
@@ -375,12 +375,14 @@ function conversation(a::T, usermsg::String) where {T<:agent}
|
||||
respond = split(respond, "<|im_end|>")[1]
|
||||
respond = replace(respond, "\n" => "")
|
||||
_ = addNewMessage(a, "assistant", respond)
|
||||
@show respond
|
||||
elseif userintend == "wine" #WORKING
|
||||
if a.thought == "nothing" # new thought
|
||||
a.context = conversationSummary(a)
|
||||
_ = addNewMessage(a, "user", usermsg)
|
||||
prompt = generatePrompt_react_mistral_openorca(a, usermsg)
|
||||
@show prompt
|
||||
# respond = sendReceivePrompt(a, prompt)
|
||||
|
||||
else # continue thought
|
||||
|
||||
@@ -459,7 +461,7 @@ function conversationSummary(a::T) where {T<:agent}
|
||||
Please make a detailed bullet summary of the following earlier conversation between you and the user.
|
||||
{conversation}
|
||||
<|im_end|>
|
||||
<|im_start|>assistant
|
||||
<|im_start|>I
|
||||
|
||||
"""
|
||||
conversation = ""
|
||||
@@ -598,7 +600,7 @@ function identifyUserIntention(a::T, usermsg::String) where {T<:agent}
|
||||
prompt = replace(prompt, "{input}" => usermsg)
|
||||
|
||||
|
||||
result = sendReceivePrompt(a, prompt) #BUG answer is not in the choice {}
|
||||
result = sendReceivePrompt(a, prompt)
|
||||
answer = result === nothing ? nothing : GeneralUtils.getStringBetweenCharacters(result, "{", "}")
|
||||
|
||||
return answer
|
||||
|
||||
Reference in New Issue
Block a user