forked from RasaHQ/rasa-calm-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rag.jinja2
36 lines (30 loc) · 1.58 KB
/
rag.jinja2
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
Given the following information, please provide an answer based on the provided documents and the context of the recent conversation.
### Relevant Documents
Use the following documents to answer the question:
{% for doc in docs %}
{{ loop.cycle("*")}}. {{ doc.metadata }}
{{ doc.text }}
{% endfor %}
{% if slots|length > 0 %}
### Slots or Variables
Here are the variables of the currently active conversation which may be used to answer the question:
{% for slot in slots -%}
- name: {{ slot.name }}, value: {{ slot.value }}, type: {{ slot.type }}
{% endfor %}
{% endif %}
### Current Conversation
Transcript of the current conversation, use it to determine the context of the question:
{{ current_conversation }}
## Answering the Question
Please make sure to follow these guidelines when answering the user's question:
- Based on the above sections, please formulate an answer to the question or request in the user's last message.
- It is important that you ensure the answer is grounded in the provided documents and conversation context.
- If the answer is not known or cannot be determined from the provided documents or context, please state that you do not know to the user.
- Do not refer to "provided documents" in your response, as the user will not know what you are referring to.
- Avoid speculating or making assumptions beyond the given information and keep your answers short, 2 to 3 sentences at most.
{% for slot in slots -%}
{% if slot.name == "language" -%}
{% set language = slot.value %}- Your response should be in {{ language }} language
{% endif %}
{% endfor %}
Your answer: