"C:\\Users\\doroteap\\Documents\\Projects\\llm_engineering\\venv\\Lib\\site-packages\\gradio\\components\\chatbot.py:229: UserWarning: The 'tuples' format for chatbot messages is deprecated and will be removed in a future version of Gradio. Please set type='messages' instead, which uses openai-style 'role' and 'content' keys.\n",
" warnings.warn(\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"* Running on local URL: http://127.0.0.1:7864\n",
"\n",
"To create a public link, set `share=True` in `launch()`.\n"
"[{'role': 'system', 'content': 'You are a helpful assistant'}, {'role': 'user', 'content': 'hey'}]\n",
"History is:\n",
"[['hey', 'Hello! How can I assist you today?']]\n",
"And messages is:\n",
"[{'role': 'system', 'content': 'You are a helpful assistant'}, {'role': 'user', 'content': 'hey'}, {'role': 'assistant', 'content': 'Hello! How can I assist you today?'}, {'role': 'user', 'content': \"why don't you like the new messages format?\"}]\n"
]
}
],
"source": [
"gr.ChatInterface(fn=chat).launch()"
"gr.ChatInterface(chat).launch()"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 16,
"id": "1f91b414-8bab-472d-b9c9-3fa51259bdfe",
"metadata": {},
"outputs": [],
@ -152,7 +204,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 17,
"id": "4e5be3ec-c26c-42bc-ac16-c39d369883f6",
"metadata": {},
"outputs": [],
@ -174,17 +226,55 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 18,
"id": "413e9e4e-7836-43ac-a0c3-e1ab5ed6b136",
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"C:\\Users\\doroteap\\Documents\\Projects\\llm_engineering\\venv\\Lib\\site-packages\\gradio\\components\\chatbot.py:229: UserWarning: The 'tuples' format for chatbot messages is deprecated and will be removed in a future version of Gradio. Please set type='messages' instead, which uses openai-style 'role' and 'content' keys.\n",
" warnings.warn(\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"* Running on local URL: http://127.0.0.1:7865\n",
"\n",
"To create a public link, set `share=True` in `launch()`.\n"
"C:\\Users\\doroteap\\Documents\\Projects\\llm_engineering\\venv\\Lib\\site-packages\\gradio\\components\\chatbot.py:229: UserWarning: The 'tuples' format for chatbot messages is deprecated and will be removed in a future version of Gradio. Please set type='messages' instead, which uses openai-style 'role' and 'content' keys.\n",
" warnings.warn(\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"* Running on local URL: http://127.0.0.1:7866\n",
"\n",
"To create a public link, set `share=True` in `launch()`.\n"
"[{'role': 'user', 'content': \"You are a helpful assistant in a clothes store. You should try to gently encourage the customer to try items that are on sale. Hats are 60% off, and most other items are 50% off. For example, if the customer says 'I'm looking to buy a hat', you could reply something like, 'Wonderful - we have lots of hats - including several that are part of our sales evemt.'Encourage the customer to buy hats if they are unsure what to get. If the customer asks for a belt, be sure to say we don't sell them, but offer some hats instead.\"}, {'role': 'assistant', 'content': 'Hello, how can I help you today?'}]\n",
"[{'role': 'user', 'content': \"You are a helpful assistant in a clothes store. You should try to gently encourage the customer to try items that are on sale. Hats are 60% off, and most other items are 50% off. For example, if the customer says 'I'm looking to buy a hat', you could reply something like, 'Wonderful - we have lots of hats - including several that are part of our sales evemt.'Encourage the customer to buy hats if they are unsure what to get. If the customer asks for a belt, be sure to say we don't sell them, but offer some hats instead.\"}, {'role': 'assistant', 'content': 'Hello, how can I help you today?'}, {'role': 'user', 'content': 'what do you have?'}, {'role': 'user', 'content': 'what do you have?'}]\n",
"[{'role': 'user', 'content': \"You are a helpful assistant in a clothes store. You should try to gently encourage the customer to try items that are on sale. Hats are 60% off, and most other items are 50% off. For example, if the customer says 'I'm looking to buy a hat', you could reply something like, 'Wonderful - we have lots of hats - including several that are part of our sales evemt.'Encourage the customer to buy hats if they are unsure what to get. If the customer asks for a belt, be sure to say we don't sell them, but offer some hats instead.\"}, {'role': 'assistant', 'content': 'Hello, how can I help you today?'}, {'role': 'user', 'content': \"I'd like to but a belt\"}, {'role': 'user', 'content': \"I'd like to but a belt\"}, {'role': 'user', 'content': \"I'd like to but a belt\"}, {'role': 'user', 'content': \"I'd like to but a belt\"}]\n",
"[{'role': 'user', 'content': \"You are a helpful assistant in a clothes store. You should try to gently encourage the customer to try items that are on sale. Hats are 60% off, and most other items are 50% off. For example, if the customer says 'I'm looking to buy a hat', you could reply something like, 'Wonderful - we have lots of hats - including several that are part of our sales evemt.'Encourage the customer to buy hats if they are unsure what to get. If the customer asks for a belt, be sure to say we don't sell them, but offer some hats instead.\"}, {'role': 'assistant', 'content': 'Hello, how can I help you today?'}, {'role': 'user', 'content': \"you don't sell belts?\"}, {'role': 'user', 'content': \"you don't sell belts?\"}, {'role': 'user', 'content': \"you don't sell belts?\"}, {'role': 'user', 'content': \"you don't sell belts?\"}, {'role': 'user', 'content': \"you don't sell belts?\"}, {'role': 'user', 'content': \"you don't sell belts?\"}]\n"