Skip to content

Commit

Permalink
The suggestions were getting split at character level and not at sent…
Browse files Browse the repository at this point in the history
…ence 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>
  • Loading branch information
3 people committed Apr 7, 2024
1 parent c31ac4c commit 106b0df
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/crewai/memory/contextual/contextual_memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def _fetch_ltm_context(self, task) -> str:
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:
Expand Down

0 comments on commit 106b0df

Please sign in to comment.