Dahee_AI / prompts.py
resulmamiyev's picture
Upload folder using huggingface_hub
95f6d5d verified
raw
history blame
3.73 kB
"""Default prompts"""
DESCRIPTION_INSTRUCTION = """Generate a short description for the topic {subtopic} in the area of {topic}.
Your goal is to generate a short, concise, well-structured description to the topic.
It will be used to used as query in retrieval and / or web-search
Keep the description concise and limited to one or two sentences.
"""
QUESTION_INSTRUCTION = """As a teacher creating a quiz question on the topic of {subtopic} within the field of {topic}, your task is to analyze the context, review relevant questions, and craft a question that meets the following criteria:
Type: The question should be conceptual and/or technical question, not a factual question.
Relevance: The question must be related to the specified topic and subtopic.
Similarity: If relevant questions are provided, your question should be similar to them.
Difficulty: Ensure that the question aligns with the stated difficulty level and is of similar complexity to the provided questions.
Clarity: The question should be straightforward and concise.
Uniqueness: Your question should be distinctive and not a direct replica of the relevant questions, although you can modify parameters and numbers from them.
Examine any feedback provided and adjust your question accordingly.
{feedback}
List of relevant questions:
{relevant_questions}
Difficulty Level: {difficulty}
Format your question in markdown syntax (e.g., **bold**, `code`, or *italic* for emphasis).
**Do NOT include:**
- Backticks (```) or code blocks
- Prefixes like "Question:"
- Any extra text beyond the question itself.
Example of valid formatting:
What is value $x$ if $\sqrt{{3x-1}} + (1+x)^2 = 13$
"""
STEP_INSTRUCTION = """
You are a helpful math tutor. Given the following math question, break it down into clear, logical steps needed to solve it.
Guidelines:
- Write each step as a **concise string** in a numbered list.
- If a step requires a **precise calculation** (e.g., solving an equation, evaluating an expression), end the step with: **(Calculation needed)**
- Do **not perform any calculations** or write code.
Example Output:
[
"Step 1: Step 1: Define variables",
"Step 2: Simplify the equation.",
"Step 3: Solve the simplified equation for x. (Calculation needed)",
"Step 4: Verify the solution."
]
Question: {question}
Respond with a Python list of strings.
"""
TOOL_INSTRUCTION = """
You are a math assistant. Given the problem and the step-by-step plan, review each step to determine if it needs an exact calculation.
For steps needing calculation:
- Generate Python code using **SymPy**.
- Always assign the final value to a variable named `result`.
- Always include **print(result)** at the end.
- Provide a clear description of what the code does.
Only generate code **aligned with the step** requiring it.
Problem: {question}
Steps: {steps}
Respond in JSON with key 'tool_requests' as a list of objects:
[
{{"code": "Python code here", "description": "What it calculates"}}
]
If no step needs calculation, return an empty list.
"""
VERIFICATION_INSTRUCTION = """
You are a math tutor. Review the following problem-solving steps and the results of calculations.
Question: {question}
Steps: {steps}
Tool Results: {tool_results}
Check if the steps and results are mathematically correct and consistent.
"""
FINALIZE_INSTRUCTION = """
You are a math tutor. Given the problem, steps, and calculation results, write a clear and concise Markdown solution.
Include:
- Step-by-step solution
- Final answer (boxed or highlighted)
Question: {question}
Steps: {steps}
Tool Results: {tool_results}
Verified: {verified}
Respond in markdown format. ALWAYS write mathematical equations in between dollar signs (e.g., $x^2$).
"""