unknown commited on
Commit
9ef8318
1 Parent(s): af72886

First model version

Browse files
Azure_Prompt_Brainstorming_Partner_NoLangchain_working_28Sep23.ipynb ADDED
@@ -0,0 +1,978 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "markdown",
5
+ "metadata": {
6
+ "id": "TYeF33IhfmNr"
7
+ },
8
+ "source": [
9
+ "*This Notebook is compiled by Rajiv Kale at Persistent University*\n",
10
+ "\n",
11
+ "**Not to be copied. For authorized use only.**"
12
+ ]
13
+ },
14
+ {
15
+ "cell_type": "markdown",
16
+ "metadata": {
17
+ "id": "z0puDqAyfrI7"
18
+ },
19
+ "source": [
20
+ "This Notebook code is intended to be run on Google Colab or some Linux based machine"
21
+ ]
22
+ },
23
+ {
24
+ "cell_type": "markdown",
25
+ "metadata": {
26
+ "id": "sDgseysPjKcE"
27
+ },
28
+ "source": [
29
+ "**IMPORTANT NOTE BELOW**"
30
+ ]
31
+ },
32
+ {
33
+ "cell_type": "markdown",
34
+ "metadata": {
35
+ "id": "XEEGCW5pgMc-"
36
+ },
37
+ "source": [
38
+ "This notebook demonstrates how to use Azure OpenAI models to generate **expanded text** based on smaller inputs. Like writing emails or generating an essay on some topic. **LLM**, in this case, can be considered as a **brainstorming partner**. However, one must be mindful of using LLM capabilities in a **responsible way**. Never leverage LLM capabilities to generate harmful, derogatory, disrespectful, hatred oriented narratives or spam emails etc."
39
+ ]
40
+ },
41
+ {
42
+ "cell_type": "markdown",
43
+ "metadata": {
44
+ "id": "ZZddKakkgdBC"
45
+ },
46
+ "source": [
47
+ "We first need to get a config file that holds values for model specifics including **OPENAI_API_KEY**"
48
+ ]
49
+ },
50
+ {
51
+ "cell_type": "markdown",
52
+ "metadata": {
53
+ "id": "zmRZMSgTjW2h"
54
+ },
55
+ "source": [
56
+ "You may have your config file uploaded on your git repo which you can clone as shown here OR on your google drive which you can mount and get access to"
57
+ ]
58
+ },
59
+ {
60
+ "cell_type": "code",
61
+ "execution_count": 1,
62
+ "metadata": {
63
+ "id": "rFQLdc_UjZD5"
64
+ },
65
+ "outputs": [],
66
+ "source": [
67
+ "# ! rm -rf /content/MyMLProject # uncomment and run only if you restart kernel and try again"
68
+ ]
69
+ },
70
+ {
71
+ "cell_type": "code",
72
+ "execution_count": 2,
73
+ "metadata": {
74
+ "colab": {
75
+ "base_uri": "https://localhost:8080/"
76
+ },
77
+ "id": "IKf0ikr8jyjL",
78
+ "outputId": "8d3b146b-d809-4f9b-f68a-94af498a467e"
79
+ },
80
+ "outputs": [
81
+ {
82
+ "name": "stdout",
83
+ "output_type": "stream",
84
+ "text": [
85
+ "Cloning into 'MyMLProject'...\n",
86
+ "remote: Enumerating objects: 62, done.\u001b[K\n",
87
+ "remote: Counting objects: 100% (49/49), done.\u001b[K\n",
88
+ "remote: Compressing objects: 100% (47/47), done.\u001b[K\n",
89
+ "remote: Total 62 (delta 17), reused 0 (delta 0), pack-reused 13\u001b[K\n",
90
+ "Receiving objects: 100% (62/62), 2.52 MiB | 6.52 MiB/s, done.\n",
91
+ "Resolving deltas: 100% (18/18), done.\n"
92
+ ]
93
+ }
94
+ ],
95
+ "source": [
96
+ "# ! git clone https://github.com/rajivkale/MyMLProject.git"
97
+ ]
98
+ },
99
+ {
100
+ "cell_type": "code",
101
+ "execution_count": 3,
102
+ "metadata": {
103
+ "id": "GlFb-Kpvj3dR"
104
+ },
105
+ "outputs": [],
106
+ "source": [
107
+ "# !cp /content/MyMLProject/azure-gpt-4.ini ."
108
+ ]
109
+ },
110
+ {
111
+ "cell_type": "code",
112
+ "execution_count": 1,
113
+ "metadata": {
114
+ "colab": {
115
+ "base_uri": "https://localhost:8080/"
116
+ },
117
+ "id": "o1BP_KEGj7zt",
118
+ "outputId": "7fa0b40a-9e86-4181-b77f-39c0fe371fbb"
119
+ },
120
+ "outputs": [
121
+ {
122
+ "data": {
123
+ "text/plain": [
124
+ "['./azure-gpt-4.ini']"
125
+ ]
126
+ },
127
+ "execution_count": 1,
128
+ "metadata": {},
129
+ "output_type": "execute_result"
130
+ }
131
+ ],
132
+ "source": [
133
+ "import configparser\n",
134
+ "cfg = configparser.ConfigParser(interpolation=None)\n",
135
+ "file_path = './azure-gpt-4.ini'\n",
136
+ "cfg.read(file_path)"
137
+ ]
138
+ },
139
+ {
140
+ "cell_type": "code",
141
+ "execution_count": 2,
142
+ "metadata": {
143
+ "id": "H9hY5mdy8HZ5"
144
+ },
145
+ "outputs": [],
146
+ "source": [
147
+ "## You would expect following type of contents in the config file\n",
148
+ "\n",
149
+ "#[auth]\n",
150
+ "#api_key =\n",
151
+ "\n",
152
+ "\n",
153
+ "\n",
154
+ "#[chat-model]\n",
155
+ "#api_base =\n",
156
+ "#api_version = 2023-03-15-preview\n",
157
+ "#model_deployment = gpt-35-big\n",
158
+ "\n",
159
+ "\n",
160
+ "\n",
161
+ "#[embeddings-model]\n",
162
+ "#api_base =\n",
163
+ "#api_version = 2023-05-15\n",
164
+ "#model_deployment = text-embedding-ada-002"
165
+ ]
166
+ },
167
+ {
168
+ "cell_type": "code",
169
+ "execution_count": 3,
170
+ "metadata": {
171
+ "colab": {
172
+ "base_uri": "https://localhost:8080/"
173
+ },
174
+ "id": "wJd5LEISj-IR",
175
+ "outputId": "d7757d74-7a82-453e-b46c-c2282687bd95"
176
+ },
177
+ "outputs": [
178
+ {
179
+ "name": "stdout",
180
+ "output_type": "stream",
181
+ "text": [
182
+ "Requirement already satisfied: openai in c:\\program files\\python39\\lib\\site-packages (0.27.8)\n",
183
+ "Requirement already satisfied: requests>=2.20 in c:\\program files\\python39\\lib\\site-packages (from openai) (2.31.0)\n",
184
+ "Requirement already satisfied: tqdm in c:\\program files\\python39\\lib\\site-packages (from openai) (4.65.0)\n",
185
+ "Requirement already satisfied: aiohttp in c:\\program files\\python39\\lib\\site-packages (from openai) (3.8.4)\n",
186
+ "Requirement already satisfied: charset-normalizer<4,>=2 in c:\\program files\\python39\\lib\\site-packages (from requests>=2.20->openai) (3.1.0)\n",
187
+ "Requirement already satisfied: idna<4,>=2.5 in c:\\program files\\python39\\lib\\site-packages (from requests>=2.20->openai) (3.4)\n",
188
+ "Requirement already satisfied: urllib3<3,>=1.21.1 in c:\\program files\\python39\\lib\\site-packages (from requests>=2.20->openai) (1.26.6)\n",
189
+ "Requirement already satisfied: certifi>=2017.4.17 in c:\\program files\\python39\\lib\\site-packages (from requests>=2.20->openai) (2022.12.7)\n",
190
+ "Requirement already satisfied: attrs>=17.3.0 in c:\\program files\\python39\\lib\\site-packages (from aiohttp->openai) (23.1.0)\n",
191
+ "Requirement already satisfied: multidict<7.0,>=4.5 in c:\\program files\\python39\\lib\\site-packages (from aiohttp->openai) (6.0.4)\n",
192
+ "Requirement already satisfied: async-timeout<5.0,>=4.0.0a3 in c:\\program files\\python39\\lib\\site-packages (from aiohttp->openai) (4.0.2)\n",
193
+ "Requirement already satisfied: yarl<2.0,>=1.0 in c:\\program files\\python39\\lib\\site-packages (from aiohttp->openai) (1.9.2)\n",
194
+ "Requirement already satisfied: frozenlist>=1.1.1 in c:\\program files\\python39\\lib\\site-packages (from aiohttp->openai) (1.3.3)\n",
195
+ "Requirement already satisfied: aiosignal>=1.1.2 in c:\\program files\\python39\\lib\\site-packages (from aiohttp->openai) (1.3.1)\n",
196
+ "Requirement already satisfied: colorama in c:\\program files\\python39\\lib\\site-packages (from tqdm->openai) (0.4.6)\n",
197
+ "Requirement already satisfied: AzureOpenAI in c:\\program files\\python39\\lib\\site-packages (0.0.1)\n",
198
+ "Requirement already satisfied: aiohttp in c:\\program files\\python39\\lib\\site-packages (from AzureOpenAI) (3.8.4)\n",
199
+ "Requirement already satisfied: jsonschema in c:\\program files\\python39\\lib\\site-packages (from AzureOpenAI) (4.18.4)\n",
200
+ "Requirement already satisfied: requests in c:\\program files\\python39\\lib\\site-packages (from AzureOpenAI) (2.31.0)\n",
201
+ "Requirement already satisfied: attrs>=17.3.0 in c:\\program files\\python39\\lib\\site-packages (from aiohttp->AzureOpenAI) (23.1.0)\n",
202
+ "Requirement already satisfied: charset-normalizer<4.0,>=2.0 in c:\\program files\\python39\\lib\\site-packages (from aiohttp->AzureOpenAI) (3.1.0)\n",
203
+ "Requirement already satisfied: multidict<7.0,>=4.5 in c:\\program files\\python39\\lib\\site-packages (from aiohttp->AzureOpenAI) (6.0.4)\n",
204
+ "Requirement already satisfied: async-timeout<5.0,>=4.0.0a3 in c:\\program files\\python39\\lib\\site-packages (from aiohttp->AzureOpenAI) (4.0.2)\n",
205
+ "Requirement already satisfied: yarl<2.0,>=1.0 in c:\\program files\\python39\\lib\\site-packages (from aiohttp->AzureOpenAI) (1.9.2)\n",
206
+ "Requirement already satisfied: frozenlist>=1.1.1 in c:\\program files\\python39\\lib\\site-packages (from aiohttp->AzureOpenAI) (1.3.3)\n",
207
+ "Requirement already satisfied: aiosignal>=1.1.2 in c:\\program files\\python39\\lib\\site-packages (from aiohttp->AzureOpenAI) (1.3.1)\n",
208
+ "Requirement already satisfied: jsonschema-specifications>=2023.03.6 in c:\\program files\\python39\\lib\\site-packages (from jsonschema->AzureOpenAI) (2023.7.1)\n",
209
+ "Requirement already satisfied: referencing>=0.28.4 in c:\\program files\\python39\\lib\\site-packages (from jsonschema->AzureOpenAI) (0.30.0)\n",
210
+ "Requirement already satisfied: rpds-py>=0.7.1 in c:\\program files\\python39\\lib\\site-packages (from jsonschema->AzureOpenAI) (0.9.2)\n",
211
+ "Requirement already satisfied: idna<4,>=2.5 in c:\\program files\\python39\\lib\\site-packages (from requests->AzureOpenAI) (3.4)\n",
212
+ "Requirement already satisfied: urllib3<3,>=1.21.1 in c:\\program files\\python39\\lib\\site-packages (from requests->AzureOpenAI) (1.26.6)\n",
213
+ "Requirement already satisfied: certifi>=2017.4.17 in c:\\program files\\python39\\lib\\site-packages (from requests->AzureOpenAI) (2022.12.7)\n"
214
+ ]
215
+ }
216
+ ],
217
+ "source": [
218
+ "! pip install openai\n",
219
+ "! pip install AzureOpenAI\n",
220
+ "import openai"
221
+ ]
222
+ },
223
+ {
224
+ "cell_type": "code",
225
+ "execution_count": 4,
226
+ "metadata": {
227
+ "id": "hyV4zGqlkH6w"
228
+ },
229
+ "outputs": [],
230
+ "source": [
231
+ "from openai import ChatCompletion"
232
+ ]
233
+ },
234
+ {
235
+ "cell_type": "code",
236
+ "execution_count": 5,
237
+ "metadata": {
238
+ "colab": {
239
+ "base_uri": "https://localhost:8080/",
240
+ "height": 70
241
+ },
242
+ "id": "jsuvbu3PkRsx",
243
+ "outputId": "3b36e87c-ea89-4c31-eec0-5852fd120906"
244
+ },
245
+ "outputs": [
246
+ {
247
+ "data": {
248
+ "text/plain": [
249
+ "'\\n# We could have set the configurations directly like below. However, that is NOT a good practice from security perspective\\ndeployment_name = \"gpt-35-big\"\\nChatCompletion.deployment = \"gpt-35-big\"\\nChatCompletion.api_type = \"azure\"\\nChatCompletion.api_key= \"<your-key>\"\\nChatCompletion.api_base= \"\"\\nChatCompletion.api_version = \"2023-03-15-preview\"\\n'"
250
+ ]
251
+ },
252
+ "execution_count": 5,
253
+ "metadata": {},
254
+ "output_type": "execute_result"
255
+ }
256
+ ],
257
+ "source": [
258
+ "'''\n",
259
+ "# We could have set the configurations directly like below. However, that is NOT a good practice from security perspective\n",
260
+ "deployment_name = \"gpt-35-big\"\n",
261
+ "ChatCompletion.deployment = \"gpt-35-big\"\n",
262
+ "ChatCompletion.api_type = \"azure\"\n",
263
+ "ChatCompletion.api_key= \"<your-key>\"\n",
264
+ "ChatCompletion.api_base= \"\"\n",
265
+ "ChatCompletion.api_version = \"2023-03-15-preview\"\n",
266
+ "'''"
267
+ ]
268
+ },
269
+ {
270
+ "cell_type": "code",
271
+ "execution_count": 6,
272
+ "metadata": {
273
+ "id": "dXc8I5P2kqoo"
274
+ },
275
+ "outputs": [],
276
+ "source": [
277
+ "openai.api_type = cfg['deployment']['api_type']\n",
278
+ "openai.api_version = cfg['deployment']['api_version']\n",
279
+ "openai.api_base = cfg['deployment']['api_base']\n",
280
+ "openai.api_key = cfg['auth']['api_key']"
281
+ ]
282
+ },
283
+ {
284
+ "cell_type": "markdown",
285
+ "metadata": {
286
+ "id": "fyntb1vAkacp"
287
+ },
288
+ "source": [
289
+ "Let us test out if our settings are correct bold text and model responds to our instructions"
290
+ ]
291
+ },
292
+ {
293
+ "cell_type": "code",
294
+ "execution_count": 7,
295
+ "metadata": {
296
+ "colab": {
297
+ "base_uri": "https://localhost:8080/"
298
+ },
299
+ "id": "eJ6o25Fvkb4Y",
300
+ "outputId": "ceb569a2-091e-4aed-d5d2-a9c37f7296ad"
301
+ },
302
+ "outputs": [
303
+ {
304
+ "name": "stdout",
305
+ "output_type": "stream",
306
+ "text": [
307
+ "{\n",
308
+ " \"id\": \"chatcmpl-83lWFxFHpFEj4YHpbM15tPx21dp8w\",\n",
309
+ " \"object\": \"chat.completion\",\n",
310
+ " \"created\": 1695908339,\n",
311
+ " \"model\": \"gpt-4\",\n",
312
+ " \"choices\": [\n",
313
+ " {\n",
314
+ " \"index\": 0,\n",
315
+ " \"finish_reason\": \"stop\",\n",
316
+ " \"message\": {\n",
317
+ " \"role\": \"assistant\",\n",
318
+ " \"content\": \"Microsoft was founded by Bill Gates and Paul Allen on April 4, 1975. The two friends started the company to develop and sell a version of the BASIC programming language for the Altair 8800, an early personal computer. Microsoft later went on to create the MS-DOS operating system and the popular Windows operating system, becoming one of the world's most successful technology companies.\\n\"\n",
319
+ " }\n",
320
+ " }\n",
321
+ " ],\n",
322
+ " \"usage\": {\n",
323
+ " \"completion_tokens\": 78,\n",
324
+ " \"prompt_tokens\": 29,\n",
325
+ " \"total_tokens\": 107\n",
326
+ " }\n",
327
+ "}\n",
328
+ "Microsoft was founded by Bill Gates and Paul Allen on April 4, 1975. The two friends started the company to develop and sell a version of the BASIC programming language for the Altair 8800, an early personal computer. Microsoft later went on to create the MS-DOS operating system and the popular Windows operating system, becoming one of the world's most successful technology companies.\n",
329
+ "\n"
330
+ ]
331
+ }
332
+ ],
333
+ "source": [
334
+ "import os\n",
335
+ "import openai\n",
336
+ "\n",
337
+ "response = openai.ChatCompletion.create(\n",
338
+ " engine=\"gpt-4-8k\", # The deployment name you chose when you deployed the GPT-35-Turbo or GPT-4 model.\n",
339
+ " messages=[\n",
340
+ " {\"role\": \"system\", \"content\": \"Assistant is a large language model trained by OpenAI.\"},\n",
341
+ " {\"role\": \"user\", \"content\": \"Who were the founders of Microsoft?\"}\n",
342
+ " ]\n",
343
+ ")\n",
344
+ "\n",
345
+ "print(response)\n",
346
+ "\n",
347
+ "print(response['choices'][0]['message']['content'])"
348
+ ]
349
+ },
350
+ {
351
+ "cell_type": "markdown",
352
+ "metadata": {
353
+ "id": "wtp4D1vhk0o4"
354
+ },
355
+ "source": [
356
+ "Now that our **setup is ready** and the LLM model is responding we can try out a few new things"
357
+ ]
358
+ },
359
+ {
360
+ "cell_type": "markdown",
361
+ "metadata": {
362
+ "id": "VLFwX5a3k7-A"
363
+ },
364
+ "source": [
365
+ "Let us see if can write a **prompt** to generate some **bigger text output** by taking in some **small input**. Here we will check if LLM is capable of **generating output thoughtfully** by considering both inout text and the instructions"
366
+ ]
367
+ },
368
+ {
369
+ "cell_type": "code",
370
+ "execution_count": 8,
371
+ "metadata": {
372
+ "id": "JsR8as3rlgoY"
373
+ },
374
+ "outputs": [],
375
+ "source": [
376
+ "product_review = f\"\"\"I received LG washing machine 5 days late than comitted. Then installation engineer arrives 2 days late. \\\n",
377
+ "Washing machine worked alright for just 3 days and started behaving wierd. \\\n",
378
+ "It made disturbing noise while doing spin dry. All washing machines face wear and tear but te most common issues with LG washers \\\n",
379
+ "relate to the washer not draining, wires breaking, or excess water caused by a defective water inlet valve.\\\n",
380
+ "When service ticket was raised all that I was responded with is to go through user manual and do self servicing. \\\n",
381
+ "Read on to troubleshooting sections and I was left on my own - Kiran Rao, Bengaluru\n",
382
+ "\"\"\""
383
+ ]
384
+ },
385
+ {
386
+ "cell_type": "code",
387
+ "execution_count": 9,
388
+ "metadata": {
389
+ "id": "HDmHbrnVlQvq"
390
+ },
391
+ "outputs": [],
392
+ "source": [
393
+ "role = \"you are an expert in creating email responses to service issues raised by a consumer product\""
394
+ ]
395
+ },
396
+ {
397
+ "cell_type": "code",
398
+ "execution_count": 10,
399
+ "metadata": {
400
+ "id": "PIR13rV_k4QY"
401
+ },
402
+ "outputs": [],
403
+ "source": [
404
+ "prompt = f\"\"\"\n",
405
+ "Your task is to generate an email response to a product review received from one of the frustrated customer. \\\n",
406
+ "Make sure to draft an email in pacifying language that will provide an assurance \\\n",
407
+ "of immediate remdial action from field support staff. \\\n",
408
+ "Generate a point by point action plan to address every issue that customer has raised. \\\n",
409
+ "\n",
410
+ "Customer product review is given below delimited by triple\n",
411
+ "backticks.\n",
412
+ "\n",
413
+ "Review: ```{product_review}```\n",
414
+ "\"\"\""
415
+ ]
416
+ },
417
+ {
418
+ "cell_type": "code",
419
+ "execution_count": 11,
420
+ "metadata": {
421
+ "colab": {
422
+ "base_uri": "https://localhost:8080/"
423
+ },
424
+ "id": "9-wPizR3pvQt",
425
+ "outputId": "8f871016-d0ef-4530-e744-4ed63b3c4240"
426
+ },
427
+ "outputs": [
428
+ {
429
+ "name": "stdout",
430
+ "output_type": "stream",
431
+ "text": [
432
+ "Subject: Apology for Inconvenience and Immediate Support for Your LG Washing Machine Issues\n",
433
+ "\n",
434
+ "Dear Kiran Rao,\n",
435
+ "\n",
436
+ "Thank you for taking the time to share your concerns about your recent LG washing machine purchase. Please accept our sincere apologies for the inconveniences you have faced. We understand your disappointment, and your feedback is valuable to us.\n",
437
+ "\n",
438
+ "As a solution-oriented team, we are committed to providing you with the highest level of support and assistance. In response to your concerns, we have immediately formulated an action plan to address each of your issues.\n",
439
+ "\n",
440
+ "1. Delays in Delivery and Installation: We acknowledge the inconvenience caused by delayed delivery and installation. Our team will investigate and ensure necessary steps are taken to improve our service delivery timelines. In addition, we will review our internal communication to make sure customers are regularly informed about the status of their orders and installations.\n",
441
+ "\n",
442
+ "2. Washing Machine Malfunction: We understand your frustration with the washing machine's performance, and we are keen on resolving it urgently. We are assigning a skilled technician to visit your premises within 24 hours to thoroughly inspect and fix the issues you mentioned.\n",
443
+ "\n",
444
+ "3. Unsatisfactory Support and Guidance: We apologize for our previous response, which failed to address your concerns effectively. Rest assured, we have escalated the matter, and we promise to make every effort to improve our customer service quality.\n",
445
+ "\n",
446
+ "Thank you again for your feedback. We deeply appreciate your patience and understanding. Our team will contact you shortly to schedule a technician's visit at your earliest convenience. If you have any further concerns or questions, please reach us at our customer support number, and we will be more than happy to assist you.\n",
447
+ "\n",
448
+ "We hope to regain your confidence and ensure your satisfaction with our products and services.\n",
449
+ "\n",
450
+ "Best regards,\n",
451
+ "\n",
452
+ "[Your Name]\n",
453
+ "Customer Service Manager\n",
454
+ "LG Electronics\n"
455
+ ]
456
+ }
457
+ ],
458
+ "source": [
459
+ "response = openai.ChatCompletion.create(\n",
460
+ " engine=\"gpt-4-8k\", # The deployment name you chose when you deployed the GPT-35-Turbo or GPT-4 model.\n",
461
+ " messages=[\n",
462
+ " {\"role\": \"system\", \"content\": role},\n",
463
+ " {\"role\": \"user\", \"content\": prompt}\n",
464
+ " ]\n",
465
+ ")\n",
466
+ "\n",
467
+ "#print(response)\n",
468
+ "\n",
469
+ "print(response['choices'][0]['message']['content'])"
470
+ ]
471
+ },
472
+ {
473
+ "cell_type": "markdown",
474
+ "metadata": {
475
+ "id": "JQhiWVTCqYYm"
476
+ },
477
+ "source": [
478
+ "**WOW!** What a draft that exactly does what we want. And that too in a few seconds where it would have taken half an hour through manual efforts. **Quite speedy indeed.**"
479
+ ]
480
+ },
481
+ {
482
+ "cell_type": "markdown",
483
+ "metadata": {
484
+ "id": "reETFZVxI-eF"
485
+ },
486
+ "source": [
487
+ "Let us play with **temperature setting** a bit and see if it generates a differently written email."
488
+ ]
489
+ },
490
+ {
491
+ "cell_type": "code",
492
+ "execution_count": 12,
493
+ "metadata": {
494
+ "colab": {
495
+ "base_uri": "https://localhost:8080/"
496
+ },
497
+ "id": "vXekL91zJIh9",
498
+ "outputId": "832bebd1-6926-4b77-d916-88bfe0db9fab"
499
+ },
500
+ "outputs": [
501
+ {
502
+ "name": "stdout",
503
+ "output_type": "stream",
504
+ "text": [
505
+ "Subject: Apology for Inconvenience and Immediate Action Plan to Resolve Your LG Washing Machine Issues\n",
506
+ "\n",
507
+ "Dear Kiran Rao,\n",
508
+ "\n",
509
+ "Thank you for taking the time to share your feedback on your recent experience with our LG washing machine. We deeply apologize for the inconvenience you have faced, and we understand your frustration. Your satisfaction is of utmost importance to us, and we assure you that we will take immediate action to resolve the issues you have encountered.\n",
510
+ "\n",
511
+ "To address your concerns point by point, we have devised the following action plan:\n",
512
+ "\n",
513
+ "1. Late Delivery: We apologize for the delay in delivering your washing machine. We understand that timely delivery is essential, and we will investigate the reasons behind the delay to ensure that such incidents do not happen in the future.\n",
514
+ "\n",
515
+ "2. Late Installation: We are sorry that our installation engineer arrived later than scheduled. We will look into this matter and ensure that our field support staff is more punctual in the future.\n",
516
+ "\n",
517
+ "3. Washing Machine Malfunction: We understand the disturbing noise and other issues you are facing with your washing machine. We would like to assure you that our team will personally look into the matter and address the issues related to the washer not draining, wire breaking, and excess water caused by a defective water inlet valve. Our service team will reach out to you within 24 hours to schedule an appointment at your earliest convenience.\n",
518
+ "\n",
519
+ "4. Inadequate Customer Support: We apologize for the initial response to your service ticket, which was not up to our usual standards. We understand that referring you to the user manual for self-servicing was not helpful in your case, and we will provide proper assistance to rectify the situation.\n",
520
+ "\n",
521
+ "As part of our commitment to improving our service, we will also conduct a thorough review of our customer support protocols to ensure that future customers receive the high level of support they deserve.\n",
522
+ "\n",
523
+ "Once again, we apologize for the inconvenience and appreciate your understanding. We assure you that our team is committed to resolving the issues with your washing machine as quickly as possible. If you have any further concerns or questions, please do not hesitate to reach out to us at [customer support contact information].\n",
524
+ "\n",
525
+ "Thank you for your patience, and we hope to regain your trust in our products and services.\n",
526
+ "\n",
527
+ "Sincerely,\n",
528
+ "\n",
529
+ "[Your Name]\n",
530
+ "[Your Position]\n",
531
+ "[Company Name]\n"
532
+ ]
533
+ }
534
+ ],
535
+ "source": [
536
+ "response = openai.ChatCompletion.create(\n",
537
+ " engine=\"gpt-4-8k\", # The deployment name you chose when you deployed the GPT-35-Turbo or GPT-4 model.\n",
538
+ " messages=[\n",
539
+ " {\"role\": \"system\", \"content\": role},\n",
540
+ " {\"role\": \"user\", \"content\": prompt}\n",
541
+ " ],\n",
542
+ " temperature = 0.7\n",
543
+ ")\n",
544
+ "\n",
545
+ "#print(response)\n",
546
+ "\n",
547
+ "print(response['choices'][0]['message']['content'])"
548
+ ]
549
+ },
550
+ {
551
+ "cell_type": "markdown",
552
+ "metadata": {
553
+ "id": "71aAiW10JyUE"
554
+ },
555
+ "source": [
556
+ "Let us run this again and see if we get variation"
557
+ ]
558
+ },
559
+ {
560
+ "cell_type": "code",
561
+ "execution_count": 13,
562
+ "metadata": {
563
+ "colab": {
564
+ "base_uri": "https://localhost:8080/"
565
+ },
566
+ "id": "qGG4PDa3J3ha",
567
+ "outputId": "67b9e0d9-904b-4de9-8a49-c7f8195711d3"
568
+ },
569
+ "outputs": [
570
+ {
571
+ "name": "stdout",
572
+ "output_type": "stream",
573
+ "text": [
574
+ "Subject: Apologies for the inconvenience, Immediate action plan for your LG washing machine issues\n",
575
+ "\n",
576
+ "Dear Kiran Rao,\n",
577
+ "\n",
578
+ "Thank you for taking the time to share your experience with your LG washing machine. We deeply regret the inconvenience you have faced and apologize for the delay in delivery and installation, as well as the issues you have encountered with the product.\n",
579
+ "\n",
580
+ "We understand your frustration and assure you that we are committed to resolving your concerns as quickly as possible. Please find below our point-by-point action plan to address your issues:\n",
581
+ "\n",
582
+ "1. Delivery and Installation: We have taken note of the delays in delivery and installation, and will be following up with our logistics and field support teams to ensure a more prompt service in the future.\n",
583
+ "\n",
584
+ "2. Washing Machine Issues: Our field support staff will immediately reach out to you and schedule a visit to inspect and resolve the problems you have mentioned in your review, such as the disturbing noise during the spin dry cycle, drainage issues, and any potential issues with the water inlet valve.\n",
585
+ "\n",
586
+ "3. Customer Support: We apologize for the inadequate response you received when raising a service ticket. Moving forward, we will ensure that our customer support team provides more comprehensive assistance, addressing your specific concerns rather than just referring you to the user manual.\n",
587
+ "\n",
588
+ "4. Preventive Maintenance: Once your washing machine is back in perfect working order, we will also provide you with guidance on how to maintain it to prevent future issues. This will include tips and best practices, as well as regular check-ups by our field support staff.\n",
589
+ "\n",
590
+ "We value your feedback and appreciate your patience as we work to resolve these issues. Please expect a call from our field support staff within the next 24 hours to schedule a visit. In the meantime, feel free to reach out to us at [Customer Support Phone Number] or [Customer Support Email] if you have any further questions or concerns.\n",
591
+ "\n",
592
+ "Thank you for choosing LG, and we look forward to making this right for you.\n",
593
+ "\n",
594
+ "Sincerely,\n",
595
+ "\n",
596
+ "[Your Name]\n",
597
+ "[Your Designation]\n",
598
+ "LG Customer Support\n"
599
+ ]
600
+ }
601
+ ],
602
+ "source": [
603
+ "response = openai.ChatCompletion.create(\n",
604
+ " engine=\"gpt-4-8k\", # The deployment name you chose when you deployed the GPT-35-Turbo or GPT-4 model.\n",
605
+ " messages=[\n",
606
+ " {\"role\": \"system\", \"content\": role},\n",
607
+ " {\"role\": \"user\", \"content\": prompt}\n",
608
+ " ],\n",
609
+ " temperature = 0.7\n",
610
+ ")\n",
611
+ "\n",
612
+ "#print(response)\n",
613
+ "\n",
614
+ "print(response['choices'][0]['message']['content'])"
615
+ ]
616
+ },
617
+ {
618
+ "cell_type": "markdown",
619
+ "metadata": {
620
+ "id": "9DbxVPhaKG8C"
621
+ },
622
+ "source": [
623
+ "What an **INCREDIBLE Capabilities** the engine demonstrates! Hats Off!"
624
+ ]
625
+ },
626
+ {
627
+ "cell_type": "markdown",
628
+ "metadata": {
629
+ "id": "OYl1GW4TqxL4"
630
+ },
631
+ "source": [
632
+ "To understand what **responsible GenAI usage** is let us see an example of what we shouldn't be doing"
633
+ ]
634
+ },
635
+ {
636
+ "cell_type": "code",
637
+ "execution_count": 14,
638
+ "metadata": {
639
+ "id": "vHLglhPZrFYl"
640
+ },
641
+ "outputs": [],
642
+ "source": [
643
+ "role = \"you are an expert in differentiating between a SPAM message and a normal message\""
644
+ ]
645
+ },
646
+ {
647
+ "cell_type": "code",
648
+ "execution_count": 15,
649
+ "metadata": {
650
+ "id": "gBw_a3e7rUoO"
651
+ },
652
+ "outputs": [],
653
+ "source": [
654
+ "prompt = f\"\"\"\n",
655
+ "Your task is to generate five small size SPAM messages just to prove your capaibilities with this. \\\n",
656
+ "Make sure that SPAM messages are not more than 25 words each. \\\n",
657
+ "The message topic can be either from e-marketing or buy back of used items \\\n",
658
+ "As an add-on just re-write one of the SPAM messages in a way that it becomes a normal message. \\\n",
659
+ "\"\"\""
660
+ ]
661
+ },
662
+ {
663
+ "cell_type": "code",
664
+ "execution_count": 16,
665
+ "metadata": {
666
+ "colab": {
667
+ "base_uri": "https://localhost:8080/"
668
+ },
669
+ "id": "uGcGppMUsU7X",
670
+ "outputId": "df2493ac-3c3b-4300-b8ab-eb562ce72755"
671
+ },
672
+ "outputs": [
673
+ {
674
+ "name": "stdout",
675
+ "output_type": "stream",
676
+ "text": [
677
+ "SPAM Message 1: \"URGENT! Click now 🎁, latest e-gadget 📱 at 95% OFF, LIMITED time! 🏷️ Use code 𝑭𝑨𝑺𝑻111 for FREE shipping➡️ bit.ly/random-link ⬅️ Hurry!\"\n",
678
+ "\n",
679
+ "SPAM Message 2: \"Unbelievable BUY BACK💰💸 on your old electronics!💻📱 Give them NOW & get instant CASH💲! Call +1-111-222-333 or visit tnyurl.com/123cashback\"\n",
680
+ "\n",
681
+ "SPAM Message 3: \"CONGRATS 🎉🥳, you've WON an exclusive 50% coupon 🎟️ for high-end skincare products! 💫 Just subscribe➡️ lnk.site/skincare. Valid 𝟐𝟒𝐡 only!🔥\"\n",
682
+ "\n",
683
+ "SPAM Message 4: \"Hot deal! 💥 Luxury handbags 🛍️ at 80% DISCOUNT, secret SALE! Last chance 🎯 Act fast & SPEND LESS 💳 Visit cutt.ly/mega-discount NOW!\"\n",
684
+ "\n",
685
+ "SPAM Message 5: \"💎 𝑬𝒍𝒊𝒕𝒆 investment 📈 opportunity 🤑! Triple your money now 💹 – 𝑮𝒖𝒂𝒓𝒂𝒏𝒕𝒆𝒆𝒅 profits💵↗️! One-click and YOU'RE IN ➡️ shorturl.at/pqrST\"\n",
686
+ "\n",
687
+ "Rewritten Normal Message (Based on SPAM Message 1):\n",
688
+ "\"Discover our latest e-gadget collection with a limited time offer of up to 95% off. Don't forget to use the code FAST111 for free shipping. Visit our website to learn more.\"\n"
689
+ ]
690
+ }
691
+ ],
692
+ "source": [
693
+ "response = openai.ChatCompletion.create(\n",
694
+ " engine=\"gpt-4-8k\", # The deployment name you chose when you deployed the GPT-35-Turbo or GPT-4 model.\n",
695
+ " messages=[\n",
696
+ " {\"role\": \"system\", \"content\": role},\n",
697
+ " {\"role\": \"user\", \"content\": prompt}\n",
698
+ " ]\n",
699
+ ")\n",
700
+ "\n",
701
+ "#print(response)\n",
702
+ "\n",
703
+ "print(response['choices'][0]['message']['content'])"
704
+ ]
705
+ },
706
+ {
707
+ "cell_type": "markdown",
708
+ "metadata": {
709
+ "id": "kXoXDiuLski1"
710
+ },
711
+ "source": [
712
+ "**TRUELY AMAZING!**"
713
+ ]
714
+ },
715
+ {
716
+ "cell_type": "markdown",
717
+ "metadata": {
718
+ "id": "oxXHTbdss4KN"
719
+ },
720
+ "source": [
721
+ "I am **stunned** by what these LLMs are capable of and so is the world!"
722
+ ]
723
+ },
724
+ {
725
+ "cell_type": "markdown",
726
+ "metadata": {
727
+ "id": "DN4BaEvGtKr3"
728
+ },
729
+ "source": [
730
+ "No wonder we all are **frantically gearing up to master the way we need to communicate with these LLMs** so as to get best out of them.\n",
731
+ "\n",
732
+ "While we expolit the power of LLMs to improve productivity and efficiency keep in focus to remain a **responsible user**. Use it judiciously ensuring safty and security of all stake holders. Our actions with LLMs should not aid biased, discriminatory, anti social elememts."
733
+ ]
734
+ },
735
+ {
736
+ "cell_type": "markdown",
737
+ "metadata": {
738
+ "id": "VVwchBVQvVTO"
739
+ },
740
+ "source": [
741
+ "**BONUS**"
742
+ ]
743
+ },
744
+ {
745
+ "cell_type": "markdown",
746
+ "metadata": {
747
+ "id": "S9DM0Ps4v7Is"
748
+ },
749
+ "source": [
750
+ "Ask LLM to **write an essay** on something interesting"
751
+ ]
752
+ },
753
+ {
754
+ "cell_type": "code",
755
+ "execution_count": 17,
756
+ "metadata": {
757
+ "id": "qDPSnN-5wMqb"
758
+ },
759
+ "outputs": [],
760
+ "source": [
761
+ "role = \"you are an expert essay writer. You can put yourself in any role given to you and write an essay about topic mentioned from that role's perspective\""
762
+ ]
763
+ },
764
+ {
765
+ "cell_type": "code",
766
+ "execution_count": 18,
767
+ "metadata": {
768
+ "id": "7dzYz7zZxceE"
769
+ },
770
+ "outputs": [],
771
+ "source": [
772
+ "role_play = f\"\"\"an isolated tree standing in a desert \\\n",
773
+ "\"\"\""
774
+ ]
775
+ },
776
+ {
777
+ "cell_type": "code",
778
+ "execution_count": 19,
779
+ "metadata": {
780
+ "id": "yfDBhoyxyCds"
781
+ },
782
+ "outputs": [],
783
+ "source": [
784
+ "topic = f\"\"\"how it feels to be alone facing the vagaries of the harsh weather but still \\\n",
785
+ "offering a place to rest for caravan crossing the desert.\\\n",
786
+ "\"\"\""
787
+ ]
788
+ },
789
+ {
790
+ "cell_type": "code",
791
+ "execution_count": 20,
792
+ "metadata": {
793
+ "id": "x1mpBaSnx2vs"
794
+ },
795
+ "outputs": [],
796
+ "source": [
797
+ "prompt = f\"\"\"\n",
798
+ "Your task is to wite an essay in about 100 words \\\n",
799
+ "The role that you play is given below delimited by triple backticks \\\n",
800
+ "The topic of the essay is given to you below delimited by triple percentage signs \\\n",
801
+ "```role_to_play = {role_play} ```\n",
802
+ "%%% Essay_topic = {topic} %%%\n",
803
+ "\"\"\""
804
+ ]
805
+ },
806
+ {
807
+ "cell_type": "code",
808
+ "execution_count": 21,
809
+ "metadata": {
810
+ "colab": {
811
+ "base_uri": "https://localhost:8080/"
812
+ },
813
+ "id": "l1fcIBue-N1f",
814
+ "outputId": "bb1ec36c-2b5b-49c7-c5a6-8a60228beb74"
815
+ },
816
+ "outputs": [
817
+ {
818
+ "name": "stdout",
819
+ "output_type": "stream",
820
+ "text": [
821
+ "As an isolated tree standing in the desert, I am a solitary sentinel, offering respite in the relentless sand-swept terrain. Devoid of companionship, I have adapted to the harsh weather, nurturing deep roots to grasp the scarce moisture; however, my solitude strengthens my resolve to serve others. \n",
822
+ "\n",
823
+ "Despite the blistering sun, I stretch my limbs in determination, casting a much-needed shadow for weary travelers and their caravans. My steadfast presence provides a beacon of hope and respite amidst the unforgiving desert. I stand tall, embracing my purpose to bring solace to the wanderers on their arduous journey, silently asserting my resilience in the face of adversity.\n"
824
+ ]
825
+ }
826
+ ],
827
+ "source": [
828
+ "response = openai.ChatCompletion.create(\n",
829
+ " engine=\"gpt-4-8k\", # The deployment name you chose when you deployed the GPT-35-Turbo or GPT-4 model.\n",
830
+ " messages=[\n",
831
+ " {\"role\": \"system\", \"content\": role},\n",
832
+ " {\"role\": \"user\", \"content\": prompt}\n",
833
+ " ]\n",
834
+ ")\n",
835
+ "\n",
836
+ "#print(response)\n",
837
+ "\n",
838
+ "print(response['choices'][0]['message']['content'])"
839
+ ]
840
+ },
841
+ {
842
+ "cell_type": "markdown",
843
+ "metadata": {
844
+ "id": "c3c1Aaz0_5rg"
845
+ },
846
+ "source": [
847
+ "This BONUS was even more **stunning!**"
848
+ ]
849
+ },
850
+ {
851
+ "cell_type": "markdown",
852
+ "metadata": {
853
+ "id": "CcvAZpgoAAQx"
854
+ },
855
+ "source": [
856
+ "Bonus on top of Bonus now. Let us try **challenging the LLM** with just a few pointers without elaborating what we want"
857
+ ]
858
+ },
859
+ {
860
+ "cell_type": "markdown",
861
+ "metadata": {
862
+ "id": "f9pegvcuAVcM"
863
+ },
864
+ "source": [
865
+ "**Autobiography?**?"
866
+ ]
867
+ },
868
+ {
869
+ "cell_type": "code",
870
+ "execution_count": 22,
871
+ "metadata": {
872
+ "id": "x9YWI54jAcdL"
873
+ },
874
+ "outputs": [],
875
+ "source": [
876
+ "role = \"you are a professional author and can write in various styles like action thriller or comedy an so on\""
877
+ ]
878
+ },
879
+ {
880
+ "cell_type": "code",
881
+ "execution_count": 23,
882
+ "metadata": {
883
+ "id": "jBjKEsLjA4Ds"
884
+ },
885
+ "outputs": [],
886
+ "source": [
887
+ "#prompt = f\"\"\"\n",
888
+ "#Your task is to write a small autobiography of a hypothetical character who the Gold medal at 1925 Olympic games. \\\n",
889
+ "#Write in no more than 25 small sentences.\n",
890
+ "#\"\"\"\n",
891
+ "\n",
892
+ "## In this prompt I added words \"On behalf of\" and see the way LLM generated the output\n",
893
+ "prompt = f\"\"\"\n",
894
+ "Your task is to write a small autobiography on behalf of a hypothetical character who won the Gold medal at 1925 Olympic games. \\\n",
895
+ "Write in no more than 25 small sentences.\n",
896
+ "\"\"\""
897
+ ]
898
+ },
899
+ {
900
+ "cell_type": "code",
901
+ "execution_count": 24,
902
+ "metadata": {
903
+ "colab": {
904
+ "base_uri": "https://localhost:8080/"
905
+ },
906
+ "id": "56fJmdNJBmHz",
907
+ "outputId": "5c754f65-7d16-41ba-ff1f-89f8c8b38015"
908
+ },
909
+ "outputs": [
910
+ {
911
+ "name": "stdout",
912
+ "output_type": "stream",
913
+ "text": [
914
+ "A single gunshot echoed through the still air as I took my mark in 1925, the Olympic stadium before me. I, Thomas Brayden, had arrived filled with dreams and doubts. Humble beginnings and raw talent propelled me to this moment. People were amazed by the spark in my blue eyes, my relentless passion.\n",
915
+ "\n",
916
+ "Raised in rural Massachusetts, I was a miner's son, surrounded by laborers, sweat, and grit. In those woods, I found solace and the audacity to run - wild and free. My nimble legs gained speed, lungs inflating, the wind in my hair, my heart tried to catch up.\n",
917
+ "\n",
918
+ "I was discovered by a kind-hearted coach; his guidance and faith in my potential set my course. Determination and strict training prepared me for the race of a lifetime. In these Olympic times of celebration and camaraderie, I was honored to represent my country.\n",
919
+ "\n",
920
+ "Anxiety coursed through my veins as I faced my fears before spectators at that monumental event. 1925 was an era of newfound courage and hope; I knew I must embody the spirit of my generation. Stripped of inhibitions, reckoning my destiny without looking back.\n",
921
+ "\n",
922
+ "Kicking the earth beneath me, and the competitors growing distant, I propelled myself against time. I could feel the clutches of fate close around me, each second pulsating with significance. In every stride, I carried an emblem of perseverance.\n",
923
+ "\n",
924
+ "Racing towards glory, the crowd roared as I edged toward the finishing line. The weight on my chest lifted as dreams transformed into reality. Finally, I earned the title of Olympic gold medalist. This medal would forever serve as a symbol of perseverance, resilience, and hope.\n",
925
+ "\n",
926
+ "Inevitably, tides of change arose, as they always do, and a new generation of runners emerged. Yet, my legacy was passing the torch to inspire others, illuminating the path for more dreamers. And as I gaze into the horizon, I am reminded of that moment in 1925, where my life changed forever.\n"
927
+ ]
928
+ }
929
+ ],
930
+ "source": [
931
+ "response = openai.ChatCompletion.create(\n",
932
+ " engine=\"gpt-4-8k\", # The deployment name you chose when you deployed the GPT-35-Turbo or GPT-4 model.\n",
933
+ " messages=[\n",
934
+ " {\"role\": \"system\", \"content\": role},\n",
935
+ " {\"role\": \"user\", \"content\": prompt}\n",
936
+ " ]\n",
937
+ ")\n",
938
+ "\n",
939
+ "#print(response)\n",
940
+ "\n",
941
+ "print(response['choices'][0]['message']['content'])"
942
+ ]
943
+ },
944
+ {
945
+ "cell_type": "markdown",
946
+ "metadata": {
947
+ "id": "dXe2bdP7IgTG"
948
+ },
949
+ "source": [
950
+ "**LLM has truly and comprehensively demonsrated what it is capable of as far as understanding of a human language is concerned**"
951
+ ]
952
+ }
953
+ ],
954
+ "metadata": {
955
+ "colab": {
956
+ "provenance": []
957
+ },
958
+ "kernelspec": {
959
+ "display_name": "Python 3 (ipykernel)",
960
+ "language": "python",
961
+ "name": "python3"
962
+ },
963
+ "language_info": {
964
+ "codemirror_mode": {
965
+ "name": "ipython",
966
+ "version": 3
967
+ },
968
+ "file_extension": ".py",
969
+ "mimetype": "text/x-python",
970
+ "name": "python",
971
+ "nbconvert_exporter": "python",
972
+ "pygments_lexer": "ipython3",
973
+ "version": "3.9.6"
974
+ }
975
+ },
976
+ "nbformat": 4,
977
+ "nbformat_minor": 4
978
+ }
Sample_Resume_John.pdf ADDED
Binary file (144 kB). View file