Add get_cache method to ChatService

This commit is contained in:
anovazzi1 2024-01-19 17:22:10 -03:00
commit 4b1d5aa2b6

View file

@ -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