import re from datetime import datetime from typing import Optional from IPython.display import HTML, display from sqlalchemy.testing.plugin.plugin_base import warnings from letta.local_llm.constants import ASSISTANT_MESSAGE_CLI_SYMBOL, INNER_THOUGHTS_CLI_SYMBOL def pprint(messages): """Utility function for pretty-printing the output of client.send_message in notebooks""" css_styles = """ """ html_content = css_styles + "
🛠️ [{date_formatted}] Function Return ({return_status}):
" html_content += f"{return_string}
" elif "internal_monologue" in message: html_content += f"{INNER_THOUGHTS_CLI_SYMBOL} [{date_formatted}] Internal Monologue:
" html_content += f"{message['internal_monologue']}
" elif "function_call" in message: html_content += f"🛠️ [[{date_formatted}] Function Call:
" html_content += f"{message['function_call']}
" elif "assistant_message" in message: html_content += f"{ASSISTANT_MESSAGE_CLI_SYMBOL} [{date_formatted}] Assistant Message:
" html_content += f" " html_content += "