This commit is contained in:
2023-11-29 08:52:20 +00:00
parent 6a8e24f20f
commit e487f6aadc
3 changed files with 132 additions and 147 deletions

View File

@@ -16,47 +16,44 @@ function makeSummary(a::T1, input::T2) where {T1<:agent, T2<:AbstractString}
prompt =
"""
<|im_start|>system
Your need to determine now whether you can make a summary of user's text.
Input text:
$input
You have the following choices:
If you cannot make a summary say, "{no}".
If you can make a summary say, "{yes}".
Your job is to determine now whether you can make a summary of the input text by choosing one of following choices:
If you cannot make a summary say, "{No}".
If you can make a summary say, "{Yes}".
<|im_end|>
<|im_start|>user
{input}
<|im_end|>
<|im_start|>assistant
"""
prompt = replace(prompt, "{input}" => input)
result = sendReceivePrompt(a, prompt)
result = GeneralUtils.getStringBetweenCharacters(result, "{", "}")
if result == "yes"
println("///// ", result)
if result == "Yes"
prompt =
"""
<|im_start|>system
You are a helpful assistant.
Your job is to make a concise summary of user's text.
Input text:
$input
Your job is to make a concise summary of the input text.
<|im_end|>
<|im_start|>user
{input}
<|im_end|>
<|im_start|>assistant
"""
prompt = replace(prompt, "{input}" => input)
result = sendReceivePrompt(a, prompt)
summary = replace(result, "<|im_end|>" => "")
if summary[1:1] == "\n"
summary = summary[2:end]
if result[1:1] == "\n"
println("77777")
summary = result[2:end]
else
println("8888")
summary = result
end
end
return summary
end
"""
Send a msg to registered mqtt topic within mqttClient.