diff --git a/Gemma/Keras_Gemma_2_Quickstart.ipynb b/Gemma/Keras_Gemma_2_Quickstart.ipynb index a4f7bab..4de94fe 100644 --- a/Gemma/Keras_Gemma_2_Quickstart.ipynb +++ b/Gemma/Keras_Gemma_2_Quickstart.ipynb @@ -37,16 +37,13 @@ "id": "PXNm5_p_oxMF" }, "source": [ - "This is a quick demo of Gemma running on KerasNLP. To run this you will need:\n", - "- To be added to a private github repo for Gemma.\n", - "- To be added to a private Kaggle model for weights.\n", + "This is a quick demo of Gemma running on KerasNLP.\n", "\n", "Note that you will need a large GPU (e.g. A100) to run this as well.\n", "\n", "General Keras reading:\n", "- [Getting started with Keras](https://keras.io/getting_started/)\n", "- [Getting started with KerasNLP](https://keras.io/guides/keras_nlp/getting_started/)\n", - "- [Generation and fine-tuning guide for GPT2](https://keras.io/guides/keras_nlp/getting_started/)\n", "\n", "\n", "
\n", @@ -76,7 +73,9 @@ "from google.colab import userdata\n", "\n", "os.environ[\"KAGGLE_USERNAME\"] = userdata.get('KAGGLE_USERNAME')\n", - "os.environ[\"KAGGLE_KEY\"] = userdata.get('KAGGLE_KEY')" + "os.environ[\"KAGGLE_KEY\"] = userdata.get('KAGGLE_KEY')\n", + "\n", + "os.environ[\"KERAS_BACKEND\"] = \"jax\" # Or \"tensorflow\" or \"torch\"." ] }, { @@ -90,36 +89,15 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "metadata": { "id": "bMboT70Xop8G" }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - " Installing build dependencies ... \u001b[?25l\u001b[?25hdone\n", - " Getting requirements to build wheel ... \u001b[?25l\u001b[?25hdone\n", - " Preparing metadata (pyproject.toml) ... \u001b[?25l\u001b[?25hdone\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.1/1.1 MB\u001b[0m \u001b[31m21.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m5.2/5.2 MB\u001b[0m \u001b[31m72.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m311.2/311.2 kB\u001b[0m \u001b[31m35.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m589.8/589.8 MB\u001b[0m \u001b[31m2.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m5.3/5.3 MB\u001b[0m \u001b[31m95.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m2.2/2.2 MB\u001b[0m \u001b[31m76.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m5.5/5.5 MB\u001b[0m \u001b[31m107.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[?25h Building wheel for keras-nlp (pyproject.toml) ... \u001b[?25l\u001b[?25hdone\n", - "\u001b[31mERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.\n", - "tf-keras 2.15.1 requires tensorflow<2.16,>=2.15, but you have tensorflow 2.16.1 which is incompatible.\u001b[0m\u001b[31m\n", - "\u001b[0m" - ] - } - ], + "outputs": [], "source": [ "# Install all deps\n", - "!pip install keras\n", - "!pip install keras-nlp" + "!pip install -U keras-nlp\n", + "!pip install -U keras==3.3.3" ] }, { @@ -137,42 +115,29 @@ "metadata": { "id": "ww83zI9ToPso" }, - "outputs": [], - "source": [ - "import os\n", - "\n", - "os.environ[\"KERAS_BACKEND\"] = \"jax\" # Or \"tensorflow\" or \"torch\".\n", - "\n", - "import keras_nlp\n", - "import keras\n", - "\n", - "# Run at half precision.\n", - "keras.config.set_floatx(\"bfloat16\")" - ] - }, - { - "cell_type": "code", - "execution_count": 9, - "metadata": { - "id": "yygIK9DEIldp" - }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ - "Downloading from https://www.kaggle.com/api/v1/models/keras/gemma2/keras/gemma2_9b_en/3/download/metadata.json...\n", - "100%|██████████| 143/143 [00:00<00:00, 179kB/s]\n", - "Downloading from https://www.kaggle.com/api/v1/models/keras/gemma2/keras/gemma2_9b_en/3/download/task.json...\n", - "Downloading from https://www.kaggle.com/api/v1/models/keras/gemma2/keras/gemma2_9b_en/3/download/config.json...\n", - "100%|██████████| 780/780 [00:00<00:00, 895kB/s]\n", - "Downloading from https://www.kaggle.com/api/v1/models/keras/gemma2/keras/gemma2_9b_en/3/download/model.weights.h5...\n", - "100%|██████████| 17.2G/17.2G [18:34<00:00, 16.6MB/s]\n", - "Downloading from https://www.kaggle.com/api/v1/models/keras/gemma2/keras/gemma2_9b_en/3/download/preprocessor.json...\n", - "Downloading from https://www.kaggle.com/api/v1/models/keras/gemma2/keras/gemma2_9b_en/3/download/tokenizer.json...\n", - "100%|██████████| 315/315 [00:00<00:00, 431kB/s]\n", - "Downloading from https://www.kaggle.com/api/v1/models/keras/gemma2/keras/gemma2_9b_en/3/download/assets/tokenizer/vocabulary.spm...\n", - "100%|██████████| 4.04M/4.04M [00:01<00:00, 2.41MB/s]\n" + "Downloading from https://www.kaggle.com/api/v1/models/keras/gemma2/keras/gemma2_9b_en/1/download/model.safetensors...\n", + "Downloading from https://www.kaggle.com/api/v1/models/keras/gemma2/keras/gemma2_9b_en/1/download/model.safetensors.index.json...\n", + "Downloading from https://www.kaggle.com/api/v1/models/keras/gemma2/keras/gemma2_9b_en/1/download/metadata.json...\n", + "100%|██████████| 143/143 [00:00<00:00, 153kB/s]\n", + "Downloading from https://www.kaggle.com/api/v1/models/keras/gemma2/keras/gemma2_9b_en/1/download/task.json...\n", + "Downloading from https://www.kaggle.com/api/v1/models/keras/gemma2/keras/gemma2_9b_en/1/download/config.json...\n", + "100%|██████████| 780/780 [00:00<00:00, 884kB/s]\n", + "Downloading from https://www.kaggle.com/api/v1/models/keras/gemma2/keras/gemma2_9b_en/1/download/model.safetensors...\n", + "Downloading from https://www.kaggle.com/api/v1/models/keras/gemma2/keras/gemma2_9b_en/1/download/model.safetensors.index.json...\n", + "Downloading from https://www.kaggle.com/api/v1/models/keras/gemma2/keras/gemma2_9b_en/1/download/model.weights.h5...\n", + "100%|██████████| 17.2G/17.2G [04:22<00:00, 70.5MB/s]\n", + "Downloading from https://www.kaggle.com/api/v1/models/keras/gemma2/keras/gemma2_9b_en/1/download/model.safetensors...\n", + "Downloading from https://www.kaggle.com/api/v1/models/keras/gemma2/keras/gemma2_9b_en/1/download/model.safetensors.index.json...\n", + "Downloading from https://www.kaggle.com/api/v1/models/keras/gemma2/keras/gemma2_9b_en/1/download/preprocessor.json...\n", + "Downloading from https://www.kaggle.com/api/v1/models/keras/gemma2/keras/gemma2_9b_en/1/download/tokenizer.json...\n", + "100%|██████████| 315/315 [00:00<00:00, 434kB/s]\n", + "Downloading from https://www.kaggle.com/api/v1/models/keras/gemma2/keras/gemma2_9b_en/1/download/assets/tokenizer/vocabulary.spm...\n", + "100%|██████████| 4.04M/4.04M [00:00<00:00, 14.6MB/s]\n" ] }, { @@ -300,34 +265,69 @@ } ], "source": [ - "# Connect using the default `gemma2_9b_keras` or through huggingface weights `hf://google/gemma-2-9b-keras`\n", + "import keras_nlp\n", + "import keras\n", + "\n", + "# Run at half precision.\n", + "keras.config.set_floatx(\"bfloat16\")\n", + "\n", + "# using 9B base model\n", "gemma_lm = keras_nlp.models.GemmaCausalLM.from_preset(\"gemma2_9b_en\")\n", "gemma_lm.summary()" ] }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 9, "metadata": { "id": "aae5GHrdpj2_" }, "outputs": [ { - "data": { - "application/vnd.google.colaboratory.intrinsic+json": { - "type": "string" - }, - "text/plain": [ - "'What is the meaning of life?\\n\\n[Answer 1]\\n\\nThe meaning of life is to live it.\\n\\n[Answer 2]\\n\\nThe'" - ] - }, - "execution_count": 11, - "metadata": {}, - "output_type": "execute_result" + "name": "stdout", + "output_type": "stream", + "text": [ + "It was a dark and stormy night.\n", + "\n", + "The wind was howling, the rain was pouring, and the thunder was rumbling.\n", + "\n", + "I was sitting in my living room, watching the storm rage outside.\n", + "\n", + "Suddenly, I heard a knock at the door.\n", + "\n", + "I got up and opened it, and there stood a man in a black cloak.\n", + "\n", + "He had a strange look in his eyes, and he was holding a lantern.\n", + "\n", + "\"Who are you?\" I asked.\n", + "\n", + "\"I am the storm,\" he replied.\n", + "\n", + "\"And I have come to take you away.\"\n", + "\n", + "I was terrified, but I couldn't move.\n", + "\n", + "The man in the black cloak grabbed my arm and pulled me out into the storm.\n", + "\n", + "We walked for what seemed like hours, until we came to a clearing in the woods.\n", + "\n", + "There, the man in the black cloak stopped and turned to me.\n", + "\n", + "\"You are mine now,\" he said.\n", + "\n", + "\"And I will take you to my castle.\"\n", + "\n", + "I tried to fight him off, but he was too strong.\n", + "\n", + "He dragged me into the castle, and I was never seen again.\n", + "\n", + "The end.\n" + ] } ], "source": [ - "gemma_lm.generate(\"What is the meaning of life?\", max_length=32)" + "result = gemma_lm.generate(\"It was a dark and stormy night.\", max_length=256)\n", + "print(result)" ] } ], diff --git a/Gemma/Keras_Gemma_2_Quickstart_Chat.ipynb b/Gemma/Keras_Gemma_2_Quickstart_Chat.ipynb index c02d0ec..e742b68 100644 --- a/Gemma/Keras_Gemma_2_Quickstart_Chat.ipynb +++ b/Gemma/Keras_Gemma_2_Quickstart_Chat.ipynb @@ -37,16 +37,13 @@ "id": "PXNm5_p_oxMF" }, "source": [ - "This is a quick demo of Gemma running on KerasNLP. To run this you will need:\n", - "- To be added to a private github repo for Gemma.\n", - "- To be added to a private Kaggle model for weights.\n", + "This is a quick demo of Gemma running on KerasNLP.\n", "\n", "Note that you will need a large GPU (e.g. A100) to run this as well.\n", "\n", "General Keras reading:\n", "- [Getting started with Keras](https://keras.io/getting_started/)\n", "- [Getting started with KerasNLP](https://keras.io/guides/keras_nlp/getting_started/)\n", - "- [Generation and fine-tuning guide for GPT2](https://keras.io/guides/keras_nlp/getting_started/)\n", "\n", "\n", "
\n", @@ -76,7 +73,9 @@ "from google.colab import userdata\n", "\n", "os.environ[\"KAGGLE_USERNAME\"] = userdata.get('KAGGLE_USERNAME')\n", - "os.environ[\"KAGGLE_KEY\"] = userdata.get('KAGGLE_KEY')" + "os.environ[\"KAGGLE_KEY\"] = userdata.get('KAGGLE_KEY')\n", + "\n", + "os.environ[\"KERAS_BACKEND\"] = \"jax\" # Or \"tensorflow\" or \"torch\"." ] }, { @@ -97,8 +96,8 @@ "outputs": [], "source": [ "# Install all deps\n", - "!pip install keras\n", - "!pip install keras-nlp" + "!pip install -U keras-nlp\n", + "!pip install -U keras==3.3.3" ] }, { @@ -113,40 +112,6 @@ { "cell_type": "code", "execution_count": 3, - "metadata": { - "id": "ww83zI9ToPso" - }, - "outputs": [], - "source": [ - "os.environ[\"KERAS_BACKEND\"] = \"jax\" # Or \"tensorflow\" or \"torch\".\n", - "import os\n", - "import textwrap\n", - "\n", - "import keras_nlp\n", - "import keras\n", - "\n", - "from IPython.display import Markdown" - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "metadata": { - "id": "UhbtacN1yqe4" - }, - "outputs": [], - "source": [ - "# Run at half precision.\n", - "keras.config.set_floatx(\"bfloat16\")\n", - "\n", - "def to_markdown(text):\n", - " text = text.replace('•', ' *')\n", - " return Markdown(textwrap.indent(text, '> ', predicate=lambda _: True))" - ] - }, - { - "cell_type": "code", - "execution_count": 5, "metadata": { "id": "yygIK9DEIldp" }, @@ -155,18 +120,24 @@ "name": "stderr", "output_type": "stream", "text": [ + "Downloading from https://www.kaggle.com/api/v1/models/keras/gemma2/keras/gemma2_instruct_9b_en/1/download/model.safetensors...\n", + "Downloading from https://www.kaggle.com/api/v1/models/keras/gemma2/keras/gemma2_instruct_9b_en/1/download/model.safetensors.index.json...\n", "Downloading from https://www.kaggle.com/api/v1/models/keras/gemma2/keras/gemma2_instruct_9b_en/1/download/metadata.json...\n", - "100%|██████████| 143/143 [00:00<00:00, 173kB/s]\n", + "100%|██████████| 143/143 [00:00<00:00, 209kB/s]\n", "Downloading from https://www.kaggle.com/api/v1/models/keras/gemma2/keras/gemma2_instruct_9b_en/1/download/task.json...\n", "Downloading from https://www.kaggle.com/api/v1/models/keras/gemma2/keras/gemma2_instruct_9b_en/1/download/config.json...\n", - "100%|██████████| 780/780 [00:00<00:00, 1.16MB/s]\n", + "100%|██████████| 780/780 [00:00<00:00, 1.18MB/s]\n", + "Downloading from https://www.kaggle.com/api/v1/models/keras/gemma2/keras/gemma2_instruct_9b_en/1/download/model.safetensors...\n", + "Downloading from https://www.kaggle.com/api/v1/models/keras/gemma2/keras/gemma2_instruct_9b_en/1/download/model.safetensors.index.json...\n", "Downloading from https://www.kaggle.com/api/v1/models/keras/gemma2/keras/gemma2_instruct_9b_en/1/download/model.weights.h5...\n", - "100%|██████████| 17.2G/17.2G [18:19<00:00, 16.8MB/s]\n", + "100%|██████████| 17.2G/17.2G [02:41<00:00, 114MB/s]\n", + "Downloading from https://www.kaggle.com/api/v1/models/keras/gemma2/keras/gemma2_instruct_9b_en/1/download/model.safetensors...\n", + "Downloading from https://www.kaggle.com/api/v1/models/keras/gemma2/keras/gemma2_instruct_9b_en/1/download/model.safetensors.index.json...\n", "Downloading from https://www.kaggle.com/api/v1/models/keras/gemma2/keras/gemma2_instruct_9b_en/1/download/preprocessor.json...\n", "Downloading from https://www.kaggle.com/api/v1/models/keras/gemma2/keras/gemma2_instruct_9b_en/1/download/tokenizer.json...\n", - "100%|██████████| 315/315 [00:00<00:00, 781kB/s]\n", + "100%|██████████| 315/315 [00:00<00:00, 500kB/s]\n", "Downloading from https://www.kaggle.com/api/v1/models/keras/gemma2/keras/gemma2_instruct_9b_en/1/download/assets/tokenizer/vocabulary.spm...\n", - "100%|██████████| 4.04M/4.04M [00:01<00:00, 2.40MB/s]\n" + "100%|██████████| 4.04M/4.04M [00:00<00:00, 16.9MB/s]\n" ] }, { @@ -294,551 +265,229 @@ } ], "source": [ - "# Connect using the default `gemma2_instruct_9b_keras` or through huggingface weights `hf://google/gemma-2-9b-keras`\n", + "import keras_nlp\n", + "import keras\n", + "\n", + "# Run at half precision.\n", + "keras.config.set_floatx(\"bfloat16\")\n", + "\n", + "# using 9B instruction-tuned model\n", "gemma_lm = keras_nlp.models.GemmaCausalLM.from_preset(\"gemma2_instruct_9b_en\")\n", "gemma_lm.summary()" ] }, + { + "cell_type": "markdown", + "metadata": { + "id": "CQ837Wrra_d3" + }, + "source": [ + "### Define formatting helper functions" + ] + }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 4, "metadata": { - "id": "aae5GHrdpj2_" + "id": "z6nQPPU7bFk6" + }, + "outputs": [], + "source": [ + "from IPython.display import Markdown\n", + "import textwrap\n", + "\n", + "def display_chat(prompt, text):\n", + " formatted_prompt = \"🙋‍♂️
\" + prompt + \"
\"\n", + " text = text.replace('•', ' *')\n", + " text = textwrap.indent(text, '> ', predicate=lambda _: True)\n", + " formatted_text = \"🤖\\n\\n\" + text + \"\\n\"\n", + " return Markdown(formatted_prompt+formatted_text)\n", + "\n", + "def to_markdown(text):\n", + " text = text.replace('•', ' *')\n", + " return Markdown(textwrap.indent(text, '> ', predicate=lambda _: True))" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "vro4q-yCbG-f" }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "CPU times: user 56.7 s, sys: 627 ms, total: 57.3 s\n", - "Wall time: 37.3 s\n" - ] - }, - { - "data": { - "text/markdown": [ - "> what is the meaning of life?.\n", - "> \n", - "> That's a question that has been pondered by philosophers and theologians for centuries, and there's no one answer that will satisfy everyone. \n", - "> \n", - "> Here are some perspectives to consider:\n", - "> \n", - "> * **Meaning is created, not found:** Many believe that life has no inherent meaning, and it's up to each individual to create their own purpose and find what gives their life value. This could involve pursuing passions, building relationships, contributing to society, or simply enjoying the experience of being alive.\n", - "> * **Meaning is found in connection:** Others find meaning in their connections with others, whether it's through family, friends, community, or a sense of belonging to something larger than themselves.\n", - "> \n", - "> * **Meaning is found in service:** Some find meaning in helping others and making a difference in the world. This could involve volunteering, activism, or simply being kind and compassionate to those around them.\n", - "> * **Meaning is found in the journey:** Some believe that the meaning of life is not about reaching a specific destination, but about the journey itself. This involves embracing the challenges and joys of life, learning and growing along the way, and appreciating the present moment.\n", - "> \n", - "> Ultimately, the meaning of life is a deeply personal question." - ], - "text/plain": [ - "" - ] - }, - "execution_count": 6, - "metadata": {}, - "output_type": "execute_result" - } - ], "source": [ - "%time result = gemma_lm.generate(\"what is the meaning of life?.\", max_length=256)\n", - "to_markdown(result)" + "### Create a chat helper to manage the conversation state" ] }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 5, "metadata": { "id": "O0TkvhOASI9f" }, "outputs": [], "source": [ - "class GemmaChat():\n", + "class ChatState():\n", + " \"\"\"\n", + " Manages the conversation history for a turn-based chatbot\n", + " Follows the turn-based conversation guidelines for the Gemma family of models\n", + " documented at https://ai.google.dev/gemma/docs/formatting\n", + " \"\"\"\n", + "\n", + " __START_TURN_USER__ = \"user\\n\"\n", + " __START_TURN_MODEL__ = \"model\\n\"\n", + " __END_TURN__ = \"\\n\"\n", "\n", - " __START_TURN__ = \"\"\n", - " __END_TURN__ = \"\"\n", - " __SYSTEM_STOP__ = \"\"\n", + " def __init__(self, model, system=\"\"):\n", + " \"\"\"\n", + " Initializes the chat state.\n", "\n", - " def __init__(self, model, system=\"\", history=None):\n", + " Args:\n", + " model: The language model to use for generating responses.\n", + " system: (Optional) System instructions or bot description.\n", + " \"\"\"\n", " self.model = model\n", " self.system = system\n", - " if not history:\n", - " self.history = []\n", - " else:\n", - " self.history = history\n", + " self.history = []\n", "\n", - " def format_message(self, message, prefix=\"\"):\n", - " return f\"{self.__START_TURN__}{prefix}\\n{message}{self.__END_TURN__}\\n\"\n", + " def add_to_history_as_user(self, message):\n", + " \"\"\"\n", + " Adds a user message to the history with start/end turn markers.\n", + " \"\"\"\n", + " self.history.append(self.__START_TURN_USER__ + message + self.__END_TURN__)\n", "\n", - " def add_to_history(self, message, prefix=\"\"):\n", - " formated_message = self.format_message(message, prefix)\n", - " self.history.append(formated_message)\n", + " def add_to_history_as_model(self, message):\n", + " \"\"\"\n", + " Adds a model response to the history with the start turn marker.\n", + " Model will generate end turn marker.\n", + " \"\"\"\n", + " self.history.append(self.__START_TURN_MODEL__ + message)\n", + "\n", + " def get_history(self):\n", + " \"\"\"\n", + " Returns the entire chat history as a single string.\n", + " \"\"\"\n", + " return \"\".join([*self.history])\n", "\n", " def get_full_prompt(self):\n", - " prompt = \"\\n\".join([self.system + \"\\n\", *self.history])\n", + " \"\"\"\n", + " Builds the prompt for the language model, including history and system description.\n", + " \"\"\"\n", + " prompt = self.get_history() + self.__START_TURN_MODEL__\n", + " if len(self.system)>0:\n", + " prompt = self.system + \"\\n\" + prompt\n", " return prompt\n", "\n", " def send_message(self, message):\n", - " self.add_to_history(message, \"user\")\n", - " prompt = self.get_full_prompt()\n", - " response = self.model.generate(prompt, max_length=2048)\n", - " # print('--------------------response---------------------------')\n", - " # print(response)\n", - " # print('--------------------response---------------------------')\n", - " result = response.replace(prompt, \"\")\n", - " result = response.replace(self.__SYSTEM_STOP__, \"\")\n", - " self.add_to_history(result, \"model\")\n", - " return result\n", + " \"\"\"\n", + " Handles sending a user message and getting a model response.\n", "\n", - " def show_history(self):\n", - " for h in self.history:\n", - " print(h)\n" + " Args:\n", + " message: The user's message.\n", + "\n", + " Returns:\n", + " The model's response.\n", + " \"\"\"\n", + " self.add_to_history_as_user(message)\n", + " prompt = self.get_full_prompt()\n", + " response = self.model.generate(prompt, max_length=4096)\n", + " result = response.replace(prompt, \"\") # Extract only the new response\n", + " self.add_to_history_as_model(result)\n", + " return result\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "52Ell80sbRmy" + }, + "source": [ + "### Chat with the model" ] }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 6, "metadata": { "id": "shfCZDFPKghT" }, "outputs": [ { "data": { - "text/markdown": [ - "> \n", - "> \n", - "> user\n", - "> help me understand how to make coffee\n", - "> \n", - "> \n", - "> ## Let's Brew Some Coffee! ☕️\n", - "> \n", - "> Making coffee is a simple process, but there are many ways to do it. Here's a breakdown of some popular methods:\n", - "> \n", - "> **1. Drip Coffee Maker:**\n", - "> \n", - "> * **What you need:** Drip coffee maker, coffee filter, ground coffee, water.\n", - "> * **How to do it:**\n", - "> 1. Fill the water reservoir with fresh, cold water.\n", - "> 2. Place a filter in the filter basket.\n", - "> 3. Add ground coffee to the filter (follow the coffee maker's instructions for the right amount).\n", - "> 4. Turn on the coffee maker and let it brew.\n", - "> 5. Enjoy your freshly brewed coffee!\n", - "> \n", - "> **2. French Press:**\n", - "> \n", - "> * **What you need:** French press, coarse ground coffee, hot water.\n", - "> * **How to do it:**\n", - "> 1. Heat water to just off the boil (around 200°F).\n", - "> 2. Add coarse ground coffee to the French press.\n", - "> 3. Pour hot water over the coffee grounds, making sure all grounds are saturated.\n", - "> 4. Stir gently and place the lid on the press, but don't plunge yet.\n", - "> 5. Let the coffee steep for 4 minutes.\n", - "> 6. Slowly press the plunger down to separate the grounds from the brewed coffee.\n", - "> 7. Pour and enjoy!\n", - "> \n", - "> **3. Pour Over:**\n", - "> \n", - "> * **What you need:** Pour over cone, filter, medium-fine ground coffee, hot water.\n", - "> * **How to do it:**\n", - "> 1. Place a filter in the cone and rinse it with hot water to remove any paper taste.\n", - "> 2. Add medium-fine ground coffee to the filter.\n", - "> 3. Slowly pour hot water over the coffee grounds in a circular motion, making sure all grounds are saturated.\n", - "> 4. Let the coffee drip through into your cup.\n", - "> 5. Enjoy!\n", - "> \n", - "> **4. Cold Brew:**\n", - "> \n", - "> * **What you need:** Coarse ground coffee, cold water, container.\n", - "> * **How to do it:**\n", - "> 1. Combine coarse ground coffee and cold water in a container (ratio of 1:8 coffee to water).\n", - "> 2. Stir well and cover the container.\n", - "> 3. Let the coffee steep in the refrigerator for 12-24 hours.\n", - "> 4. Strain the coffee through a fine-mesh sieve or cheesecloth.\n", - "> 5. Serve over ice and enjoy!\n", - "> \n", - "> **Tips for Better Coffee:**\n", - "> \n", - "> * **Use fresh, high-quality beans:** The better the beans, the better the coffee.\n", - "> * **Grind your beans right before brewing:** This preserves the flavor and aroma.\n", - "> * **Use filtered water:** Impurities in water can affect the taste of your coffee.\n", - "> * **Experiment with different brewing methods:** Find the method that you enjoy the most.\n", - "> * **Clean your coffee maker regularly:** This will help to prevent buildup and ensure that your coffee tastes its best.\n", - "> \n", - "> \n", - "> \n", - "> Let me know if you have any other questions or want to explore a specific brewing method in more detail!\n" - ], + "text/markdown": "🙋‍♂️
help me understand how to make coffee
🤖\n\n> ## Let's Brew Some Coffee! ☕️\n> \n> Making coffee can be as simple or complex as you like. Here's a breakdown of some popular methods, from beginner-friendly to more advanced:\n> \n> **1. The Quick & Easy: Instant Coffee**\n> \n> * **What you need:** Instant coffee granules, hot water\n> * **How to:** Simply add a spoonful of instant coffee to a mug, pour hot water over it, stir, and enjoy!\n> \n> **2. The Classic: Drip Coffee Maker**\n> \n> * **What you need:** Drip coffee maker, ground coffee, filter\n> * **How to:**\n> * Fill the water reservoir with fresh, cold water.\n> * Place a filter in the filter basket.\n> * Add the desired amount of ground coffee to the filter.\n> * Turn on the coffee maker and let it do its thing!\n> \n> **3. The French Press:**\n> \n> * **What you need:** French press, coarse ground coffee, hot water\n> * **How to:**\n> * Add coarse ground coffee to the French press.\n> * Pour hot water (just off the boil) over the coffee grounds.\n> * Stir gently and let it steep for 4 minutes.\n> * Slowly press the plunger down to separate the grounds from the coffee.\n> * Pour and enjoy!\n> \n> **4. The Pour Over:**\n> \n> * **What you need:** Pour over cone, filter, medium-fine ground coffee, hot water\n> * **How to:**\n> * Place a filter in the cone and rinse it with hot water to remove any paper taste.\n> * Add medium-fine ground coffee to the filter.\n> * Slowly pour hot water over the grounds in a circular motion, ensuring all grounds are saturated.\n> * Let the coffee drip through into your cup.\n> \n> **5. The Espresso Machine:**\n> \n> * **What you need:** Espresso machine, finely ground coffee, tamper\n> * **How to:**\n> * Grind your coffee beans finely.\n> * Tamp the coffee grounds firmly into the portafilter.\n> * Lock the portafilter into the espresso machine.\n> * Brew your espresso shot!\n> \n> **Tips for Delicious Coffee:**\n> \n> * **Use fresh, quality beans:** The better the beans, the better the coffee.\n> * **Grind your beans right before brewing:** This preserves freshness and flavor.\n> * **Use filtered water:** Impurities in water can affect the taste of your coffee.\n> * **Experiment with different brewing methods:** Find what you like best!\n> * **Don't be afraid to adjust:** Play with the amount of coffee, water, and brewing time to find your perfect cup.\n> \n> \n> Let me know if you have any other questions or want to explore a specific brewing method in more detail!\n\n", "text/plain": [ "" ] }, - "execution_count": 8, + "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "chat = GemmaChat(gemma_lm)\n", - "result = chat.send_message(\"help me understand how to make coffee\")\n", - "to_markdown(result)" + "chat = ChatState(gemma_lm)\n", + "message = \"help me understand how to make coffee\"\n", + "display_chat(message, chat.send_message(message))" ] }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 7, "metadata": { "id": "bLxtlhjtLkWQ" }, "outputs": [ { "data": { - "text/markdown": [ - "> \n", - "> \n", - "> user\n", - "> help me understand how to make coffee\n", - "> \n", - "> model\n", - "> \n", - "> \n", - "> user\n", - "> help me understand how to make coffee\n", - "> \n", - "> \n", - "> ## Let's Brew Some Coffee! ☕️\n", - "> \n", - "> Making coffee is a simple process, but there are many ways to do it. Here's a breakdown of some popular methods:\n", - "> \n", - "> **1. Drip Coffee Maker:**\n", - "> \n", - "> * **What you need:** Drip coffee maker, coffee filter, ground coffee, water.\n", - "> * **How to do it:**\n", - "> 1. Fill the water reservoir with fresh, cold water.\n", - "> 2. Place a filter in the filter basket.\n", - "> 3. Add ground coffee to the filter (follow the coffee maker's instructions for the right amount).\n", - "> 4. Turn on the coffee maker and let it brew.\n", - "> 5. Enjoy your freshly brewed coffee!\n", - "> \n", - "> **2. French Press:**\n", - "> \n", - "> * **What you need:** French press, coarse ground coffee, hot water.\n", - "> * **How to do it:**\n", - "> 1. Heat water to just off the boil (around 200°F).\n", - "> 2. Add coarse ground coffee to the French press.\n", - "> 3. Pour hot water over the coffee grounds, making sure all grounds are saturated.\n", - "> 4. Stir gently and place the lid on the press, but don't plunge yet.\n", - "> 5. Let the coffee steep for 4 minutes.\n", - "> 6. Slowly press the plunger down to separate the grounds from the brewed coffee.\n", - "> 7. Pour and enjoy!\n", - "> \n", - "> **3. Pour Over:**\n", - "> \n", - "> * **What you need:** Pour over cone, filter, medium-fine ground coffee, hot water.\n", - "> * **How to do it:**\n", - "> 1. Place a filter in the cone and rinse it with hot water to remove any paper taste.\n", - "> 2. Add medium-fine ground coffee to the filter.\n", - "> 3. Slowly pour hot water over the coffee grounds in a circular motion, making sure all grounds are saturated.\n", - "> 4. Let the coffee drip through into your cup.\n", - "> 5. Enjoy!\n", - "> \n", - "> **4. Cold Brew:**\n", - "> \n", - "> * **What you need:** Coarse ground coffee, cold water, container.\n", - "> * **How to do it:**\n", - "> 1. Combine coarse ground coffee and cold water in a container (ratio of 1:8 coffee to water).\n", - "> 2. Stir well and cover the container.\n", - "> 3. Let the coffee steep in the refrigerator for 12-24 hours.\n", - "> 4. Strain the coffee through a fine-mesh sieve or cheesecloth.\n", - "> 5. Serve over ice and enjoy!\n", - "> \n", - "> **Tips for Better Coffee:**\n", - "> \n", - "> * **Use fresh, high-quality beans:** The better the beans, the better the coffee.\n", - "> * **Grind your beans right before brewing:** This preserves the flavor and aroma.\n", - "> * **Use filtered water:** Impurities in water can affect the taste of your coffee.\n", - "> * **Experiment with different brewing methods:** Find the method that you enjoy the most.\n", - "> * **Clean your coffee maker regularly:** This will help to prevent buildup and ensure that your coffee tastes its best.\n", - "> \n", - "> \n", - "> \n", - "> Let me know if you have any other questions or want to explore a specific brewing method in more detail!\n", - "> \n", - "> \n", - "> user\n", - "> what is the best coffee?\n", - "> \n", - "> \n", - "> Ah, the eternal question! There's no single \"best\" coffee because taste is subjective. What one person finds delicious, another might find bitter or bland. \n", - "> \n", - "> However, I can give you some pointers to help you find YOUR best coffee:\n", - "> \n", - "> **Factors that influence coffee taste:**\n", - "> \n", - "> * **Bean Origin:** Different regions produce beans with unique flavor profiles. \n", - "> * **Latin America:** Often known for chocolatey, nutty, and smooth flavors. (Colombia, Brazil, Guatemala)\n", - "> * **Africa:** Can have bright acidity, fruity notes, and floral aromas. (Ethiopia, Kenya, Tanzania)\n", - "> * **Asia/Pacific:** Often earthy, spicy, and full-bodied. (Indonesia, Vietnam)\n", - "> * **Roast Level:**\n", - "> * **Light:** More acidic, delicate flavors, higher caffeine.\n", - "> * **Medium:** Balanced acidity and body, versatile.\n", - "> * **Dark:** Bold, smoky, bittersweet flavors, lower caffeine.\n", - "> * **Brewing Method:** Each method extracts flavors differently, impacting the final taste.\n", - "> \n", - "> **Finding YOUR Best:**\n", - "> \n", - "> 1. **Explore Different Origins:** Try coffees from various regions to discover what flavor profiles you enjoy.\n", - "> 2. **Experiment with Roast Levels:** Sample light, medium, and dark roasts to see your preference.\n", - "> 3. **Consider Your Brewing Method:** Different beans work better with certain brewing methods. Ask your local coffee shop for recommendations.\n", - "> 4. **Read Reviews:** Online reviews and coffee blogs can offer insights into specific beans and roasters.\n", - "> 5. **Visit a Local Coffee Shop:** Talk to baristas, ask for recommendations, and try different coffees.\n", - "> \n", - "> **Remember:** Coffee is a journey of discovery! Enjoy the process of exploring and finding your perfect cup.\n" - ], + "text/markdown": "🙋‍♂️
what is the best coffee?
🤖\n\n> Ah, the eternal question! There's no single \"best\" coffee because taste is subjective. What one person finds delicious, another might find bitter or bland. \n> \n> It all depends on your personal preferences:\n> \n> **Consider these factors:**\n> \n> * **Roast Level:**\n> * **Light:** Bright acidity, delicate flavors, often fruity or floral.\n> * **Medium:** Balanced acidity and body, with more pronounced flavors.\n> * **Dark:** Bold, smoky, sometimes bittersweet, with less acidity.\n> * **Origin:** Different regions produce beans with unique flavor profiles:\n> * **Latin America:** Often chocolatey, nutty, with medium acidity.\n> * **Africa:** Known for bright acidity, fruity notes, and floral aromas.\n> * **Asia/Pacific:** Earthy, spicy, sometimes with chocolate or caramel notes.\n> * **Brewing Method:** The method you use can significantly impact the flavor.\n> \n> **Some Popular and Highly-Regarded Coffees:**\n> \n> * **Ethiopian Yirgacheffe:** Known for its floral, citrusy, and tea-like qualities.\n> * **Kenyan AA:** Bright acidity, black currant, and berry flavors.\n> * **Sumatran Mandheling:** Earthy, spicy, with low acidity.\n> * **Colombian Supremo:** Balanced, with chocolate and caramel notes.\n> \n> **My Recommendation:**\n> \n> * **Start exploring!** Try different roasts, origins, and brewing methods to discover what you enjoy most.\n> * **Talk to your local coffee shop:** Baristas are passionate about coffee and can offer great recommendations based on your preferences.\n> * **Don't be afraid to experiment:** The world of coffee is vast and exciting!\n> \n> \n> Happy brewing!\n\n", "text/plain": [ "" ] }, - "execution_count": 9, + "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "result = chat.send_message(\"what is the best coffee?\")\n", - "to_markdown(result)" + "message = \"what is the best coffee?\"\n", + "display_chat(message, chat.send_message(message))" ] }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 8, "metadata": { "id": "tfvgl4sC9g2p" }, "outputs": [ { "data": { - "text/markdown": [ - "> \n", - "> \n", - "> user\n", - "> help me understand how to make coffee\n", - "> \n", - "> model\n", - "> \n", - "> \n", - "> user\n", - "> help me understand how to make coffee\n", - "> \n", - "> \n", - "> ## Let's Brew Some Coffee! ☕️\n", - "> \n", - "> Making coffee is a simple process, but there are many ways to do it. Here's a breakdown of some popular methods:\n", - "> \n", - "> **1. Drip Coffee Maker:**\n", - "> \n", - "> * **What you need:** Drip coffee maker, coffee filter, ground coffee, water.\n", - "> * **How to do it:**\n", - "> 1. Fill the water reservoir with fresh, cold water.\n", - "> 2. Place a filter in the filter basket.\n", - "> 3. Add ground coffee to the filter (follow the coffee maker's instructions for the right amount).\n", - "> 4. Turn on the coffee maker and let it brew.\n", - "> 5. Enjoy your freshly brewed coffee!\n", - "> \n", - "> **2. French Press:**\n", - "> \n", - "> * **What you need:** French press, coarse ground coffee, hot water.\n", - "> * **How to do it:**\n", - "> 1. Heat water to just off the boil (around 200°F).\n", - "> 2. Add coarse ground coffee to the French press.\n", - "> 3. Pour hot water over the coffee grounds, making sure all grounds are saturated.\n", - "> 4. Stir gently and place the lid on the press, but don't plunge yet.\n", - "> 5. Let the coffee steep for 4 minutes.\n", - "> 6. Slowly press the plunger down to separate the grounds from the brewed coffee.\n", - "> 7. Pour and enjoy!\n", - "> \n", - "> **3. Pour Over:**\n", - "> \n", - "> * **What you need:** Pour over cone, filter, medium-fine ground coffee, hot water.\n", - "> * **How to do it:**\n", - "> 1. Place a filter in the cone and rinse it with hot water to remove any paper taste.\n", - "> 2. Add medium-fine ground coffee to the filter.\n", - "> 3. Slowly pour hot water over the coffee grounds in a circular motion, making sure all grounds are saturated.\n", - "> 4. Let the coffee drip through into your cup.\n", - "> 5. Enjoy!\n", - "> \n", - "> **4. Cold Brew:**\n", - "> \n", - "> * **What you need:** Coarse ground coffee, cold water, container.\n", - "> * **How to do it:**\n", - "> 1. Combine coarse ground coffee and cold water in a container (ratio of 1:8 coffee to water).\n", - "> 2. Stir well and cover the container.\n", - "> 3. Let the coffee steep in the refrigerator for 12-24 hours.\n", - "> 4. Strain the coffee through a fine-mesh sieve or cheesecloth.\n", - "> 5. Serve over ice and enjoy!\n", - "> \n", - "> **Tips for Better Coffee:**\n", - "> \n", - "> * **Use fresh, high-quality beans:** The better the beans, the better the coffee.\n", - "> * **Grind your beans right before brewing:** This preserves the flavor and aroma.\n", - "> * **Use filtered water:** Impurities in water can affect the taste of your coffee.\n", - "> * **Experiment with different brewing methods:** Find the method that you enjoy the most.\n", - "> * **Clean your coffee maker regularly:** This will help to prevent buildup and ensure that your coffee tastes its best.\n", - "> \n", - "> \n", - "> \n", - "> Let me know if you have any other questions or want to explore a specific brewing method in more detail!\n", - "> \n", - "> \n", - "> user\n", - "> what is the best coffee?\n", - "> \n", - "> model\n", - "> \n", - "> \n", - "> user\n", - "> help me understand how to make coffee\n", - "> \n", - "> model\n", - "> \n", - "> \n", - "> user\n", - "> help me understand how to make coffee\n", - "> \n", - "> \n", - "> ## Let's Brew Some Coffee! ☕️\n", - "> \n", - "> Making coffee is a simple process, but there are many ways to do it. Here's a breakdown of some popular methods:\n", - "> \n", - "> **1. Drip Coffee Maker:**\n", - "> \n", - "> * **What you need:** Drip coffee maker, coffee filter, ground coffee, water.\n", - "> * **How to do it:**\n", - "> 1. Fill the water reservoir with fresh, cold water.\n", - "> 2. Place a filter in the filter basket.\n", - "> 3. Add ground coffee to the filter (follow the coffee maker's instructions for the right amount).\n", - "> 4. Turn on the coffee maker and let it brew.\n", - "> 5. Enjoy your freshly brewed coffee!\n", - "> \n", - "> **2. French Press:**\n", - "> \n", - "> * **What you need:** French press, coarse ground coffee, hot water.\n", - "> * **How to do it:**\n", - "> 1. Heat water to just off the boil (around 200°F).\n", - "> 2. Add coarse ground coffee to the French press.\n", - "> 3. Pour hot water over the coffee grounds, making sure all grounds are saturated.\n", - "> 4. Stir gently and place the lid on the press, but don't plunge yet.\n", - "> 5. Let the coffee steep for 4 minutes.\n", - "> 6. Slowly press the plunger down to separate the grounds from the brewed coffee.\n", - "> 7. Pour and enjoy!\n", - "> \n", - "> **3. Pour Over:**\n", - "> \n", - "> * **What you need:** Pour over cone, filter, medium-fine ground coffee, hot water.\n", - "> * **How to do it:**\n", - "> 1. Place a filter in the cone and rinse it with hot water to remove any paper taste.\n", - "> 2. Add medium-fine ground coffee to the filter.\n", - "> 3. Slowly pour hot water over the coffee grounds in a circular motion, making sure all grounds are saturated.\n", - "> 4. Let the coffee drip through into your cup.\n", - "> 5. Enjoy!\n", - "> \n", - "> **4. Cold Brew:**\n", - "> \n", - "> * **What you need:** Coarse ground coffee, cold water, container.\n", - "> * **How to do it:**\n", - "> 1. Combine coarse ground coffee and cold water in a container (ratio of 1:8 coffee to water).\n", - "> 2. Stir well and cover the container.\n", - "> 3. Let the coffee steep in the refrigerator for 12-24 hours.\n", - "> 4. Strain the coffee through a fine-mesh sieve or cheesecloth.\n", - "> 5. Serve over ice and enjoy!\n", - "> \n", - "> **Tips for Better Coffee:**\n", - "> \n", - "> * **Use fresh, high-quality beans:** The better the beans, the better the coffee.\n", - "> * **Grind your beans right before brewing:** This preserves the flavor and aroma.\n", - "> * **Use filtered water:** Impurities in water can affect the taste of your coffee.\n", - "> * **Experiment with different brewing methods:** Find the method that you enjoy the most.\n", - "> * **Clean your coffee maker regularly:** This will help to prevent buildup and ensure that your coffee tastes its best.\n", - "> \n", - "> \n", - "> \n", - "> Let me know if you have any other questions or want to explore a specific brewing method in more detail!\n", - "> \n", - "> \n", - "> user\n", - "> what is the best coffee?\n", - "> \n", - "> \n", - "> Ah, the eternal question! There's no single \"best\" coffee because taste is subjective. What one person finds delicious, another might find bitter or bland. \n", - "> \n", - "> However, I can give you some pointers to help you find YOUR best coffee:\n", - "> \n", - "> **Factors that influence coffee taste:**\n", - "> \n", - "> * **Bean Origin:** Different regions produce beans with unique flavor profiles. \n", - "> * **Latin America:** Often known for chocolatey, nutty, and smooth flavors. (Colombia, Brazil, Guatemala)\n", - "> * **Africa:** Can have bright acidity, fruity notes, and floral aromas. (Ethiopia, Kenya, Tanzania)\n", - "> * **Asia/Pacific:** Often earthy, spicy, and full-bodied. (Indonesia, Vietnam)\n", - "> * **Roast Level:**\n", - "> * **Light:** More acidic, delicate flavors, higher caffeine.\n", - "> * **Medium:** Balanced acidity and body, versatile.\n", - "> * **Dark:** Bold, smoky, bittersweet flavors, lower caffeine.\n", - "> * **Brewing Method:** Each method extracts flavors differently, impacting the final taste.\n", - "> \n", - "> **Finding YOUR Best:**\n", - "> \n", - "> 1. **Explore Different Origins:** Try coffees from various regions to discover what flavor profiles you enjoy.\n", - "> 2. **Experiment with Roast Levels:** Sample light, medium, and dark roasts to see your preference.\n", - "> 3. **Consider Your Brewing Method:** Different beans work better with certain brewing methods. Ask your local coffee shop for recommendations.\n", - "> 4. **Read Reviews:** Online reviews and coffee blogs can offer insights into specific beans and roasters.\n", - "> 5. **Visit a Local Coffee Shop:** Talk to baristas, ask for recommendations, and try different coffees.\n", - "> \n", - "> **Remember:** Coffee is a journey of discovery! Enjoy the process of exploring and finding your perfect cup.\n", - "> \n", - "> \n", - "> user\n", - "> what are similar drinks?\n", - "> \n", - "> \n", - "> Here are some drinks similar to coffee, categorized by what aspect of coffee they resemble:\n", - "> \n", - "> **Similar Caffeine Kick:**\n", - "> \n", - "> * **Tea:** Wide variety of flavors and caffeine levels, from delicate green tea to robust black tea.\n", - "> * **Matcha:** Powdered green tea with a unique earthy flavor and higher caffeine content than regular green tea.\n", - "> * **Yerba Mate:** South American herbal tea with a slightly bitter, grassy flavor and moderate caffeine.\n", - "> * **Energy Drinks:** High caffeine content, often with added sugar and other stimulants.\n", - "> \n", - "> **Similar Flavor Profiles:**\n", - "> \n", - "> * **Chocolate:** Rich, bittersweet flavors can complement coffee's roasted notes.\n", - "> * **Caramel:** Sweet and buttery, caramel adds a creamy dimension similar to coffee's body.\n", - "> * **Vanilla:** A classic pairing with coffee, vanilla adds a warm, comforting sweetness.\n", - "> * **Espresso-Based Drinks:** Lattes, cappuccinos, macchiatos, and mochas all feature espresso as a base, offering variations in milk and flavorings.\n", - "> \n", - "> **Similar Ritual and Experience:**\n", - "> \n", - "> * **Hot Chocolate:** A comforting and warming drink often enjoyed in the morning or evening.\n", - "> * **Herbal Teas:** A relaxing and flavorful alternative to coffee, enjoyed for their health benefits and calming effects.\n", - "> * **Golden Milk:** A turmeric-based drink with" - ], + "text/markdown": "🙋‍♂️
what are similar drinks?
🤖\n\n> You're looking for drinks that share similarities with coffee! Here are some options, categorized by what aspect of coffee they resemble:\n> \n> **Similar Caffeine Kick:**\n> \n> * **Tea:** Comes in endless varieties, with varying caffeine levels. Black tea has the most caffeine, followed by green, white, and herbal teas.\n> * **Matcha:** A powdered green tea with a unique earthy flavor and a good amount of caffeine.\n> * **Yerba Mate:** A South American beverage with a slightly bitter, grassy flavor and a caffeine boost comparable to coffee.\n> \n> **Similar Rich, Roasted Flavor:**\n> \n> * **Chicory Coffee:** Made from roasted chicory root, it has a coffee-like flavor but is caffeine-free.\n> * **Roasted Barley Tea:** A caffeine-free option with a nutty, roasted flavor.\n> \n> **Similar Creamy, Indulgent Experience:**\n> \n> * **Hot Chocolate:** A classic comfort drink with a rich, chocolatey flavor.\n> * **Golden Milk:** A warming drink made with turmeric, ginger, cinnamon, and milk.\n> \n> **Similar Ritual and Experience:**\n> \n> * **Chai Tea Latte:** A spiced black tea latte with a creamy, comforting flavor.\n> * **London Fog:** A blend of Earl Grey tea, steamed milk, and vanilla syrup.\n> \n> **Beyond the Usual:**\n> \n> * **Kava:** A Polynesian drink made from the kava root, known for its relaxing and social effects.\n> * **Guayusa:** A South American tea with a smooth, slightly sweet flavor and a moderate caffeine boost.\n> \n> \n> Remember, taste is subjective! Explore these options and see what you enjoy most.\n\n", "text/plain": [ "" ] }, - "execution_count": 10, + "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "result = chat.send_message(\"what are similar drinks?\")\n", - "to_markdown(result)" + "message = \"what are similar drinks?\"\n", + "display_chat(message, chat.send_message(message))" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "Y85tod32c7lA" + }, + "source": [ + "Use the `get_history` method to see how all the context was retained by the Chat class." ] }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 9, "metadata": { "id": "P2GjAVybBez3" }, @@ -849,391 +498,136 @@ "text": [ "user\n", "help me understand how to make coffee\n", - "\n", "model\n", - "\n", - "\n", - "user\n", - "help me understand how to make coffee\n", - "\n", - "\n", "## Let's Brew Some Coffee! ☕️\n", "\n", - "Making coffee is a simple process, but there are many ways to do it. Here's a breakdown of some popular methods:\n", - "\n", - "**1. Drip Coffee Maker:**\n", - "\n", - "* **What you need:** Drip coffee maker, coffee filter, ground coffee, water.\n", - "* **How to do it:**\n", - " 1. Fill the water reservoir with fresh, cold water.\n", - " 2. Place a filter in the filter basket.\n", - " 3. Add ground coffee to the filter (follow the coffee maker's instructions for the right amount).\n", - " 4. Turn on the coffee maker and let it brew.\n", - " 5. Enjoy your freshly brewed coffee!\n", - "\n", - "**2. French Press:**\n", - "\n", - "* **What you need:** French press, coarse ground coffee, hot water.\n", - "* **How to do it:**\n", - " 1. Heat water to just off the boil (around 200°F).\n", - " 2. Add coarse ground coffee to the French press.\n", - " 3. Pour hot water over the coffee grounds, making sure all grounds are saturated.\n", - " 4. Stir gently and place the lid on the press, but don't plunge yet.\n", - " 5. Let the coffee steep for 4 minutes.\n", - " 6. Slowly press the plunger down to separate the grounds from the brewed coffee.\n", - " 7. Pour and enjoy!\n", - "\n", - "**3. Pour Over:**\n", - "\n", - "* **What you need:** Pour over cone, filter, medium-fine ground coffee, hot water.\n", - "* **How to do it:**\n", - " 1. Place a filter in the cone and rinse it with hot water to remove any paper taste.\n", - " 2. Add medium-fine ground coffee to the filter.\n", - " 3. Slowly pour hot water over the coffee grounds in a circular motion, making sure all grounds are saturated.\n", - " 4. Let the coffee drip through into your cup.\n", - " 5. Enjoy!\n", - "\n", - "**4. Cold Brew:**\n", - "\n", - "* **What you need:** Coarse ground coffee, cold water, container.\n", - "* **How to do it:**\n", - " 1. Combine coarse ground coffee and cold water in a container (ratio of 1:8 coffee to water).\n", - " 2. Stir well and cover the container.\n", - " 3. Let the coffee steep in the refrigerator for 12-24 hours.\n", - " 4. Strain the coffee through a fine-mesh sieve or cheesecloth.\n", - " 5. Serve over ice and enjoy!\n", - "\n", - "**Tips for Better Coffee:**\n", - "\n", - "* **Use fresh, high-quality beans:** The better the beans, the better the coffee.\n", - "* **Grind your beans right before brewing:** This preserves the flavor and aroma.\n", - "* **Use filtered water:** Impurities in water can affect the taste of your coffee.\n", - "* **Experiment with different brewing methods:** Find the method that you enjoy the most.\n", - "* **Clean your coffee maker regularly:** This will help to prevent buildup and ensure that your coffee tastes its best.\n", - "\n", - "\n", - "\n", - "Let me know if you have any other questions or want to explore a specific brewing method in more detail!\n", - "\n", - "\n", - "user\n", - "what is the best coffee?\n", + "Making coffee can be as simple or complex as you like. Here's a breakdown of some popular methods, from beginner-friendly to more advanced:\n", "\n", - "model\n", + "**1. The Quick & Easy: Instant Coffee**\n", "\n", + "* **What you need:** Instant coffee granules, hot water\n", + "* **How to:** Simply add a spoonful of instant coffee to a mug, pour hot water over it, stir, and enjoy!\n", "\n", - "user\n", - "help me understand how to make coffee\n", + "**2. The Classic: Drip Coffee Maker**\n", "\n", - "model\n", - "\n", - "\n", - "user\n", - "help me understand how to make coffee\n", - "\n", - "\n", - "## Let's Brew Some Coffee! ☕️\n", + "* **What you need:** Drip coffee maker, ground coffee, filter\n", + "* **How to:**\n", + " * Fill the water reservoir with fresh, cold water.\n", + " * Place a filter in the filter basket.\n", + " * Add the desired amount of ground coffee to the filter.\n", + " * Turn on the coffee maker and let it do its thing!\n", "\n", - "Making coffee is a simple process, but there are many ways to do it. Here's a breakdown of some popular methods:\n", + "**3. The French Press:**\n", "\n", - "**1. Drip Coffee Maker:**\n", + "* **What you need:** French press, coarse ground coffee, hot water\n", + "* **How to:**\n", + " * Add coarse ground coffee to the French press.\n", + " * Pour hot water (just off the boil) over the coffee grounds.\n", + " * Stir gently and let it steep for 4 minutes.\n", + " * Slowly press the plunger down to separate the grounds from the coffee.\n", + " * Pour and enjoy!\n", "\n", - "* **What you need:** Drip coffee maker, coffee filter, ground coffee, water.\n", - "* **How to do it:**\n", - " 1. Fill the water reservoir with fresh, cold water.\n", - " 2. Place a filter in the filter basket.\n", - " 3. Add ground coffee to the filter (follow the coffee maker's instructions for the right amount).\n", - " 4. Turn on the coffee maker and let it brew.\n", - " 5. Enjoy your freshly brewed coffee!\n", + "**4. The Pour Over:**\n", "\n", - "**2. French Press:**\n", + "* **What you need:** Pour over cone, filter, medium-fine ground coffee, hot water\n", + "* **How to:**\n", + " * Place a filter in the cone and rinse it with hot water to remove any paper taste.\n", + " * Add medium-fine ground coffee to the filter.\n", + " * Slowly pour hot water over the grounds in a circular motion, ensuring all grounds are saturated.\n", + " * Let the coffee drip through into your cup.\n", "\n", - "* **What you need:** French press, coarse ground coffee, hot water.\n", - "* **How to do it:**\n", - " 1. Heat water to just off the boil (around 200°F).\n", - " 2. Add coarse ground coffee to the French press.\n", - " 3. Pour hot water over the coffee grounds, making sure all grounds are saturated.\n", - " 4. Stir gently and place the lid on the press, but don't plunge yet.\n", - " 5. Let the coffee steep for 4 minutes.\n", - " 6. Slowly press the plunger down to separate the grounds from the brewed coffee.\n", - " 7. Pour and enjoy!\n", + "**5. The Espresso Machine:**\n", "\n", - "**3. Pour Over:**\n", + "* **What you need:** Espresso machine, finely ground coffee, tamper\n", + "* **How to:**\n", + " * Grind your coffee beans finely.\n", + " * Tamp the coffee grounds firmly into the portafilter.\n", + " * Lock the portafilter into the espresso machine.\n", + " * Brew your espresso shot!\n", "\n", - "* **What you need:** Pour over cone, filter, medium-fine ground coffee, hot water.\n", - "* **How to do it:**\n", - " 1. Place a filter in the cone and rinse it with hot water to remove any paper taste.\n", - " 2. Add medium-fine ground coffee to the filter.\n", - " 3. Slowly pour hot water over the coffee grounds in a circular motion, making sure all grounds are saturated.\n", - " 4. Let the coffee drip through into your cup.\n", - " 5. Enjoy!\n", + "**Tips for Delicious Coffee:**\n", "\n", - "**4. Cold Brew:**\n", - "\n", - "* **What you need:** Coarse ground coffee, cold water, container.\n", - "* **How to do it:**\n", - " 1. Combine coarse ground coffee and cold water in a container (ratio of 1:8 coffee to water).\n", - " 2. Stir well and cover the container.\n", - " 3. Let the coffee steep in the refrigerator for 12-24 hours.\n", - " 4. Strain the coffee through a fine-mesh sieve or cheesecloth.\n", - " 5. Serve over ice and enjoy!\n", - "\n", - "**Tips for Better Coffee:**\n", - "\n", - "* **Use fresh, high-quality beans:** The better the beans, the better the coffee.\n", - "* **Grind your beans right before brewing:** This preserves the flavor and aroma.\n", + "* **Use fresh, quality beans:** The better the beans, the better the coffee.\n", + "* **Grind your beans right before brewing:** This preserves freshness and flavor.\n", "* **Use filtered water:** Impurities in water can affect the taste of your coffee.\n", - "* **Experiment with different brewing methods:** Find the method that you enjoy the most.\n", - "* **Clean your coffee maker regularly:** This will help to prevent buildup and ensure that your coffee tastes its best.\n", - "\n", + "* **Experiment with different brewing methods:** Find what you like best!\n", + "* **Don't be afraid to adjust:** Play with the amount of coffee, water, and brewing time to find your perfect cup.\n", "\n", "\n", "Let me know if you have any other questions or want to explore a specific brewing method in more detail!\n", - "\n", - "\n", "user\n", "what is the best coffee?\n", - "\n", - "\n", + "model\n", "Ah, the eternal question! There's no single \"best\" coffee because taste is subjective. What one person finds delicious, another might find bitter or bland. \n", "\n", - "However, I can give you some pointers to help you find YOUR best coffee:\n", + "It all depends on your personal preferences:\n", "\n", - "**Factors that influence coffee taste:**\n", + "**Consider these factors:**\n", "\n", - "* **Bean Origin:** Different regions produce beans with unique flavor profiles. \n", - " * **Latin America:** Often known for chocolatey, nutty, and smooth flavors. (Colombia, Brazil, Guatemala)\n", - " * **Africa:** Can have bright acidity, fruity notes, and floral aromas. (Ethiopia, Kenya, Tanzania)\n", - " * **Asia/Pacific:** Often earthy, spicy, and full-bodied. (Indonesia, Vietnam)\n", "* **Roast Level:**\n", - " * **Light:** More acidic, delicate flavors, higher caffeine.\n", - " * **Medium:** Balanced acidity and body, versatile.\n", - " * **Dark:** Bold, smoky, bittersweet flavors, lower caffeine.\n", - "* **Brewing Method:** Each method extracts flavors differently, impacting the final taste.\n", - "\n", - "**Finding YOUR Best:**\n", - "\n", - "1. **Explore Different Origins:** Try coffees from various regions to discover what flavor profiles you enjoy.\n", - "2. **Experiment with Roast Levels:** Sample light, medium, and dark roasts to see your preference.\n", - "3. **Consider Your Brewing Method:** Different beans work better with certain brewing methods. Ask your local coffee shop for recommendations.\n", - "4. **Read Reviews:** Online reviews and coffee blogs can offer insights into specific beans and roasters.\n", - "5. **Visit a Local Coffee Shop:** Talk to baristas, ask for recommendations, and try different coffees.\n", - "\n", - "**Remember:** Coffee is a journey of discovery! Enjoy the process of exploring and finding your perfect cup.\n", - "\n", - "\n", - "user\n", - "what are similar drinks?\n", - "\n", - "model\n", - "\n", - "\n", - "user\n", - "help me understand how to make coffee\n", - "\n", - "model\n", - "\n", - "\n", - "user\n", - "help me understand how to make coffee\n", - "\n", - "\n", - "## Let's Brew Some Coffee! ☕️\n", + " * **Light:** Bright acidity, delicate flavors, often fruity or floral.\n", + " * **Medium:** Balanced acidity and body, with more pronounced flavors.\n", + " * **Dark:** Bold, smoky, sometimes bittersweet, with less acidity.\n", + "* **Origin:** Different regions produce beans with unique flavor profiles:\n", + " * **Latin America:** Often chocolatey, nutty, with medium acidity.\n", + " * **Africa:** Known for bright acidity, fruity notes, and floral aromas.\n", + " * **Asia/Pacific:** Earthy, spicy, sometimes with chocolate or caramel notes.\n", + "* **Brewing Method:** The method you use can significantly impact the flavor.\n", "\n", - "Making coffee is a simple process, but there are many ways to do it. Here's a breakdown of some popular methods:\n", + "**Some Popular and Highly-Regarded Coffees:**\n", "\n", - "**1. Drip Coffee Maker:**\n", + "* **Ethiopian Yirgacheffe:** Known for its floral, citrusy, and tea-like qualities.\n", + "* **Kenyan AA:** Bright acidity, black currant, and berry flavors.\n", + "* **Sumatran Mandheling:** Earthy, spicy, with low acidity.\n", + "* **Colombian Supremo:** Balanced, with chocolate and caramel notes.\n", "\n", - "* **What you need:** Drip coffee maker, coffee filter, ground coffee, water.\n", - "* **How to do it:**\n", - " 1. Fill the water reservoir with fresh, cold water.\n", - " 2. Place a filter in the filter basket.\n", - " 3. Add ground coffee to the filter (follow the coffee maker's instructions for the right amount).\n", - " 4. Turn on the coffee maker and let it brew.\n", - " 5. Enjoy your freshly brewed coffee!\n", + "**My Recommendation:**\n", "\n", - "**2. French Press:**\n", - "\n", - "* **What you need:** French press, coarse ground coffee, hot water.\n", - "* **How to do it:**\n", - " 1. Heat water to just off the boil (around 200°F).\n", - " 2. Add coarse ground coffee to the French press.\n", - " 3. Pour hot water over the coffee grounds, making sure all grounds are saturated.\n", - " 4. Stir gently and place the lid on the press, but don't plunge yet.\n", - " 5. Let the coffee steep for 4 minutes.\n", - " 6. Slowly press the plunger down to separate the grounds from the brewed coffee.\n", - " 7. Pour and enjoy!\n", - "\n", - "**3. Pour Over:**\n", - "\n", - "* **What you need:** Pour over cone, filter, medium-fine ground coffee, hot water.\n", - "* **How to do it:**\n", - " 1. Place a filter in the cone and rinse it with hot water to remove any paper taste.\n", - " 2. Add medium-fine ground coffee to the filter.\n", - " 3. Slowly pour hot water over the coffee grounds in a circular motion, making sure all grounds are saturated.\n", - " 4. Let the coffee drip through into your cup.\n", - " 5. Enjoy!\n", - "\n", - "**4. Cold Brew:**\n", - "\n", - "* **What you need:** Coarse ground coffee, cold water, container.\n", - "* **How to do it:**\n", - " 1. Combine coarse ground coffee and cold water in a container (ratio of 1:8 coffee to water).\n", - " 2. Stir well and cover the container.\n", - " 3. Let the coffee steep in the refrigerator for 12-24 hours.\n", - " 4. Strain the coffee through a fine-mesh sieve or cheesecloth.\n", - " 5. Serve over ice and enjoy!\n", - "\n", - "**Tips for Better Coffee:**\n", - "\n", - "* **Use fresh, high-quality beans:** The better the beans, the better the coffee.\n", - "* **Grind your beans right before brewing:** This preserves the flavor and aroma.\n", - "* **Use filtered water:** Impurities in water can affect the taste of your coffee.\n", - "* **Experiment with different brewing methods:** Find the method that you enjoy the most.\n", - "* **Clean your coffee maker regularly:** This will help to prevent buildup and ensure that your coffee tastes its best.\n", - "\n", - "\n", - "\n", - "Let me know if you have any other questions or want to explore a specific brewing method in more detail!\n", - "\n", - "\n", - "user\n", - "what is the best coffee?\n", - "\n", - "model\n", + "* **Start exploring!** Try different roasts, origins, and brewing methods to discover what you enjoy most.\n", + "* **Talk to your local coffee shop:** Baristas are passionate about coffee and can offer great recommendations based on your preferences.\n", + "* **Don't be afraid to experiment:** The world of coffee is vast and exciting!\n", "\n", "\n", + "Happy brewing!\n", "user\n", - "help me understand how to make coffee\n", - "\n", + "what are similar drinks?\n", "model\n", + "You're looking for drinks that share similarities with coffee! Here are some options, categorized by what aspect of coffee they resemble:\n", "\n", + "**Similar Caffeine Kick:**\n", "\n", - "user\n", - "help me understand how to make coffee\n", - "\n", - "\n", - "## Let's Brew Some Coffee! ☕️\n", - "\n", - "Making coffee is a simple process, but there are many ways to do it. Here's a breakdown of some popular methods:\n", - "\n", - "**1. Drip Coffee Maker:**\n", - "\n", - "* **What you need:** Drip coffee maker, coffee filter, ground coffee, water.\n", - "* **How to do it:**\n", - " 1. Fill the water reservoir with fresh, cold water.\n", - " 2. Place a filter in the filter basket.\n", - " 3. Add ground coffee to the filter (follow the coffee maker's instructions for the right amount).\n", - " 4. Turn on the coffee maker and let it brew.\n", - " 5. Enjoy your freshly brewed coffee!\n", - "\n", - "**2. French Press:**\n", - "\n", - "* **What you need:** French press, coarse ground coffee, hot water.\n", - "* **How to do it:**\n", - " 1. Heat water to just off the boil (around 200°F).\n", - " 2. Add coarse ground coffee to the French press.\n", - " 3. Pour hot water over the coffee grounds, making sure all grounds are saturated.\n", - " 4. Stir gently and place the lid on the press, but don't plunge yet.\n", - " 5. Let the coffee steep for 4 minutes.\n", - " 6. Slowly press the plunger down to separate the grounds from the brewed coffee.\n", - " 7. Pour and enjoy!\n", - "\n", - "**3. Pour Over:**\n", - "\n", - "* **What you need:** Pour over cone, filter, medium-fine ground coffee, hot water.\n", - "* **How to do it:**\n", - " 1. Place a filter in the cone and rinse it with hot water to remove any paper taste.\n", - " 2. Add medium-fine ground coffee to the filter.\n", - " 3. Slowly pour hot water over the coffee grounds in a circular motion, making sure all grounds are saturated.\n", - " 4. Let the coffee drip through into your cup.\n", - " 5. Enjoy!\n", - "\n", - "**4. Cold Brew:**\n", - "\n", - "* **What you need:** Coarse ground coffee, cold water, container.\n", - "* **How to do it:**\n", - " 1. Combine coarse ground coffee and cold water in a container (ratio of 1:8 coffee to water).\n", - " 2. Stir well and cover the container.\n", - " 3. Let the coffee steep in the refrigerator for 12-24 hours.\n", - " 4. Strain the coffee through a fine-mesh sieve or cheesecloth.\n", - " 5. Serve over ice and enjoy!\n", - "\n", - "**Tips for Better Coffee:**\n", - "\n", - "* **Use fresh, high-quality beans:** The better the beans, the better the coffee.\n", - "* **Grind your beans right before brewing:** This preserves the flavor and aroma.\n", - "* **Use filtered water:** Impurities in water can affect the taste of your coffee.\n", - "* **Experiment with different brewing methods:** Find the method that you enjoy the most.\n", - "* **Clean your coffee maker regularly:** This will help to prevent buildup and ensure that your coffee tastes its best.\n", - "\n", - "\n", - "\n", - "Let me know if you have any other questions or want to explore a specific brewing method in more detail!\n", - "\n", - "\n", - "user\n", - "what is the best coffee?\n", - "\n", - "\n", - "Ah, the eternal question! There's no single \"best\" coffee because taste is subjective. What one person finds delicious, another might find bitter or bland. \n", - "\n", - "However, I can give you some pointers to help you find YOUR best coffee:\n", - "\n", - "**Factors that influence coffee taste:**\n", - "\n", - "* **Bean Origin:** Different regions produce beans with unique flavor profiles. \n", - " * **Latin America:** Often known for chocolatey, nutty, and smooth flavors. (Colombia, Brazil, Guatemala)\n", - " * **Africa:** Can have bright acidity, fruity notes, and floral aromas. (Ethiopia, Kenya, Tanzania)\n", - " * **Asia/Pacific:** Often earthy, spicy, and full-bodied. (Indonesia, Vietnam)\n", - "* **Roast Level:**\n", - " * **Light:** More acidic, delicate flavors, higher caffeine.\n", - " * **Medium:** Balanced acidity and body, versatile.\n", - " * **Dark:** Bold, smoky, bittersweet flavors, lower caffeine.\n", - "* **Brewing Method:** Each method extracts flavors differently, impacting the final taste.\n", - "\n", - "**Finding YOUR Best:**\n", - "\n", - "1. **Explore Different Origins:** Try coffees from various regions to discover what flavor profiles you enjoy.\n", - "2. **Experiment with Roast Levels:** Sample light, medium, and dark roasts to see your preference.\n", - "3. **Consider Your Brewing Method:** Different beans work better with certain brewing methods. Ask your local coffee shop for recommendations.\n", - "4. **Read Reviews:** Online reviews and coffee blogs can offer insights into specific beans and roasters.\n", - "5. **Visit a Local Coffee Shop:** Talk to baristas, ask for recommendations, and try different coffees.\n", + "* **Tea:** Comes in endless varieties, with varying caffeine levels. Black tea has the most caffeine, followed by green, white, and herbal teas.\n", + "* **Matcha:** A powdered green tea with a unique earthy flavor and a good amount of caffeine.\n", + "* **Yerba Mate:** A South American beverage with a slightly bitter, grassy flavor and a caffeine boost comparable to coffee.\n", "\n", - "**Remember:** Coffee is a journey of discovery! Enjoy the process of exploring and finding your perfect cup.\n", - "\n", + "**Similar Rich, Roasted Flavor:**\n", "\n", - "user\n", - "what are similar drinks?\n", + "* **Chicory Coffee:** Made from roasted chicory root, it has a coffee-like flavor but is caffeine-free.\n", + "* **Roasted Barley Tea:** A caffeine-free option with a nutty, roasted flavor.\n", "\n", + "**Similar Creamy, Indulgent Experience:**\n", "\n", - "Here are some drinks similar to coffee, categorized by what aspect of coffee they resemble:\n", + "* **Hot Chocolate:** A classic comfort drink with a rich, chocolatey flavor.\n", + "* **Golden Milk:** A warming drink made with turmeric, ginger, cinnamon, and milk.\n", "\n", - "**Similar Caffeine Kick:**\n", + "**Similar Ritual and Experience:**\n", "\n", - "* **Tea:** Wide variety of flavors and caffeine levels, from delicate green tea to robust black tea.\n", - "* **Matcha:** Powdered green tea with a unique earthy flavor and higher caffeine content than regular green tea.\n", - "* **Yerba Mate:** South American herbal tea with a slightly bitter, grassy flavor and moderate caffeine.\n", - "* **Energy Drinks:** High caffeine content, often with added sugar and other stimulants.\n", + "* **Chai Tea Latte:** A spiced black tea latte with a creamy, comforting flavor.\n", + "* **London Fog:** A blend of Earl Grey tea, steamed milk, and vanilla syrup.\n", "\n", - "**Similar Flavor Profiles:**\n", + "**Beyond the Usual:**\n", "\n", - "* **Chocolate:** Rich, bittersweet flavors can complement coffee's roasted notes.\n", - "* **Caramel:** Sweet and buttery, caramel adds a creamy dimension similar to coffee's body.\n", - "* **Vanilla:** A classic pairing with coffee, vanilla adds a warm, comforting sweetness.\n", - "* **Espresso-Based Drinks:** Lattes, cappuccinos, macchiatos, and mochas all feature espresso as a base, offering variations in milk and flavorings.\n", + "* **Kava:** A Polynesian drink made from the kava root, known for its relaxing and social effects.\n", + "* **Guayusa:** A South American tea with a smooth, slightly sweet flavor and a moderate caffeine boost.\n", "\n", - "**Similar Ritual and Experience:**\n", "\n", - "* **Hot Chocolate:** A comforting and warming drink often enjoyed in the morning or evening.\n", - "* **Herbal Teas:** A relaxing and flavorful alternative to coffee, enjoyed for their health benefits and calming effects.\n", - "* **Golden Milk:** A turmeric-based drink with\n", + "Remember, taste is subjective! Explore these options and see what you enjoy most.\n", "\n" ] } ], "source": [ - "chat.show_history()" + "print(chat.get_history())" ] } ],