keynes42 commited on
Commit
9938c97
·
verified ·
1 Parent(s): cb50047

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -110,12 +110,12 @@ class BasicAgent(LocalLLM):
110
  # )
111
 
112
  def _serialize_messages(self, messages):
113
- prompt = []
114
- for m in messages:
115
- role = m['role'].value # "system" / "user" / "assistant"
116
- text = "".join([c['text'] for c in m['content']])
117
- prompt.append(f"{role}: {text}")
118
- return "\n".join(prompt)
119
 
120
  def __call__(self, question: str) -> str:
121
  print(f"Agent received question (first 50 chars): {question[:50]}...")
 
110
  # )
111
 
112
  def _serialize_messages(self, messages):
113
+ prompt = []
114
+ for m in messages:
115
+ role = m['role'].value # "system" / "user" / "assistant"
116
+ text = "".join([c['text'] for c in m['content']])
117
+ prompt.append(f"{role}: {text}")
118
+ return "\n".join(prompt)
119
 
120
  def __call__(self, question: str) -> str:
121
  print(f"Agent received question (first 50 chars): {question[:50]}...")