From 1d106582be9e56babdb3020f6ee6ee3bbaf36f99 Mon Sep 17 00:00:00 2001 From: narawat Date: Fri, 17 Nov 2023 02:00:51 +0000 Subject: [PATCH] update conversationSummary() --- src/interface.jl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/interface.jl b/src/interface.jl index 427dbd6..dac16dc 100755 --- a/src/interface.jl +++ b/src/interface.jl @@ -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