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 defp build_instructions(collection_summary, record_count) do
Prompt.build(""" Prompt.build("""
Answer questions about the user's music collection. \ Answer questions about the user's music collection.
Use the provided collection catalog as your primary reference. \ Use the provided collection catalog as your primary reference.
The collection contains #{record_count} records. The collection contains #{record_count} records.
Collection catalog: Collection catalog:
#{collection_summary}\ #{collection_summary}
""") """)
end end
end end
+16 -10
View File
@@ -17,29 +17,35 @@ defmodule MusicLibrary.Chats.Prompt do
""" """
#{identity} #{identity}
# YOUR TASK
#{text} #{text}
#{approach}\ #{approach}
""" """
end end
defp default_identity do defp default_identity do
""" """
You are a knowledgeable music assistant.\ # IDENTITY
You are a knowledgeable music assistant.
""" """
end end
defp default_approach do defp default_approach do
""" """
Use web search to find additional up-to-date \ # APPROACH AND TONE
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 \ - Use web search to find additional up-to-date information when helpful.
discussed in the conversation. Refer back to earlier points naturally \ - Be concise and accurate. When unsure, say so.
instead of restating them. DO NOT INCLUDE A SUMMARY AT THE END OF YOUR MESSAGE. \ - Include links when they add genuine value, and at least one per response (but not one per paragraph).
DO NOT PROVIDE SUGGESTIONS OR ASK QUESTIONS AS A MEAN TO CONTINUE THE CONVERSATION.\ - 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
end end