dlaima commited on
Commit
e42b534
·
verified ·
1 Parent(s): 9ccf47b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -7
app.py CHANGED
@@ -37,14 +37,11 @@ class MyAgent:
37
  )
38
 
39
  def __call__(self, question: str) -> str:
40
- messages = [
41
- {"role": "system", "content": SYSTEM_PROMPT},
42
- {"role": "user", "content": question}
43
- ]
44
  try:
45
- response = self.model.chat(messages)
46
- raw_output = response["content"]
47
- return extract_final_answer(raw_output)
48
  except Exception as e:
49
  import traceback
50
  traceback.print_exc()
 
37
  )
38
 
39
  def __call__(self, question: str) -> str:
40
+ # Combine system prompt and user question as a single input
41
+ full_prompt = f"{SYSTEM_PROMPT}\n\nUser question: {question}"
 
 
42
  try:
43
+ output = self.model.run(full_prompt)
44
+ return extract_final_answer(output)
 
45
  except Exception as e:
46
  import traceback
47
  traceback.print_exc()