From 981eeb85d275c4c5dc700c225e758dbaf799f2f7 Mon Sep 17 00:00:00 2001 From: narawat Date: Thu, 16 Nov 2023 08:41:59 +0000 Subject: [PATCH] update --- src/interface.jl | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/interface.jl b/src/interface.jl index 9ed6500..459cf90 100755 --- a/src/interface.jl +++ b/src/interface.jl @@ -328,8 +328,8 @@ function conversation(a::T, usermsg::String) where {T<:agent} @show userintend if userintend == "chat" #WORKING summary = conversationSummary(a) - - + @show summary + error("conversation done") elseif userintend == "wine" elseif userintend == "thought" @@ -341,7 +341,7 @@ function conversation(a::T, usermsg::String) where {T<:agent} - error("conversation done") + @@ -402,7 +402,7 @@ end """ function conversationSummary(a::T) where {T<:agent} - promptTemplate = + prompt = """ <|im_start|>system You are a helpful assistant. @@ -410,8 +410,11 @@ function conversationSummary(a::T) where {T<:agent} <|im_start|>user Please make a detailed bullet summary of the following earlier conversation between you and the user. - {conversation} <|im_end|> + Here are the context for the question: + {context} + + {conversation} """ conversation = "" summary = "" @@ -428,7 +431,8 @@ function conversationSummary(a::T) where {T<:agent} error("undefied condition role = $role") end end - prompt = replace(promptTemplate, "{conversation}" => conversation) + prompt = replace(prompt, "{conversation}" => conversation) + prompt = replace(prompt, "{context}" => a.context) result = sendReceivePrompt(a, prompt) summary = result === nothing ? "nothing" : result if summary[1:1] == "\n"