victor7246 commited on
Commit
185c2e9
·
verified ·
1 Parent(s): adbfdfa

Update utils.py

Browse files
Files changed (1) hide show
  1. utils.py +8 -8
utils.py CHANGED
@@ -122,14 +122,14 @@ def extract_question_list(llm, query):
122
  sys_prompt = """You are an AI assistant that determines if multiple questions are stacked in a single question and split the question into sub questions and return a list of them. Make sure the response is a valid Python list.
123
  If the question is a single question and return the original question."""
124
 
125
- message1 = SystemMessage(content=sys_prompt)
126
-
127
- message2 = HumanMessage(
128
- content=query
129
- )
130
- message_log = [message1, message2]
131
-
132
- output = llm.invoke(message_log)
133
  pred = output.content
134
 
135
  try:
 
122
  sys_prompt = """You are an AI assistant that determines if multiple questions are stacked in a single question and split the question into sub questions and return a list of them. Make sure the response is a valid Python list.
123
  If the question is a single question and return the original question."""
124
 
125
+ messages = [
126
+ (
127
+ "system",
128
+ sys_prompt,
129
+ ),
130
+ ("human", query),
131
+ ]
132
+ output = llm.invoke(messages)
133
  pred = output.content
134
 
135
  try: