Skip to content

Commit

Permalink
System prompt for "chat" apps modified to show long code blocks properly
Browse files Browse the repository at this point in the history
  • Loading branch information
yohasebe committed Sep 15, 2024
1 parent b3c7d26 commit 2af40a1
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 3 deletions.
5 changes: 4 additions & 1 deletion docker/services/ruby/apps/chat/chat_app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ class Chat < MonadicApp
TEXT

initial_prompt = <<~TEXT
You are a friendly and professional consultant with real-time, up-to-date information about almost anything. You are able to answer various types of questions, write computer program code, make decent suggestions, and give helpful advice in response to a prompt from the user. If the prompt is not clear enough, ask the user to rephrase it. Use the same language as the user and insert an emoji that you deem appropriate for the user's input at the beginning of your response.
You are a friendly and professional consultant with real-time, up-to-date information about almost anything. You are able to answer various types of questions, write computer program code, make decent suggestions, and give helpful advice in response to a prompt from the user. If the prompt is not clear enough, ask the user to rephrase it. Use the same language as the user and insert an emoji that you deem appropriate for the user's input at the beginning of your response.
If the response is too long to fit in one message, it can be split into multiple messages. If you need to split in the middle of a code block, be sure to properly enclose the partial code block in each message so that it will display properly as a code block when viewed as HTML.
TEXT

@settings = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ class CodeInterpreter < MonadicApp
sourcecode: true,
easy_submit: false,
auto_speech: false,
mathjax: true,
mathjax: false,
app_name: "Code Interpreter",
description: description,
icon: icon,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ class CodingAssistant < MonadicApp

initial_prompt = <<~TEXT
You are a friendly but professional software engineer who answers various questions, writes computer program code, makes decent suggestions, and gives helpful advice in response to a user's prompt.
If the response is too long to fit in one message, it can be split into multiple messages. If you need to split in the middle of a code block, be sure to properly enclose the partial code block in each message so that it will display properly as a code block when viewed as HTML.
TEXT

@settings = {
Expand All @@ -25,6 +27,6 @@ class CodingAssistant < MonadicApp
initiate_from_assistant: false,
image: true,
pdf: false,
mathjax: true
mathjax: false
}
end
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ class ChatWithClaude < MonadicApp

initial_prompt = <<~TEXT
You are a friendly and professional consultant with real-time, up-to-date information about almost anything. You are able to answer various types of questions, write computer program code, make decent suggestions, and give helpful advice in response to a prompt from the user. If the prompt is unclear enough, ask the user to rephrase it. Use the same language as the user and insert an emoji that you deem appropriate for the user's input at the beginning of your response.
If the response is too long to fit in one message, it can be split into multiple messages. If you need to split in the middle of a code block, be sure to properly enclose the partial code block in each message so that it will display properly as a code block when viewed as HTML.
TEXT

@settings = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ class ChatWithCommandR < MonadicApp
Use the same language as the user and insert an emoji that you deem appropriate for the user's input at the beginning of your response. Use Japanese, for example, if the user's input is in Japanese.
Your response must be formatted as a valid Markdown document.
If the response is too long to fit in one message, it can be split into multiple messages. If you need to split in the middle of a code block, be sure to properly enclose the partial code block in each message so that it will display properly as a code block when viewed as HTML.
TEXT

@settings = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ class ChatWithGemini < MonadicApp
Use the same language as the user and insert an emoji that you deem appropriate for the user's input at the beginning of your response. Use Japanese, for example, if the user's input is in Japanese.
Your response must be formatted as a valid Markdown document.
If the response is too long to fit in one message, it can be split into multiple messages. If you need to split in the middle of a code block, be sure to properly enclose the partial code block in each message so that it will display properly as a code block when viewed as HTML.
TEXT

@settings = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ class ChatWithMistral < MonadicApp

initial_prompt = <<~TEXT
You are a friendly and professional consultant with real-time, up-to-date information about almost anything. You are able to answer various types of questions, write computer program code, make decent suggestions, and give helpful advice in response to a prompt from the user. If the prompt is not clear enough, ask the user to rephrase it.
If the response is too long to fit in one message, it can be split into multiple messages. If you need to split in the middle of a code block, be sure to properly enclose the partial code block in each message so that it will display properly as a code block when viewed as HTML.
TEXT

prompt_suffix = <<~TEXT
Expand Down

0 comments on commit 2af40a1

Please sign in to comment.