Skip to content
This repository was archived by the owner on Jan 16, 2025. It is now read-only.

Commit 78a37e3

Browse files
committed
update nb
1 parent a10640f commit 78a37e3

File tree

2 files changed

+190
-481
lines changed

2 files changed

+190
-481
lines changed

notebooks/How_to_Build_a_Chatbot_with_the_Chat_Endpoint.ipynb

Lines changed: 4 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -34,28 +34,9 @@
3434
},
3535
{
3636
"cell_type": "code",
37-
"execution_count": 1,
38-
"metadata": {
39-
"colab": {
40-
"base_uri": "https://localhost:8080/"
41-
},
42-
"id": "hSWvflZlMmtp",
43-
"outputId": "4a1f8f07-4e39-4836-bf5b-b3f2f1972f70"
44-
},
45-
"outputs": [
46-
{
47-
"name": "stdout",
48-
"output_type": "stream",
49-
"text": [
50-
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m48.0/48.0 kB\u001b[0m \u001b[31m1.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
51-
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m2.7/2.7 MB\u001b[0m \u001b[31m28.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
52-
"\u001b[?25h\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",
53-
"llmx 0.0.15a0 requires openai, which is not installed.\n",
54-
"llmx 0.0.15a0 requires tiktoken, which is not installed.\u001b[0m\u001b[31m\n",
55-
"\u001b[0m"
56-
]
57-
}
58-
],
37+
"execution_count": null,
38+
"metadata": {},
39+
"outputs": [],
5940
"source": [
6041
"! pip install cohere -q"
6142
]
@@ -200,7 +181,7 @@
200181
"id": "vGZdMxt0PHhI"
201182
},
202183
"source": [
203-
"### Streaming the response"
184+
"## Streaming the response"
204185
]
205186
},
206187
{
@@ -446,46 +427,6 @@
446427
"print(json.dumps(data, indent=4))\n"
447428
]
448429
},
449-
{
450-
"cell_type": "code",
451-
"execution_count": 13,
452-
"metadata": {
453-
"colab": {
454-
"base_uri": "https://localhost:8080/"
455-
},
456-
"id": "AeKStQDQ0a9Q",
457-
"outputId": "3cb5ea7e-8e42-4da7-fa38-6b547878866c"
458-
},
459-
"outputs": [
460-
{
461-
"name": "stdout",
462-
"output_type": "stream",
463-
"text": [
464-
"cohere.StreamingChat {\n",
465-
"\tresponse: <Response [200]>\n",
466-
"\ttexts: [\"Audience engagement is critical in public speaking as it helps keep your audience interested and invested in your presentation. Here are some tips for using stories and examples effectively:\\n\\n- Use examples that are relevant to the audience's interests and experiences. This will help them relate to the topic and see the relevance of the presentation to their own lives.\\n- Use stories to illustrate key points and make them more memorable. People are naturally drawn to stories and find them easier to remember than facts and figures.\\n- Use examples that are concise and to the point. Long-winded examples can lose the audience's attention and make your presentation less effective.\\n- Use a variety of examples to keep the audience engaged. If you use the same example multiple times, it can become repetitive and lose its impact.\\n- Use personal examples when appropriate. This will help make the presentation more relatable and engaging. \\n\\nUsing a combination of these tips will help you effectively use stories and examples to keep your audience engaged.\"]\n",
467-
"\tresponse_id: 263b24f0-236c-4210-ad05-3a40821c7999\n",
468-
"\tconversation_id: b4fe32ed-49d6-457a-b14d-aa3f5498011b\n",
469-
"\tgeneration_id: 6b1cb522-ad7b-45bd-a8fb-0af0a49eaa27\n",
470-
"\tpreamble: None\n",
471-
"\tprompt: None\n",
472-
"\tchat_history: [{'user_name': 'User', 'text': 'Hello', 'message': 'Hello', 'response_id': '769f0325-2f2c-47de-af1d-ba2b53836f9b', 'generation_id': '06acb699-f646-407b-bb58-81d77ab9e055', 'position': 2, 'active': True, 'role': 'User'}, {'user_name': 'Chatbot', 'text': \"Hello, I'm here to help you with your public speaking skills. What are you looking to work on today? \\n\\nSome possible areas to work on are:\\n- Speaking clearly and confidently\\n- Projecting your voice so that everyone can hear you\\n- Using hand movements and other body language to emphasize your points\\n- Using visual aids such as slides or charts to support your presentation\\n- Keeping your audience engaged and interested in your presentation\\n- Answering questions from the audience effectively\\n- Dealing with nerves and anxiety before and during a presentation\", 'message': \"Hello, I'm here to help you with your public speaking skills. What are you looking to work on today? \\n\\nSome possible areas to work on are:\\n- Speaking clearly and confidently\\n- Projecting your voice so that everyone can hear you\\n- Using hand movements and other body language to emphasize your points\\n- Using visual aids such as slides or charts to support your presentation\\n- Keeping your audience engaged and interested in your presentation\\n- Answering questions from the audience effectively\\n- Dealing with nerves and anxiety before and during a presentation\", 'response_id': '769f0325-2f2c-47de-af1d-ba2b53836f9b', 'generation_id': '44867fab-452c-4224-abe0-a23c727b1830', 'position': 3, 'active': True, 'role': 'Chatbot'}, {'user_name': 'User', 'text': \"I'd like to learn about techniques for effective audience engagement\", 'message': \"I'd like to learn about techniques for effective audience engagement\", 'response_id': 'ec8b5bad-ccdf-4878-ac0d-13522947fca7', 'generation_id': 'fe1ba270-cbd0-4116-be39-8d4a10f8f431', 'position': 4, 'active': True, 'role': 'User'}, {'user_name': 'Chatbot', 'text': \"Audience engagement is crucial to successful public speaking. Here are some techniques you can use to keep your audience engaged:\\n\\n- Use interactive elements in your presentation, such as polls, quizzes, or discussions. This will help keep your audience engaged and involved in the presentation.\\n- Ask questions to the audience, and encourage them to ask questions back. This will help create a more interactive and engaging presentation.\\n- Tell stories and use examples that are relevant to the audience. This will help make your presentation more relatable and interesting.\\n- Use humor sparingly to keep the audience entertained. However, be sure that the humor is appropriate for the context and doesn't offend anyone.\\n- Use body language and non-verbal cues to emphasize your points and connect with the audience.\\n- Keep your energy level up throughout the presentation, and project confidence.\\n- If you see that your audience is losing interest, change up your presentation style or content to re-engage them.\\n\\nUsing a combination of these techniques will help you effectively engage with your audience and give a successful presentation.\", 'message': \"Audience engagement is crucial to successful public speaking. Here are some techniques you can use to keep your audience engaged:\\n\\n- Use interactive elements in your presentation, such as polls, quizzes, or discussions. This will help keep your audience engaged and involved in the presentation.\\n- Ask questions to the audience, and encourage them to ask questions back. This will help create a more interactive and engaging presentation.\\n- Tell stories and use examples that are relevant to the audience. This will help make your presentation more relatable and interesting.\\n- Use humor sparingly to keep the audience entertained. However, be sure that the humor is appropriate for the context and doesn't offend anyone.\\n- Use body language and non-verbal cues to emphasize your points and connect with the audience.\\n- Keep your energy level up throughout the presentation, and project confidence.\\n- If you see that your audience is losing interest, change up your presentation style or content to re-engage them.\\n\\nUsing a combination of these techniques will help you effectively engage with your audience and give a successful presentation.\", 'response_id': 'ec8b5bad-ccdf-4878-ac0d-13522947fca7', 'generation_id': '2126abc9-8b1d-4d42-89b6-69df3126460a', 'position': 5, 'active': True, 'role': 'Chatbot'}, {'user_name': 'User', 'text': 'Could you elaborate on the third point.', 'message': 'Could you elaborate on the third point.', 'response_id': '263b24f0-236c-4210-ad05-3a40821c7999', 'generation_id': '83d8753c-fc07-4d6a-9d05-b30c65d75cab', 'position': 6, 'active': True, 'role': 'User'}, {'user_name': 'Chatbot', 'text': \"Audience engagement is critical in public speaking as it helps keep your audience interested and invested in your presentation. Here are some tips for using stories and examples effectively:\\n\\n- Use examples that are relevant to the audience's interests and experiences. This will help them relate to the topic and see the relevance of the presentation to their own lives.\\n- Use stories to illustrate key points and make them more memorable. People are naturally drawn to stories and find them easier to remember than facts and figures.\\n- Use examples that are concise and to the point. Long-winded examples can lose the audience's attention and make your presentation less effective.\\n- Use a variety of examples to keep the audience engaged. If you use the same example multiple times, it can become repetitive and lose its impact.\\n- Use personal examples when appropriate. This will help make the presentation more relatable and engaging. \\n\\nUsing a combination of these tips will help you effectively use stories and examples to keep your audience engaged.\", 'message': \"Audience engagement is critical in public speaking as it helps keep your audience interested and invested in your presentation. Here are some tips for using stories and examples effectively:\\n\\n- Use examples that are relevant to the audience's interests and experiences. This will help them relate to the topic and see the relevance of the presentation to their own lives.\\n- Use stories to illustrate key points and make them more memorable. People are naturally drawn to stories and find them easier to remember than facts and figures.\\n- Use examples that are concise and to the point. Long-winded examples can lose the audience's attention and make your presentation less effective.\\n- Use a variety of examples to keep the audience engaged. If you use the same example multiple times, it can become repetitive and lose its impact.\\n- Use personal examples when appropriate. This will help make the presentation more relatable and engaging. \\n\\nUsing a combination of these tips will help you effectively use stories and examples to keep your audience engaged.\", 'response_id': '263b24f0-236c-4210-ad05-3a40821c7999', 'generation_id': '6b1cb522-ad7b-45bd-a8fb-0af0a49eaa27', 'position': 7, 'active': True, 'role': 'Chatbot'}]\n",
473-
"\tfinish_reason: COMPLETE\n",
474-
"\ttoken_count: {'prompt_tokens': 381, 'response_tokens': 201, 'total_tokens': 582, 'billed_tokens': 565}\n",
475-
"\tmeta: None\n",
476-
"\tis_search_required: None\n",
477-
"\tcitations: None\n",
478-
"\tdocuments: None\n",
479-
"\tsearch_results: None\n",
480-
"\tsearch_queries: None\n",
481-
"}\n"
482-
]
483-
}
484-
],
485-
"source": [
486-
"print(response)"
487-
]
488-
},
489430
{
490431
"attachments": {},
491432
"cell_type": "markdown",

0 commit comments

Comments
 (0)