### What problem does this PR solve? #4929 ### Type of change - [x] Performance Improvementtags/v0.17.0
| @@ -204,9 +204,6 @@ def chat(dialog, messages, stream=True, **kwargs): | |||
| attachments = kwargs["doc_ids"].split(",") if "doc_ids" in kwargs else None | |||
| if "doc_ids" in messages[-1]: | |||
| attachments = messages[-1]["doc_ids"] | |||
| for m in messages[:-1]: | |||
| if "doc_ids" in m: | |||
| attachments.extend(m["doc_ids"]) | |||
| create_retriever_ts = timer() | |||