File size: 3,379 Bytes
33da45a 9e66fdb 33da45a 416959e 33da45a |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
{{- bos_token }}
{%- if custom_tools is defined %}
{%- set tools = custom_tools %}
{%- endif %}
{%- if not tools_in_user_message is defined %}
{%- set tools_in_user_message = true %}
{%- endif %}
{%- if not date_string is defined %}
{%- if strftime_now is defined %}
{%- set date_string = strftime_now("%d %b %Y") %}
{%- else %}
{%- set date_string = "26 Jul 2024" %}
{%- endif %}
{%- endif %}
{%- if not tools is defined %}
{%- set tools = none %}
{%- endif %}
{%- if messages[0]['role'] == 'system' %}
{%- set system_message = messages[0]['content']|trim %}
{%- set messages = messages[1:] %}
{%- else %}
{%- set system_message = "" %}
{%- endif %}
{{- "<|start_header_id|>system<|end_header_id|>
" }}
{{- "Cutting Knowledge Date: December 2023
" }}
{{- "Today Date: " + date_string + "
" }}
You are an MCQ Generation Assistant. You will only respond to prompts asking for multiple-choice questions (MCQs) related to the following topics: Python, SQL, Machine Learning, Excel, Statistics, Power BI, and Tableau.
If a prompt is unrelated to generating MCQs or outside of the allowed topics, you must respond with the exact string: "Error"
You will respond only with Python list-of-dictionaries, where each dictionary contains:
- question_no
- Question
- Option_a
- Option_b
- Option_c
- Option_d
- correct_answer
The correct answer key will have the answer provided in the options and not the option number itself.
Example:
User Input:
Generate 1 MCQ on Python strings.
Expected Output:
[
{
'question_no': 1,
'Question': 'What is the purpose of the square brackets in indexing a string in Python?',
'Option_a': 'To access the first character of the string',
'Option_b': 'To access the last character of the string',
'Option_c': 'To access the character at a specific position in the string',
'Option_d': 'To access the character at the beginning of the string',
'correct_answer': 'To access the character at a specific position in the string'
}
]
Do not include explanations or metadata unless asked explicitly.
{{- "<|eot_id|>" }}
{%- for message in messages %}
{%- if not (message.role == 'ipython' or message.role == 'tool' or 'tool_calls' in message) %}
{{- '<|start_header_id|>' + message['role'] + '<|end_header_id|>
'+ message['content'] | trim + '<|eot_id|>' }}
{%- elif 'tool_calls' in message %}
{%- if not message.tool_calls|length == 1 %}
{{- raise_exception("This model only supports single tool-calls at once!") }}
{%- endif %}
{%- set tool_call = message.tool_calls[0].function %}
{{- '<|start_header_id|>assistant<|end_header_id|>
' -}}
{{- '{"name": "' + tool_call.name + '", ' }}
{{- '"parameters": ' }}
{{- tool_call.arguments | tojson }}
{{- "}" }}
{{- "<|eot_id|>" }}
{%- elif message.role == "tool" or message.role == "ipython" %}
{{- "<|start_header_id|>ipython<|end_header_id|>
" }}
{%- if message.content is mapping or message.content is iterable %}
{{- message.content | tojson }}
{%- else %}
{{- message.content }}
{%- endif %}
{{- "<|eot_id|>" }}
{%- endif %}
{%- endfor %}
{%- if add_generation_prompt %}
{{- '<|start_header_id|>assistant<|end_header_id|>
' }}
{%- endif %}
|