From 4b1d5aa2b63bfdb2baa60eb8d974fc0a33d74a24 Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Fri, 19 Jan 2024 17:22:10 -0300 Subject: [PATCH] Add get_cache method to ChatService --- src/backend/langflow/services/chat/service.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/backend/langflow/services/chat/service.py b/src/backend/langflow/services/chat/service.py index 91fe98845..cf9a008d1 100644 --- a/src/backend/langflow/services/chat/service.py +++ b/src/backend/langflow/services/chat/service.py @@ -235,6 +235,12 @@ class ChatService(Service): except Exception as exc: logger.error(f"Error closing connection: {exc}") self.disconnect(client_id) + + def get_cache(self, client_id: str) -> Any: + """ + Get the cache for a client. + """ + return self.chat_cache.get(client_id) def dict_to_markdown_table(my_dict): @@ -257,4 +263,4 @@ def list_of_dicts_to_markdown_table(dict_list): row = [str(row_dict.get(header, "")) for header in headers] markdown_table += "| " + " | ".join(row) + " |\n" - return markdown_table + return markdown_table \ No newline at end of file