From 2af40a18d6d001030b9742f7d7ec74cc77a612ea Mon Sep 17 00:00:00 2001 From: Yoichiro Hasebe Date: Sun, 15 Sep 2024 22:13:38 +0900 Subject: [PATCH] System prompt for "chat" apps modified to show long code blocks properly --- docker/services/ruby/apps/chat/chat_app.rb | 5 ++++- .../ruby/apps/code_interpreter/code_interpreter_app.rb | 2 +- .../ruby/apps/coding_assistant/coding_assistant_app.rb | 4 +++- .../ruby/apps/talk_to_claude/chat_with_claude_app.rb | 2 ++ .../ruby/apps/talk_to_cohere/chat_with_command_r_app.rb | 2 ++ .../ruby/apps/talk_to_gemini/chat_with_gemini_app.rb | 2 ++ .../ruby/apps/talk_to_mistral/chat_with_mistral_app.rb | 2 ++ 7 files changed, 16 insertions(+), 3 deletions(-) diff --git a/docker/services/ruby/apps/chat/chat_app.rb b/docker/services/ruby/apps/chat/chat_app.rb index 12220fce..f0a088a4 100644 --- a/docker/services/ruby/apps/chat/chat_app.rb +++ b/docker/services/ruby/apps/chat/chat_app.rb @@ -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 = { diff --git a/docker/services/ruby/apps/code_interpreter/code_interpreter_app.rb b/docker/services/ruby/apps/code_interpreter/code_interpreter_app.rb index ae97d1f2..806bd55e 100644 --- a/docker/services/ruby/apps/code_interpreter/code_interpreter_app.rb +++ b/docker/services/ruby/apps/code_interpreter/code_interpreter_app.rb @@ -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, diff --git a/docker/services/ruby/apps/coding_assistant/coding_assistant_app.rb b/docker/services/ruby/apps/coding_assistant/coding_assistant_app.rb index f39407bf..7b6af1b8 100644 --- a/docker/services/ruby/apps/coding_assistant/coding_assistant_app.rb +++ b/docker/services/ruby/apps/coding_assistant/coding_assistant_app.rb @@ -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 = { @@ -25,6 +27,6 @@ class CodingAssistant < MonadicApp initiate_from_assistant: false, image: true, pdf: false, - mathjax: true + mathjax: false } end diff --git a/docker/services/ruby/apps/talk_to_claude/chat_with_claude_app.rb b/docker/services/ruby/apps/talk_to_claude/chat_with_claude_app.rb index b5c93a60..586960c4 100644 --- a/docker/services/ruby/apps/talk_to_claude/chat_with_claude_app.rb +++ b/docker/services/ruby/apps/talk_to_claude/chat_with_claude_app.rb @@ -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 = { diff --git a/docker/services/ruby/apps/talk_to_cohere/chat_with_command_r_app.rb b/docker/services/ruby/apps/talk_to_cohere/chat_with_command_r_app.rb index f312f2c5..4090e672 100644 --- a/docker/services/ruby/apps/talk_to_cohere/chat_with_command_r_app.rb +++ b/docker/services/ruby/apps/talk_to_cohere/chat_with_command_r_app.rb @@ -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 = { diff --git a/docker/services/ruby/apps/talk_to_gemini/chat_with_gemini_app.rb b/docker/services/ruby/apps/talk_to_gemini/chat_with_gemini_app.rb index 71b27383..5b7e6758 100644 --- a/docker/services/ruby/apps/talk_to_gemini/chat_with_gemini_app.rb +++ b/docker/services/ruby/apps/talk_to_gemini/chat_with_gemini_app.rb @@ -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 = { diff --git a/docker/services/ruby/apps/talk_to_mistral/chat_with_mistral_app.rb b/docker/services/ruby/apps/talk_to_mistral/chat_with_mistral_app.rb index ab86eb39..4fa4882c 100644 --- a/docker/services/ruby/apps/talk_to_mistral/chat_with_mistral_app.rb +++ b/docker/services/ruby/apps/talk_to_mistral/chat_with_mistral_app.rb @@ -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