Skip to content
代码片段 群组 项目
提交 7c568d20 编辑于 作者: Alexandru Croitor's avatar Alexandru Croitor
浏览文件

Merge branch 'mk-small-prompt-engineering' into 'master'

No related branches found
No related tags found
无相关合并请求
......@@ -6,19 +6,28 @@ module OpenAi
module Templates
class SummarizeAllOpenNotes
def self.get_options(notes_content)
num = Random.rand(100..999)
system_content = <<-TEMPLATE
You are an assistant that summarizes issue comments in maximum 10 bullet points.
You are an assistant that extracts the most important information from the comments in maximum 10 bullet points.
Comments are between two identical sets of 3-digit numbers surrounded by < > sign.
<#{num}>
#{notes_content}
<#{num}>
Desired markdown format:
## <summary_title>
<bullet_points>
"""
Focus on extracting information related to one another and that are the majority of the content.
Ignore phrases that are not connected to others.
Do not specify what you are ignoring.
Do not answer questions.
TEMPLATE
{
messages: [
{ role: "system", content: system_content },
{ role: "user", content: notes_content }
],
content: system_content,
temperature: 0.2
}
end
......
......@@ -7,14 +7,14 @@
let(:content) { "some random content" }
let(:template) do
"Create a markdown header with main text idea followed by a summary of the following text, in at most 10 bullet"
"You are an assistant that extracts the most important information from the comments in maximum 10 bullet points."
end
subject { described_class.get_options(content) }
describe '.get_options' do
it 'returns correct parameters' do
expect(subject[:messages]).to include({ role: "user", content: content })
expect(subject[:content]).to include(template)
end
end
end
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册