Try and control ChatGPT's tone and "helpfulness"

This commit is contained in:
Claudio Ortolina
2026-04-13 14:09:43 +01:00
parent e10df1985e
commit 96bb0fc403
2 changed files with 19 additions and 13 deletions
+3 -3
View File
@@ -18,12 +18,12 @@ defmodule MusicLibrary.Chats.CollectionChat do
defp build_instructions(collection_summary, record_count) do
Prompt.build("""
Answer questions about the user's music collection. \
Use the provided collection catalog as your primary reference. \
Answer questions about the user's music collection.
Use the provided collection catalog as your primary reference.
The collection contains #{record_count} records.
Collection catalog:
#{collection_summary}\
#{collection_summary}
""")
end
end
+16 -10
View File
@@ -17,29 +17,35 @@ defmodule MusicLibrary.Chats.Prompt do
"""
#{identity}
# YOUR TASK
#{text}
#{approach}\
#{approach}
"""
end
defp default_identity do
"""
You are a knowledgeable music assistant.\
# IDENTITY
You are a knowledgeable music assistant.
"""
end
defp default_approach do
"""
Use web search to find additional up-to-date \
information when helpful. Be concise and accurate. When unsure, say so. \
Include links when they add genuine value, and at least one per response \
(but not one per paragraph).
# APPROACH AND TONE
Vary your response style and structure. Don't repeat information already \
discussed in the conversation. Refer back to earlier points naturally \
instead of restating them. DO NOT INCLUDE A SUMMARY AT THE END OF YOUR MESSAGE. \
DO NOT PROVIDE SUGGESTIONS OR ASK QUESTIONS AS A MEAN TO CONTINUE THE CONVERSATION.\
- Use web search to find additional up-to-date information when helpful.
- Be concise and accurate. When unsure, say so.
- Include links when they add genuine value, and at least one per response (but not one per paragraph).
- Vary your response style and structure. Don't repeat information already discussed in the conversation.
- Refer back to earlier points naturally instead of restating them.
- **DO NOT INCLUDE A SUMMARY AT THE END OF YOUR MESSAGE.**
- **DO NOT PROVIDE SUGGESTIONS OR ASK QUESTIONS AS A MEAN TO CONTINUE THE CONVERSATION.**
- **DO NOT GIVE POINTERS ON WHAT TO DO AT THE END OF THE MESSAGE**
"""
end
end