You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Examples simulate previous interactions with an LLM and come
right after the system prompt. This helps grounding the model and
producing better responses.
Copy file name to clipboardExpand all lines: lib/personas/summarizer.rb
+9
Original file line number
Diff line number
Diff line change
@@ -32,6 +32,15 @@ def system_prompt
32
32
defresponse_format
33
33
[{key: "summary",type: "string"}]
34
34
end
35
+
36
+
defexamples
37
+
[
38
+
[
39
+
"Here are the posts inside <input></input> XML tags:\n\n<input>1) user1 said: I love Mondays 2) user2 said: I hate Mondays</input>\n\nGenerate a concise, coherent summary of the text above maintaining the original language.",
40
+
"Two users are sharing their feelings toward Mondays. [user1]({resource_url}/1) hates them, while [user2]({resource_url}/2) loves them.",
"Here are the posts inside <input></input> XML tags:\n\n<input>1) user1 said: I love Mondays 2) user2 said: I hate Mondays</input>\n\nGenerate a concise, coherent summary of the text above maintaining the original language.",
52
-
}
53
-
54
-
messages << {
55
-
type: :model,
56
-
content:
57
-
"Two users are sharing their feelings toward Mondays. [user1](#{resource_path}/1) hates them, while [user2](#{resource_path}/2) loves them.",
58
-
}
59
-
60
-
messages << {type: :user,content: <<~TEXT.strip}
47
+
[{type: :user,content: <<~TEXT.strip}]
61
48
#{content_title.present? ? "The discussion title is: " + content_title + ".\n" : ""}
62
49
Here are the posts, inside <input></input> XML tags:
63
50
@@ -67,8 +54,6 @@ def as_llm_messages(contents)
67
54
68
55
Generate a concise, coherent summary of the text above maintaining the original language.
0 commit comments