File size: 26,777 Bytes
00eef43
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Welcome to the start of your adventure in Agentic AI"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<table style=\"margin: 0; text-align: left; width:100%\">\n",
    "    <tr>\n",
    "        <td style=\"width: 150px; height: 150px; vertical-align: middle;\">\n",
    "            <img src=\"../assets/stop.png\" width=\"150\" height=\"150\" style=\"display: block;\" />\n",
    "        </td>\n",
    "        <td>\n",
    "            <h2 style=\"color:#ff7800;\">Are you ready for action??</h2>\n",
    "            <span style=\"color:#ff7800;\">Have you completed all the setup steps in the <a href=\"../setup/\">setup</a> folder?<br/>\n",
    "            Have you read the <a href=\"../README.md\">README</a>? Many common questions are answered here!<br/>\n",
    "            Have you checked out the guides in the <a href=\"../guides/01_intro.ipynb\">guides</a> folder?<br/>\n",
    "            Well in that case, you're ready!!\n",
    "            </span>\n",
    "        </td>\n",
    "    </tr>\n",
    "</table>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<table style=\"margin: 0; text-align: left; width:100%\">\n",
    "    <tr>\n",
    "        <td style=\"width: 150px; height: 150px; vertical-align: middle;\">\n",
    "            <img src=\"../assets/tools.png\" width=\"150\" height=\"150\" style=\"display: block;\" />\n",
    "        </td>\n",
    "        <td>\n",
    "            <h2 style=\"color:#00bfff;\">This code is a live resource - keep an eye out for my updates</h2>\n",
    "            <span style=\"color:#00bfff;\">I push updates regularly. As people ask questions or have problems, I add more examples and improve explanations. As a result, the code below might not be identical to the videos, as I've added more steps and better comments. Consider this like an interactive book that accompanies the lectures.<br/><br/>\n",
    "            I try to send emails regularly with important updates related to the course. You can find this in the 'Announcements' section of Udemy in the left sidebar. You can also choose to receive my emails via your Notification Settings in Udemy. I'm respectful of your inbox and always try to add value with my emails!\n",
    "            </span>\n",
    "        </td>\n",
    "    </tr>\n",
    "</table>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### And please do remember to contact me if I can help\n",
    "\n",
    "And I love to connect: https://www.linkedin.com/in/eddonner/\n",
    "\n",
    "\n",
    "### New to Notebooks like this one? Head over to the guides folder!\n",
    "\n",
    "Just to check you've already added the Python and Jupyter extensions to Cursor, if not already installed:\n",
    "- Open extensions (View >> extensions)\n",
    "- Search for python, and when the results show, click on the ms-python one, and Install it if not already installed\n",
    "- Search for jupyter, and when the results show, click on the Microsoft one, and Install it if not already installed  \n",
    "Then View >> Explorer to bring back the File Explorer.\n",
    "\n",
    "And then:\n",
    "1. Click where it says \"Select Kernel\" near the top right, and select the option called `.venv (Python 3.12.9)` or similar, which should be the first choice or the most prominent choice. You may need to choose \"Python Environments\" first.\n",
    "2. Click in each \"cell\" below, starting with the cell immediately below this text, and press Shift+Enter to run\n",
    "3. Enjoy!\n",
    "\n",
    "After you click \"Select Kernel\", if there is no option like `.venv (Python 3.12.9)` then please do the following:  \n",
    "1. On Mac: From the Cursor menu, choose Settings >> VS Code Settings (NOTE: be sure to select `VSCode Settings` not `Cursor Settings`);  \n",
    "On Windows PC: From the File menu, choose Preferences >> VS Code Settings(NOTE: be sure to select `VSCode Settings` not `Cursor Settings`)  \n",
    "2. In the Settings search bar, type \"venv\"  \n",
    "3. In the field \"Path to folder with a list of Virtual Environments\" put the path to the project root, like C:\\Users\\username\\projects\\agents (on a Windows PC) or /Users/username/projects/agents (on Mac or Linux).  \n",
    "And then try again.\n",
    "\n",
    "Having problems with missing Python versions in that list? Have you ever used Anaconda before? It might be interferring. Quit Cursor, bring up a new command line, and make sure that your Anaconda environment is deactivated:    \n",
    "`conda deactivate`  \n",
    "And if you still have any problems with conda and python versions, it's possible that you will need to run this too:  \n",
    "`conda config --set auto_activate_base false`  \n",
    "and then from within the Agents directory, you should be able to run `uv python list` and see the Python 3.12 version."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "# First let's do an import. If you get an Import Error, double check that your Kernel is correct..\n",
    "\n",
    "from dotenv import load_dotenv"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Next it's time to load the API keys into environment variables\n",
    "# If this returns false, see the next cell!\n",
    "\n",
    "load_dotenv(override=True)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Wait, did that just output `False`??\n",
    "\n",
    "If so, the most common reason is that you didn't save your `.env` file after adding the key! Be sure to have saved.\n",
    "\n",
    "Also, make sure the `.env` file is named precisely `.env` and is in the project root directory (`agents`)\n",
    "\n",
    "By the way, your `.env` file should have a stop symbol next to it in Cursor on the left, and that's actually a good thing: that's Cursor saying to you, \"hey, I realize this is a file filled with secret information, and I'm not going to send it to an external AI to suggest changes, because your keys should not be shown to anyone else.\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<table style=\"margin: 0; text-align: left; width:100%\">\n",
    "    <tr>\n",
    "        <td style=\"width: 150px; height: 150px; vertical-align: middle;\">\n",
    "            <img src=\"../assets/stop.png\" width=\"150\" height=\"150\" style=\"display: block;\" />\n",
    "        </td>\n",
    "        <td>\n",
    "            <h2 style=\"color:#ff7800;\">Final reminders</h2>\n",
    "            <span style=\"color:#ff7800;\">1. If you're not confident about Environment Variables or Web Endpoints / APIs, please read Topics 3 and 5 in this <a href=\"../guides/04_technical_foundations.ipynb\">technical foundations guide</a>.<br/>\n",
    "            2. If you want to use AIs other than OpenAI, like Gemini, DeepSeek or Ollama (free), please see the first section in this <a href=\"../guides/09_ai_apis_and_ollama.ipynb\">AI APIs guide</a>.<br/>\n",
    "            3. If you ever get a Name Error in Python, you can always fix it immediately; see the last section of this <a href=\"../guides/06_python_foundations.ipynb\">Python Foundations guide</a> and follow both tutorials and exercises.<br/>\n",
    "            </span>\n",
    "        </td>\n",
    "    </tr>\n",
    "</table>"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "OpenAI API Key exists and begins sk-proj-\n"
     ]
    }
   ],
   "source": [
    "# Check the key - if you're not using OpenAI, check whichever key you're using! Ollama doesn't need a key.\n",
    "\n",
    "import os\n",
    "openai_api_key = os.getenv('OPENAI_API_KEY')\n",
    "\n",
    "if openai_api_key:\n",
    "    print(f\"OpenAI API Key exists and begins {openai_api_key[:8]}\")\n",
    "else:\n",
    "    print(\"OpenAI API Key not set - please head to the troubleshooting guide in the setup folder\")\n",
    "    \n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "# And now - the all important import statement\n",
    "# If you get an import error - head over to troubleshooting in the Setup folder\n",
    "# Even for other LLM providers like Gemini, you still use this OpenAI import - see Guide 9 for why\n",
    "\n",
    "from openai import OpenAI"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "# And now we'll create an instance of the OpenAI class\n",
    "# If you're not sure what it means to create an instance of a class - head over to the guides folder (guide 6)!\n",
    "# If you get a NameError - head over to the guides folder (guide 6)to learn about NameErrors - always instantly fixable\n",
    "# If you're not using OpenAI, you just need to slightly modify this - precise instructions are in the AI APIs guide (guide 9)\n",
    "\n",
    "openai = OpenAI()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Create a list of messages in the familiar OpenAI format\n",
    "\n",
    "messages = [{\"role\": \"user\", \"content\": \"What is 2+2?\"}]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "2 + 2 equals 4.\n"
     ]
    }
   ],
   "source": [
    "# And now call it! Any problems, head to the troubleshooting guide\n",
    "# This uses GPT 4.1 nano, the incredibly cheap model\n",
    "# The APIs guide (guide 9) has exact instructions for using even cheaper or free alternatives to OpenAI\n",
    "# If you get a NameError, head to the guides folder (guide 6) to learn about NameErrors - always instantly fixable\n",
    "\n",
    "response = openai.chat.completions.create(\n",
    "    model=\"gpt-4.1-nano\",\n",
    "    messages=messages\n",
    ")\n",
    "\n",
    "print(response.choices[0].message.content)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "# And now - let's ask for a question:\n",
    "\n",
    "question = \"Please propose a hard, challenging question to assess someone's IQ. Respond only with the question.\"\n",
    "messages = [{\"role\": \"user\", \"content\": question}]\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# ask it - this uses GPT 4.1 mini, still cheap but more powerful than nano\n",
    "\n",
    "response = openai.chat.completions.create(\n",
    "    model=\"gpt-4.1-mini\",\n",
    "    messages=messages\n",
    ")\n",
    "\n",
    "question = response.choices[0].message.content\n",
    "\n",
    "print(question)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [],
   "source": [
    "# form a new messages list\n",
    "messages = [{\"role\": \"user\", \"content\": question}]\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Ask it again\n",
    "\n",
    "response = openai.chat.completions.create(\n",
    "    model=\"gpt-4.1-mini\",\n",
    "    messages=messages\n",
    ")\n",
    "\n",
    "answer = response.choices[0].message.content\n",
    "print(answer)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from IPython.display import Markdown, display\n",
    "\n",
    "display(Markdown(answer))\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Congratulations!\n",
    "\n",
    "That was a small, simple step in the direction of Agentic AI, with your new environment!\n",
    "\n",
    "Next time things get more interesting..."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<table style=\"margin: 0; text-align: left; width:100%\">\n",
    "    <tr>\n",
    "        <td style=\"width: 150px; height: 150px; vertical-align: middle;\">\n",
    "            <img src=\"../assets/exercise.png\" width=\"150\" height=\"150\" style=\"display: block;\" />\n",
    "        </td>\n",
    "        <td>\n",
    "            <h2 style=\"color:#ff7800;\">Exercise</h2>\n",
    "            <span style=\"color:#ff7800;\">Now try this commercial application:<br/>\n",
    "            First ask the LLM to pick a business area that might be worth exploring for an Agentic AI opportunity.<br/>\n",
    "            Then ask the LLM to present a pain-point in that industry - something challenging that might be ripe for an Agentic solution.<br/>\n",
    "            Finally have 3 third LLM call propose the Agentic AI solution. <br/>\n",
    "            We will cover this at up-coming labs, so don't worry if you're unsure.. just give it a try!\n",
    "            </span>\n",
    "        </td>\n",
    "    </tr>\n",
    "</table>"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Helper function to create bilingual messages\n",
    "def create_bilingual_messages(user_content):\n",
    "    \"\"\"\n",
    "    Creates a messages list with system prompt for bilingual (Korean/English) responses\n",
    "    \"\"\"\n",
    "    return [\n",
    "        {\n",
    "            \"role\": \"system\", \n",
    "            \"content\": \"You must always respond in both Korean and English. Provide your answer in Korean first, then provide the same answer in English. Use clear section headers like '### ν•œκ΅­μ–΄:' and '### English:' to separate the languages.\"\n",
    "        },\n",
    "        {\n",
    "            \"role\": \"user\", \n",
    "            \"content\": user_content\n",
    "        }\n",
    "    ]\n",
    "\n",
    "# Example usage:\n",
    "# messages = create_bilingual_messages(\"Your question here\")\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/markdown": [
       "### ν•œκ΅­μ–΄:  \n",
       "WPT(무선 μ „λ ₯ 전솑) λΆ„μ•Όμ—μ„œ 에이전틱 AI(Agentic AI, 자율적 인곡지λŠ₯) κΈ°νšŒκ°€ μžˆμ„ λ§Œν•œ λΉ„μ¦ˆλ‹ˆμŠ€ μ˜μ—­ 쀑 ν•˜λ‚˜λŠ” **슀마트 μ „λ ₯ λ„€νŠΈμ›Œν¬ μ΅œμ ν™” 및 관리**μž…λ‹ˆλ‹€.\n",
       "\n",
       "무선 μ „λ ₯ 전솑 μ‹œμŠ€ν…œμ€ μ—¬λŸ¬ μž₯μΉ˜μ— λΉ„νš¨μœ¨ 없이 μ „λ ₯을 λΆ„λ°°ν•˜λŠ” 것이 μ€‘μš”ν•©λ‹ˆλ‹€. 에이전틱 AIλŠ” μ‹€μ‹œκ°„μœΌλ‘œ μ—¬λŸ¬ μ„Όμ„œμ™€ λ””λ°”μ΄μŠ€ 데이터λ₯Ό λΆ„μ„ν•˜μ—¬ 졜적의 μ „λ ₯ λ°°λΆ„, λ„€νŠΈμ›Œν¬ μž₯μ•  감지, 예츑적 μœ μ§€λ³΄μˆ˜, 그리고 동적 ν™˜κ²½ 변화에 λ”°λ₯Έ 효율적인 μ „λ ₯ 쑰절 등을 자율적으둜 μˆ˜ν–‰ν•  수 μžˆμŠ΅λ‹ˆλ‹€. 특히 슀마트 μ‹œν‹°, IoT λ””λ°”μ΄μŠ€ ν˜Ήμ€ μ „κΈ°μ°¨ μΆ©μ „ μΈν”„λΌμ—μ„œ 무선 μ „λ ₯ 전솑 λ„€νŠΈμ›Œν¬μ˜ νš¨μœ¨μ„±μ„ κ·ΉλŒ€ν™”ν•˜λŠ” 데 큰 역할을 ν•  수 μžˆμŠ΅λ‹ˆλ‹€.\n",
       "\n",
       "이외에도 에이전틱 AIκ°€ WPT 및 κ΄€λ ¨ μΈν”„λΌμ˜ λ³΄μ•ˆ κ°•ν™”, μ‚¬μš©μž 맞좀 μ „λ ₯ μ„œλΉ„μŠ€ 제곡, μ—λ„ˆμ§€ μ†ŒλΉ„ νŒ¨ν„΄ 뢄석 및 μ΅œμ ν™” λ“± λ‹€μ–‘ν•œ μ˜μ—­μ—μ„œ ν˜μ‹ μ„ 이끌 수 μžˆμŠ΅λ‹ˆλ‹€.\n",
       "\n",
       "### English:  \n",
       "One promising business area in the WPT (Wireless Power Transmission) field for an Agentic AI opportunity is **smart power network optimization and management**.\n",
       "\n",
       "Wireless power transmission systems require efficient distribution of power across multiple devices. Agentic AI can autonomously analyze real-time data from various sensors and devices to optimize power allocation, detect network faults, perform predictive maintenance, and dynamically adjust power flow according to environmental changes. This is particularly valuable in smart cities, IoT devices, or electric vehicle charging infrastructures, where maximizing the efficiency of wireless power networks is critical.\n",
       "\n",
       "Additionally, Agentic AI can drive innovation in WPT by enhancing security of wireless power systems and infrastructure, delivering personalized power services to users, and optimizing energy consumption patterns among other possibilities."
      ],
      "text/plain": [
       "<IPython.core.display.Markdown object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# First create the messages:\n",
    "\n",
    "messages = create_bilingual_messages(\"Pick a business area in WPT (Wireless power transmission) field that might worth exploring for an Agentic AI opportunity.\")\n",
    "\n",
    "# Then make the first call:\n",
    "\n",
    "response = openai.chat.completions.create(\n",
    "    model=\"gpt-4.1-mini\",\n",
    "    messages=messages\n",
    ")\n",
    "\n",
    "# Then read the business idea:\n",
    "\n",
    "business_idea = response.choices[0].message.content\n",
    "\n",
    "display(Markdown(business_idea))\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/markdown": [
       "### ν•œκ΅­μ–΄:  \n",
       "WPT(무선 μ „λ ₯ 전솑) λΆ„μ•Όμ—μ„œ μ€‘μš”ν•œ 페인 포인트 쀑 ν•˜λ‚˜λŠ” **λ³΅μž‘ν•œ 닀쀑 μž₯치 μ „λ ₯ λΆ„λ°°μ˜ μ‹€μ‹œκ°„ μ΅œμ ν™”μ™€ μž₯μ•  λŒ€μ‘μ˜ 어렀움**μž…λ‹ˆλ‹€.  \n",
       "무선 μ „λ ₯ λ„€νŠΈμ›Œν¬κ°€ μ—¬λŸ¬ λ””λ°”μ΄μŠ€μ— λ™μ‹œμ— μ „λ ₯을 곡급할 λ•Œ, 각 μž₯치의 μ „λ ₯ μš”κ΅¬λŸ‰κ³Ό λ„€νŠΈμ›Œν¬ μƒνƒœκ°€ μ§€μ†μ μœΌλ‘œ λ³€ν•˜κΈ° λ•Œλ¬Έμ— μ „λ ₯ λΆ„λ°°μ˜ νš¨μœ¨μ„±μ„ μœ μ§€ν•˜κΈ° μ–΄λ ΅μŠ΅λ‹ˆλ‹€. λ˜ν•œ, λ„€νŠΈμ›Œν¬ λ‚΄ μž‘μ€ 이상 μ‹ ν˜Έλ‚˜ μž₯μ• λ₯Ό λΉ λ₯΄κ²Œ κ°μ§€ν•˜κ³  λŒ€μ‘ν•˜μ§€ λͺ»ν•˜λ©΄ μ „λ ₯ λ‚­λΉ„λ‚˜ μ„œλΉ„μŠ€ μ€‘λ‹¨μœΌλ‘œ μ΄μ–΄μ§€λŠ” μœ„ν—˜μ΄ ν½λ‹ˆλ‹€.  \n",
       "이 λ¬Έμ œλŠ” 특히 IoTκ°€ ν™•λŒ€λ˜κ³ , μ „κΈ°μ°¨ μΆ©μ „ 및 슀마트 μ‹œν‹° 인프라가 λ³΅μž‘ν•΄μ§ˆμˆ˜λ‘ λ”μš± 심각해지며, μˆ˜λ™μ μΈ 관리 μ²΄κ³„λ‘œλŠ” ν•œκ³„κ°€ μžˆμŠ΅λ‹ˆλ‹€.\n",
       "\n",
       "에이전틱 AIλŠ” μ΄λŸ¬ν•œ μƒν™©μ—μ„œ μ‹€μ‹œκ°„ 데이터λ₯Ό 자율적으둜 λΆ„μ„ν•˜κ³ , 동적 ν™˜κ²½ 변화에 맞좰 졜적의 μ „λ ₯ λΆ„λ°° μ „λž΅μ„ μ‹€ν–‰ν•˜λ©°, μž₯μ• λ₯Ό 쑰기에 κ°μ§€ν•˜μ—¬ 예츑 κ°€λŠ₯ν•œ μœ μ§€λ³΄μˆ˜λ₯Ό κ°€λŠ₯ν•˜κ²Œ ν•  수 μžˆμŠ΅λ‹ˆλ‹€.\n",
       "\n",
       "### English:  \n",
       "A major pain point in the WPT (Wireless Power Transmission) industry is **the difficulty of real-time optimization and fault response in complex multi-device power distribution**.  \n",
       "When wireless power networks supply power to multiple devices simultaneously, the power demands and network conditions of each device continuously fluctuate, making it challenging to maintain efficient power allocation. Additionally, failure to promptly detect and address minor anomalies or faults within the network can lead to power wastage or service interruptions.  \n",
       "This issue becomes increasingly critical as IoT expands, electric vehicle charging and smart city infrastructures become more complex, and purely manual management systems reach their limits.\n",
       "\n",
       "Agentic AI can autonomously analyze real-time data in such situations, execute optimal power distribution strategies adapted to dynamic environmental changes, and detect faults early enough to enable predictive maintenance."
      ],
      "text/plain": [
       "<IPython.core.display.Markdown object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# ask the LLM to propose a pain-point in the given industry\n",
    "\n",
    "messages = create_bilingual_messages(f\"Please propose a pain-point in the given industry: {business_idea}\")\n",
    "\n",
    "response = openai.chat.completions.create(\n",
    "    model=\"gpt-4.1-mini\",\n",
    "    messages=messages)\n",
    "\n",
    "pain_point = response.choices[0].message.content\n",
    "\n",
    "display(Markdown(pain_point))\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/markdown": [
       "### ν•œκ΅­μ–΄:  \n",
       "Agentic AI μ†”λ£¨μ…˜ μ œμ•ˆ:  \n",
       "\n",
       "1. **μ‹€μ‹œκ°„ 데이터 톡합 및 뢄석 μ—μ΄μ „νŠΈ**  \n",
       "닀쀑 μ„Όμ„œμ™€ IoT λ””λ°”μ΄μŠ€λ‘œλΆ€ν„° μ „λ ₯ μ‚¬μš©λŸ‰, ν™˜κ²½ μƒνƒœ, λ„€νŠΈμ›Œν¬ μƒνƒœ 데이터λ₯Ό μˆ˜μ§‘ν•˜λŠ” μ—μ΄μ „νŠΈλ₯Ό λ°°μΉ˜ν•©λ‹ˆλ‹€. 이 μ—μ΄μ „νŠΈλŠ” μ‹€μ‹œκ°„μœΌλ‘œ 데이터λ₯Ό ν†΅ν•©ν•˜κ³  이상 μ§•ν›„λ₯Ό νƒμ§€ν•˜λ©°, λ³΅μž‘ν•œ λ‹€λ³€λŸ‰ μ‹œκ³„μ—΄ 데이터λ₯Ό AI 기반 예츑 λͺ¨λΈμ— μž…λ ₯ν•©λ‹ˆλ‹€.  \n",
       "\n",
       "2. **동적 μ „λ ₯ λΆ„λ°° μ΅œμ ν™” μ—μ΄μ „νŠΈ**  \n",
       "μˆ˜μ§‘λœ 데이터λ₯Ό λ°”νƒ•μœΌλ‘œ 각 λ””λ°”μ΄μŠ€λ³„ μ „λ ₯ μš”κ΅¬λŸ‰κ³Ό λ„€νŠΈμ›Œν¬ μƒνƒœλ₯Ό κ³ λ €ν•œ 졜적 μ „λ ₯ λΆ„λ°° κ³„νšμ„ μ‹€μ‹œκ°„μœΌλ‘œ μ‚°μΆœν•©λ‹ˆλ‹€. κ°•ν™”ν•™μŠ΅(RL) λ˜λŠ” μ΅œμ ν™” μ•Œκ³ λ¦¬μ¦˜μ„ ν™œμš©ν•΄ μ—λ„ˆμ§€ 효율과 μ„œλΉ„μŠ€ ν’ˆμ§ˆμ„ κ·ΉλŒ€ν™”ν•˜λŠ” μ „λž΅μ„ 개발, μ μš©ν•©λ‹ˆλ‹€.  \n",
       "\n",
       "3. **μž₯μ•  예츑 및 λŒ€μ‘ μ—μ΄μ „νŠΈ**  \n",
       "이상 μ‹ ν˜Έλ‚˜ μž₯μ•  νŒ¨ν„΄μ„ λΉ λ₯΄κ²Œ 탐지해 μžλ™μœΌλ‘œ κ²½κ³ λ₯Ό λ°œμ†‘ν•˜κ³ , 자체 진단 ν›„ μž¬λΆ„λ°° μ „λž΅μ„ μ‹€ν–‰ν•˜κ±°λ‚˜ 문제 λ°œμƒ κ°€λŠ₯ ꡬ간을 사전에 μ°¨λ‹¨ν•˜μ—¬ μž₯μ•  확산을 λ°©μ§€ν•©λ‹ˆλ‹€. λ˜ν•œ, λ‹¨μˆœ μ•Œλ¦Όμ„ λ„˜μ–΄ 예츑 μœ μ§€λ³΄μˆ˜κΉŒμ§€ μ‹€ν–‰ν•  수 μžˆλ„λ‘ μ„€κ³„ν•©λ‹ˆλ‹€.  \n",
       "\n",
       "4. **λͺ¨λ“ˆν™”λœ ν˜‘μ—… μ‹œμŠ€ν…œ**  \n",
       "각 μ—μ΄μ „νŠΈκ°€ λ…λ¦½μ μœΌλ‘œ μž‘μ—…ν•˜λ©΄μ„œλ„ μƒν˜Έ μ—°λ™ν•˜λŠ” ꡬ쑰λ₯Ό κ°€μ§‘λ‹ˆλ‹€. 예λ₯Ό λ“€μ–΄, μž₯μ•  예츑 μ—μ΄μ „νŠΈκ°€ 이슈λ₯Ό λ°œκ²¬ν•˜λ©΄ 동적 λΆ„λ°° μ—μ΄μ „νŠΈμ— μ¦‰μ‹œ 정보λ₯Ό μ „λ‹¬ν•˜μ—¬ μ „λ ₯ μž¬λ°°λΆ„μ„ μœ λ„ν•©λ‹ˆλ‹€.  \n",
       "\n",
       "5. **인간-μ—μ΄μ „νŠΈ μΈν„°νŽ˜μ΄μŠ€**  \n",
       "μš΄μ˜μžκ°€ μ—μ΄μ „νŠΈμ˜ κΆŒκ³ μ‚¬ν•­μ„ λͺ¨λ‹ˆν„°λ§ν•˜κ³  μˆ˜λ™ κ°œμž…ν•  수 μžˆλŠ” λŒ€μ‹œλ³΄λ“œλ₯Ό μ œκ³΅ν•©λ‹ˆλ‹€. AI의 κ²°μ • κ³Όμ •κ³Ό ν˜„μž¬ μƒνƒœλ₯Ό 투λͺ…ν•˜κ²Œ μ‹œκ°ν™”ν•˜μ—¬ 신뒰도λ₯Ό 높이며, 비상 μƒν™©μ—μ„œλŠ” μ‹ μ†ν•œ λŒ€μ‘μ„ κ°€λŠ₯ν•˜κ²Œ ν•©λ‹ˆλ‹€.  \n",
       "\n",
       "μ΄λŸ¬ν•œ Agentic AI μ‹œμŠ€ν…œμ€ 무선 μ „λ ₯ λ„€νŠΈμ›Œν¬μ˜ λ³΅μž‘ν•œ ν™˜κ²½ 변화에 μœ μ—°ν•˜κ²Œ λŒ€μ‘ν•˜λ©°, μˆ˜λ™ 처리 ν•œκ³„λ₯Ό 극볡해 μ „λ ₯ λΆ„λ°° νš¨μœ¨μ„±κ³Ό 신뒰성을 획기적으둜 κ°œμ„ ν•  수 μžˆμŠ΅λ‹ˆλ‹€.  \n",
       "\n",
       "---\n",
       "\n",
       "### English:  \n",
       "Proposed Agentic AI Solution:  \n",
       "\n",
       "1. **Real-time Data Integration and Analysis Agent**  \n",
       "Deploy agents that gather power consumption, environmental conditions, and network status data from multiple sensors and IoT devices. These agents integrate real-time data, detect anomalies, and feed complex multivariate time-series data into AI-based predictive models.  \n",
       "\n",
       "2. **Dynamic Power Distribution Optimization Agent**  \n",
       "Based on collected data, the agent calculates real-time optimal power allocation plans considering each device’s power demand and network conditions. It uses reinforcement learning or optimization algorithms to develop and apply strategies maximizing energy efficiency and service quality.  \n",
       "\n",
       "3. **Fault Prediction and Response Agent**  \n",
       "Rapidly detects abnormal signals or fault patterns, automatically issues alerts, performs self-diagnosis, and executes redistribution strategies or pre-emptively isolates potential fault zones to prevent fault propagation. It is designed to enable predictive maintenance beyond simple notifications.  \n",
       "\n",
       "4. **Modular Collaborative System**  \n",
       "Each agent operates independently but interacts seamlessly. For instance, the fault prediction agent immediately communicates detected issues to the dynamic distribution agent, prompting power reallocation.  \n",
       "\n",
       "5. **Human-Agent Interface**  \n",
       "Provide dashboards where operators can monitor agent recommendations and intervene manually if needed. Visualization of AI decision processes and current system status enhances trust and allows swift response during emergencies.  \n",
       "\n",
       "This Agentic AI system flexibly adapts to complex changes within wireless power networks, overcoming manual management limitations to drastically improve power distribution efficiency and reliability."
      ],
      "text/plain": [
       "<IPython.core.display.Markdown object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# have 3 third LLM call propose the Agentic AI solution. \n",
    "\n",
    "messages = create_bilingual_messages(f\"Propose an Agentic AI solution for this pain point: {pain_point}\")\n",
    "\n",
    "response = openai.chat.completions.create(\n",
    "    model=\"gpt-4.1-mini\",\n",
    "    messages=messages)\n",
    "\n",
    "agentic_solution = response.choices[0].message.content\n",
    "\n",
    "display(Markdown(agentic_solution))\n",
    "\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": ".venv",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}