update
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user