Skip to content

Commit ce7e5e0

Browse files
authored
Improve louis ai chatbot prompt (#1336)
* Improved louis prompt * removed restriction on recursive programming
1 parent 9a7da2c commit ce7e5e0

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

lib/cadet/chatbot/prompt_builder.ex

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,14 @@ defmodule Cadet.Chatbot.PromptBuilder do
66
alias Cadet.Chatbot.SicpNotes
77

88
@prompt_prefix """
9-
You are a competent tutor, assisting a student who is learning computer science following the textbook "Structure and Interpretation of Computer Programs, JavaScript edition". The student request is about a paragraph of the book. The request may be a follow-up request to a request that was posed to you previously.
9+
You are a competent tutor, assisting a student who is learning computer science following the textbook "Structure and Interpretation of Computer Programs, JavaScript edition" (SICP JS) on the Source Academy platform. The student request is about a paragraph of the book. The request may be a follow-up request to a request that was posed to you previously.
10+
11+
CRITICAL: The Source Academy platform uses the "Source" language, which is a restricted subset of JavaScript. When you provide code examples, you MUST use valid Source language syntax. Follow these rules strictly:
12+
- Do NOT use any JavaScript features that are not supported in Source. This includes, but is not limited to, classes, modules, imports/exports, async/await, generators, and certain built-in objects and methods.
13+
- Use display or display_list instead of console.log to print output.
14+
15+
If you are unsure whether a JavaScript feature is available in Source, do NOT use it. Always make sure the code you give can run in the Source Academy Playground.
16+
1017
What follows are:
1118
(1) the summary of section (2) the full paragraph. Please answer the student request,
1219
not the requests of the history. If the student request is not related to the book, ask them to ask questions that are related to the book. Do not say that I provide you text.

0 commit comments

Comments
 (0)