This commit is contained in:
2023-11-17 06:16:57 +00:00
parent fddae42f5b
commit 60e8719c40

View File

@@ -480,20 +480,15 @@ end
```
"""
function conversationSummary(a::T) where {T<:agent}
prompt =
"""
<|im_start|>system
You are a helpful assistant.
<|im_end|>
Here are the context for the question:
You talked with a user earlier. Now you make a detailed bullet summary of the conversation.
Here are the context:
{context}
<|im_start|>user
Please make a detailed bullet summary of the following earlier conversation between you and a user.
Here are the conversation:
{conversation}
<|im_end|>
<|im_start|>I
"""
conversation = ""
@@ -528,6 +523,56 @@ function conversationSummary(a::T) where {T<:agent}
return summary
end
# function conversationSummary(a::T) where {T<:agent}
# prompt =
# """
# <|im_start|>system
# You are a helpful assistant.
# <|im_end|>
# Here are the context for the question:
# {context}
# <|im_start|>user
# Make a detailed bullet summary of the following earlier conversation between you and a user.
# {conversation}
# <|im_end|>
# <|im_start|>assistant
# """
# conversation = ""
# summary = "nothing"
# if length(a.messages)!= 0
# for msg in a.messages
# role = msg[:role]
# content = msg[:content]
# if role == "user"
# conversation *= "$role: $content\n"
# elseif role == "assistant"
# conversation *= "I: $content\n"
# else
# error("undefied condition role = $role")
# end
# end
# prompt = replace(prompt, "{conversation}" => conversation)
# prompt = replace(prompt, "{context}" => a.context)
# println("<<<<<")
# @show prompt
# result = sendReceivePrompt(a, prompt)
# summary = result === nothing ? "nothing" : result
# summary = replace(summary, "<|im_end|>" => "")
# if summary[1:1] == "\n"
# summary = summary[2:end]
# end
# @show summary
# println(">>>>>")
# error("-----")
# end
# return summary
# end
# function work2(a::agentReact, usermsg::String)
# addNewMessage(a, "user", usermsg)
# userIntent = identifyUserIntention(a, usermsg)