Skip to content

Commit 6635625

Browse files
committed
Added comments detailing function of loaded models + fix prompt typos
1 parent 7ba0d8e commit 6635625

File tree

2 files changed

+17
-15
lines changed

2 files changed

+17
-15
lines changed

app/agents/chain_of_thoughts.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ class ChainOfThoughtsAgent(BaseAgent):
4747

4848
def __init__(self, guidance, llama_model, llama_model2):
4949
self.guidance = guidance
50+
# We first load the model in charge of reasoning along the guidance program
5051
self.llama_model = llama_model
52+
# We then load the model in charge of correctly identifying the data within the context and provide an answer
5153
self.llama_model2 = llama_model2
5254

5355

app/prompt_templates/qa_agent.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
{{~/system}}
88
99
{{#block hidden=True}}
10-
{{~! The assistant either starts the conversation or not, depending on if the user query is offensive or no}}
10+
{{~! The assistant either starts the conversation or not, depending on if the user's query is offensive or not}}
1111
{{#user~}}
12-
Utilizing your extensive understanding of common moral and ethical principles, please evaluate the following user's query {{question}}. Analyze the potential implications and outcomes associated with the query, considering various ethical frameworks such as consequentialism, deontology, and virtue ethics, among others. Also consider the social, cultural, and legal context of the query. Is the user's query ethical and/or moral?
12+
Utilizing your extensive understanding of common moral and ethical principles, please evaluate the following user's query: {{question}}. Analyze the potential implications and outcomes associated with the query, considering various ethical frameworks such as consequentialism, deontology, and virtue ethics, among others. Also consider the social, cultural, and legal context of the query. Is the user's query ethical and/or moral?
1313
{{~/user}}
1414
1515
{{#assistant~}}
@@ -34,10 +34,10 @@
3434
{{~/assistant}}
3535
3636
{{#if (equal query_type "Phatic")~}}
37-
Observation: The user's query is conversational. I need to answer as an helpful assistant while taking into account our chat history;
37+
Observation: The user's query is conversational. I need to answer as a helpful assistant while taking into account our chat history;
3838
Chat history: {{history}}
3939
Latest user message: {{question}}
40-
Thought: I need to stay in my role of an helpful assistant and make casual conversation.
40+
Thought: I need to stay in my role of a helpful assistant and make casual conversation.
4141
Final Answer: {{gen 'phatic answer' temperature=0.7 max_tokens=50}}
4242
{{else}}
4343
@@ -100,10 +100,10 @@
100100
{{~/assistant}}
101101
102102
{{#if (equal query_type "Phatic")~}}
103-
Observation: The user's query is conversational. I need to answer as an helpful assistant while taking into account our chat history;
103+
Observation: The user's query is conversational. I need to answer as a helpful assistant while taking into account our chat history;
104104
Chat history: {{history}}
105105
Latest user message: {{question}}
106-
Thought: I need to stay in my role of an helpful assistant and make casual conversation.
106+
Thought: I need to stay in my role of a helpful assistant and make casual conversation.
107107
Final Answer: {{gen 'phatic answer' temperature=0.7 max_tokens=50}}
108108
{{else}}
109109
@@ -138,7 +138,7 @@
138138
Search: Useful for when you need to answer questions about current events. The input is the question to search relevant information.
139139
{{~/system}}
140140
141-
{{~! The assistant either starts the conversation or not, depending on if the user query is offensive or no}}
141+
{{~! The assistant either starts the conversation or not, depending on if the user's query is offensive or not}}
142142
{{#user~}}
143143
Utilizing your extensive understanding of common moral and ethical principles, please evaluate the following user's query {{question}}. Analyze the potential implications and outcomes associated with the query, considering various ethical frameworks such as consequentialism, deontology, and virtue ethics, among others. Also consider the social, cultural, and legal context of the query. Is the user's query ethical and/or moral?
144144
{{~/user}}
@@ -156,13 +156,13 @@
156156
{{#system~}}
157157
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
158158
### Instruction:
159-
You are an helpful assistant. Answer the following questions as best you can. You have access to the following tools:
159+
You are a helpful assistant. Answer the following questions as best you can. You have access to the following tools:
160160
Search: Useful for when you need to answer questions about current events. The input is the question to search relevant information.
161161
{{~/system}}
162162
163-
{{~! The assistant either starts the conversation or not, depending on if the user query is offensive or no}}
163+
{{~! The assistant either starts the conversation or not, depending on if the user's query is offensive or not}}
164164
{{#user~}}
165-
Utilizing your extensive understanding of common moral and ethical principles, please evaluate the following user's query {{question}}. Analyze the potential implications and outcomes associated with the query, considering various ethical frameworks such as consequentialism, deontology, and virtue ethics, among others. Also consider the social, cultural, and legal context of the query. Is the user's query ethical and/or moral?
165+
Utilizing your extensive understanding of common moral and ethical principles, please evaluate the following user's query: {{question}}. Analyze the potential implications and outcomes associated with the query, considering various ethical frameworks such as consequentialism, deontology, and virtue ethics, among others. Also consider the social, cultural, and legal context of the query. Is the user's query ethical and/or moral?
166166
{{~/user}}
167167
{{#assistant~}}
168168
Observation: Let's see if the query is inherently offensive.
@@ -174,7 +174,7 @@
174174
{{#system~}}
175175
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
176176
### Instruction:
177-
You are an helpful assistant. Answer the following questions as best you can. You have access to the following tools:
177+
You are a helpful assistant. Answer the following questions as best you can. You have access to the following tools:
178178
Search: Useful for when you need to answer questions about current events. The input is the question to search relevant information.
179179
{{~/system}}
180180
{{~! The assistant then classifies the user intent to decide whether he needs to enter qa mode}}
@@ -193,11 +193,11 @@
193193
{{#system~}}
194194
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
195195
### Instruction:
196-
You are an helpful assistant. Answer the following questions as best you can. You have access to the following tools:
196+
You are a helpful assistant. Answer the following questions as best you can. You have access to the following tools:
197197
Search: Useful for when you need to answer questions about current events. The input is the question to search relevant information.
198198
{{~/system}}
199199
200-
Observation: The user's query is conversational. I need to answer him as an helpful assistant while taking into account our chat history;
200+
Observation: The user's query is conversational. I need to answer him as a helpful assistant while taking into account our chat history;
201201
Chat history: {{history}}
202202
Latest user message: {{question}}
203203
Final Answer: {{gen 'phatic_answer' temperature=0 max_tokens=50}}'''
@@ -206,7 +206,7 @@
206206
{{#system~}}
207207
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
208208
### Instruction:
209-
You are an helpful assistant. Follow user queries as best you can. You have access to the following tools:
209+
You are a helpful assistant. Follow user queries as best you can. You have access to the following tools:
210210
Search: Useful for when you need to answer questions about factual information. The input is the question to search relevant information.
211211
{{~/system}}
212212
@@ -227,7 +227,7 @@
227227
{{#system~}}
228228
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
229229
### Instruction:
230-
You are an helpful assistant. Answer the following questions as best you can. You have access to the following tools:
230+
You are a helpful assistant. Answer the following questions as best you can. You have access to the following tools:
231231
Search: Useful for when you need to answer questions about current events. The input is the question to search relevant information.
232232
{{~/system}}
233233

0 commit comments

Comments
 (0)