Fix agent retrieval nothing (#2283)

### What problem does this PR solve?

Fix agent retrieval nothing

### Type of change

- [✓] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
wwwlll 2024-09-06 15:02:41 +08:00 committed by GitHub
parent c6e723f2ee
commit b5a2711c05
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -54,8 +54,8 @@ class Retrieval(ComponentBase, ABC):
for role, cnt in history[::-1][:self._param.message_history_window_size]:
if role != "user":continue
query.append(cnt)
query = "\n".join(query)
# query = "\n".join(query)
query = query[0]
kbs = KnowledgebaseService.get_by_ids(self._param.kb_ids)
if not kbs:
raise ValueError("Can't find knowledgebases by {}".format(self._param.kb_ids))