The suggestions were getting split at character level and not at sentence level (#436)

* fix the issue where the suggestions were split at character level

* Update contextual_memory.py

---------

Co-authored-by: rajib76 <rajib76@yahoo.com>
Co-authored-by: João Moura <joaomdmoura@gmail.com>
This commit is contained in:
rajib
2024-04-07 01:57:23 -04:00
committed by GitHub
parent c31ac4cf7e
commit 106b0df42e

View File

@@ -43,7 +43,7 @@ class ContextualMemory:
formatted_results = "\n".join(
[f"{result['metadata']['suggestions']}" for result in ltm_results]
)
formatted_results = list(set(formatted_results))
formatted_results = list(set(formatted_results.split('\n')))
return f"Historical Data:\n{formatted_results}" if ltm_results else ""
def _fetch_entity_context(self, query) -> str: