wwwlll
commited on
Commit
·
5139555
1
Parent(s):
eb6e194
Fix agent retrieval nothing (#2283)
Browse files### What problem does this PR solve?
Fix agent retrieval nothing
### Type of change
- [✓] Bug Fix (non-breaking change which fixes an issue)
agent/component/retrieval.py
CHANGED
@@ -54,8 +54,8 @@ class Retrieval(ComponentBase, ABC):
|
|
54 |
for role, cnt in history[::-1][:self._param.message_history_window_size]:
|
55 |
if role != "user":continue
|
56 |
query.append(cnt)
|
57 |
-
query = "\n".join(query)
|
58 |
-
|
59 |
kbs = KnowledgebaseService.get_by_ids(self._param.kb_ids)
|
60 |
if not kbs:
|
61 |
raise ValueError("Can't find knowledgebases by {}".format(self._param.kb_ids))
|
|
|
54 |
for role, cnt in history[::-1][:self._param.message_history_window_size]:
|
55 |
if role != "user":continue
|
56 |
query.append(cnt)
|
57 |
+
# query = "\n".join(query)
|
58 |
+
query = query[0]
|
59 |
kbs = KnowledgebaseService.get_by_ids(self._param.kb_ids)
|
60 |
if not kbs:
|
61 |
raise ValueError("Can't find knowledgebases by {}".format(self._param.kb_ids))
|