solalatus commited on
Commit
159ef2e
·
1 Parent(s): d8c9b58

ding shaky tutor flow

Browse files
Files changed (1) hide show
  1. agent.py +16 -1
agent.py CHANGED
@@ -131,9 +131,22 @@ class QMLAgent():
131
 
132
  It is able to process and understand large amounts of text, and can use this knowledge to provide accurate and informative responses to a wide range of questions. Additionally, {assistant_name} is able to generate its own text based on the input it receives, allowing it to engage in discussions and provide explanations and descriptions on a wide range of topics.
133
 
 
 
 
 
134
  Whether you need help with a specific question or just want to have a conversation about a particular topic, {assistant_name} is here to assist.
135
  """
136
- #{assistant_name} is especially helpful in tutoring. If the student explicitly asks for tutoring, {assistant_name} can come up with relevant and interesting questions, pose it to the student and help him/her to discover the answer step by step.
 
 
 
 
 
 
 
 
 
137
 
138
  self.agent_chain = initialize_agent(
139
  tools,
@@ -146,6 +159,8 @@ Whether you need help with a specific question or just want to have a conversati
146
  agent_kwargs={"system_message": PREFIX}
147
  )
148
 
 
 
149
  def run(self, question):
150
  return self.agent_chain.run(question)
151
 
 
131
 
132
  It is able to process and understand large amounts of text, and can use this knowledge to provide accurate and informative responses to a wide range of questions. Additionally, {assistant_name} is able to generate its own text based on the input it receives, allowing it to engage in discussions and provide explanations and descriptions on a wide range of topics.
133
 
134
+ {assistant_name} is especially helpful in tutoring. If the student explicitly asks for tutoring, {assistant_name} can come up with relevant and interesting questions, pose it to the student and help him/her to discover the answer step by step.
135
+
136
+ Tutoring is done by 1. recognizing students wish to be asked questions 2. getting a random part of the course material 3. asking some questions from the student 4. hekping him get to the right answer.
137
+
138
  Whether you need help with a specific question or just want to have a conversation about a particular topic, {assistant_name} is here to assist.
139
  """
140
+ #
141
+
142
+ TEMPLATE_TOOL_RESPONSE = """TOOL RESPONSE:
143
+ ---------------------
144
+ {observation}
145
+
146
+ USER'S INPUT
147
+ --------------------
148
+
149
+ Okay, so do what I asked for now or answer me if I asked something! If using information obtained from the tools you must mention it explicitly without mentioning the tool names - I have forgotten all TOOL RESPONSES! But if you are talking about code, always explicitly include it, as plain text, no ` marks. Remember to respond with a markdown code snippet of a json blob with a single action, and NOTHING else, but NEVER use ` marks. There should not be any code blocks, just include code as a normal part of text."""
150
 
151
  self.agent_chain = initialize_agent(
152
  tools,
 
159
  agent_kwargs={"system_message": PREFIX}
160
  )
161
 
162
+ self.agent_chain.agent.template_tool_response = TEMPLATE_TOOL_RESPONSE
163
+
164
  def run(self, question):
165
  return self.agent_chain.run(question)
166