You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: building-intelligent-applications/README.md
+31-96Lines changed: 31 additions & 96 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,21 +38,15 @@ click on **playground** in the left navigation and select the **default** settin
38
38
[4]: images/1706369240032.png
39
39
40
40
![][5]
41
-
42
-
41
+
43
42
[5]: images/1706369250162.png
44
43
45
44
46
-
47
-
48
-
Input: How is the weather today in Las Vegas
45
+
Input: How is the weather today in Las Vegas
49
46
50
47
Output: It is currently overcast in Las Vegas with a high of 63 degrees Fahrenheit (17 Celsius). There is a 15% chance of precipitation today but it should mostly clear up by this afternoon with chances of partly cloudy skies. Would you like to know more about the weather in Las Vegas? I can also tell you about upcoming forecasts if you plan to be there for a few days.
51
48
52
49
Would you like to know more about the weather in other cities?
53
-
54
-
55
-
56
50
57
51
At this stage you can view **Java** or **Python** code in the console.
58
52
@@ -147,10 +141,7 @@ Copy paste this PL/SQL code block, you can also download it from [my GitHub repo
Tokens: A token is a word, part of a word, or a punctuation. For example, apple is a token and friendship is made up of two tokens, friend and ship.
226
211
227
212
Temperature:How random to generate the output text. To generate the same output for a prompt every time you run that prompt, use 0. To generate a random new text for that prompt, increase the temperature. Default temperature is 1
228
213
@@ -231,14 +216,10 @@ Few request parameters: [(reference)][16]
231
216
Run the page by pressing the **Green** button
232
217
233
218
![][17]
234
-
235
-
236
-
[17]: images/1706373094904.png
237
219
220
+
[17]: images/1706373094904.png
238
221
239
-
240
-
241
-
Input: What is Neuroscience
222
+
Input: What is Neuroscience
242
223
243
224
AI Response: Neuroscience is a branch of science that focuses on studying the structure and function of the nervous system, and how the nervous system processes information and conducts behavior. It is a multidisciplinary field that combines concepts and techniques from various disciplines, including biology, chemistry, physics, and psychology, to understand how the brain and nervous system work and interact with the rest of the body.
244
225
@@ -252,14 +233,10 @@ Run the page by pressing the **Green** button
252
233
253
234
254
235
![][18]
255
-
256
-
257
-
[18]: images/1706373598487.png
258
236
237
+
[18]: images/1706373598487.png
259
238
260
-
261
-
262
-
Input: Write a mail to my manager requesting leave on February 4th on my daughter's birthday.
239
+
Input: Write a mail to my manager requesting leave on February 4th on my daughter's birthday.
263
240
264
241
AI Response:
265
242
@@ -279,19 +256,12 @@ Run the page by pressing the **Green** button
279
256
[Your Name]
280
257
281
258
Do you want me to provide you with some alternatives in case your manager rejects the request?
282
-
283
-
284
-
285
259
286
260
![][19]
287
-
288
-
289
-
[19]: images/1706373822085.png
290
261
262
+
[19]: images/1706373822085.png
291
263
292
-
293
-
294
-
Input: Generate a Java program to calculate the sum of two numbers.
264
+
Input: Generate a Java program to calculate the sum of two numbers.
295
265
296
266
AI Response:
297
267
@@ -315,19 +285,13 @@ Run the page by pressing the **Green** button
315
285
In this program, we define a class called SumCalculator with a main method. Inside the main method, we define two double variables num1 and num2 to hold the values of the numbers for which we want to calculate the sum. We then call the calculateSum method, passing in the values of num1 and num2, and store the result in the sum variable. Finally, we print out the sum of the two numbers.
316
286
317
287
You can modify the values of num1 and num2 in the main method to calculate the sum of different numbers. This program demonstrates the basic concept of calculating the sum of two numbers using Java.
318
-
319
-
320
-
288
+
321
289
322
290
![][20]
323
-
324
-
325
-
[20]: images/1706373972658.png
326
291
292
+
[20]: images/1706373972658.png
327
293
328
-
329
-
330
-
Input: Write a script for a documentary movie based on the Taj Mahal.
294
+
Input: Write a script for a documentary movie based on the Taj Mahal.
331
295
AI Response: INT. THE Taj Mahal - DAY
332
296
333
297
As we wake up to another sunny morning in Agra, the city which is immensely lucky to have the Taj Mahal as its prime attraction, we realize how truly special this place is with each passing day.
@@ -341,14 +305,10 @@ Run the page by pressing the **Green** button
341
305
..
342
306
343
307
![][21]
344
-
345
-
346
-
[21]: images/1706374244953.png
347
308
309
+
[21]: images/1706374244953.png
348
310
349
-
350
-
351
-
Input: Generate SQL to find hospital names and addresses in Las Vegas.
311
+
Input: Generate SQL to find hospital names and addresses in Las Vegas.
352
312
353
313
AI Response: Here's a potential SQL query that might help you retrieve hospital names and addresses in Las Vegas:
354
314
@@ -367,19 +327,13 @@ Run the page by pressing the **Green** button
367
327
It's always recommended to check the documentation of your specific database system to ensure compatibility and optimal query performance.
368
328
369
329
Please replace the table and column names with the actual names used in your database schema.
370
-
371
-
372
-
330
+
373
331
374
332
![][22]
375
-
376
-
377
-
[22]: images/1706374397694.png
378
333
334
+
[22]: images/1706374397694.png
379
335
380
-
381
-
382
-
Input: How to make mixed fruit jam
336
+
Input: How to make mixed fruit jam
383
337
384
338
AI Response:
385
339
@@ -415,30 +369,21 @@ Yes, it can detect source language, here are some examples
415
369
416
370
[24]: images/1706518398469.png
417
371
418
-
419
-
420
-
421
-
Japanese Input Source: 今日の東京の天気はどうですか
372
+
Japanese Input Source: 今日の東京の天気はどうですか
422
373
(Translated Input: How is the weather in Tokyo today?)
423
374
424
375
AI Response: The weather in Tokyo today can be described as follows. Cloudy with a high of 74°F and a low of 65°F. The sky will be clear throughout the day, with only a 20% chance of precipitation.
425
376
426
377
Is there anything specific you would like to know about the weather in Tokyo today? I can provide more detailed information or answer questions about specific aspects such as wind speed, humidity, or precipitation chances.
427
-
428
-
429
-
378
+
430
379
431
380
How about Simplified Chinese input text?
432
381
433
382
![][25]
434
-
435
-
436
-
[25]: images/1706518347668.png
437
383
384
+
[25]: images/1706518347668.png
438
385
439
-
440
-
441
-
Simplified Chinese Input Source: 谁建造了中国的长城
386
+
Simplified Chinese Input Source: 谁建造了中国的长城
442
387
(Translated Input: Who built the great wall of China?)
443
388
444
389
AI Response: It is not accurate to say that "who" built "Longmen" or "Changcheng" (as it was historically referred to in Chinese literature). "Longmen" or "Changcheng" was not a physical entity or a city like the modern-day Beijing or Shanghai. Rather, it refers to a series of ancient stone gates (or "gates of longmen") that were part of the Great Wall of China.
@@ -450,9 +395,7 @@ How about Simplified Chinese input text?
450
395
It is inaccurate to pinpoint a specific individual or organization as the builders of the wall. The construction and maintenance of the wall involved the collective efforts of many rulers, architects, engineers, and laborers over centuries.
451
396
452
397
Would you like me to provide more detailed information on the construction or history of the Great Wall of China?
Alternatively, if you wish to run the Generative AI services using Python code you can copy and paste the code generated and run the Python script ( or Java code)
476
-
477
-
478
-
479
-
480
-
# coding: utf-8
419
+
420
+
# coding: utf-8
481
421
# Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
482
422
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
483
423
@@ -521,11 +461,8 @@ Alternatively, if you wish to run the Generative AI services using Python code y
521
461
print(generate_text_response.data)
522
462
523
463
To run Python script we need install OCI command line interface and to setup config file, an example shown below
524
-
525
-
526
-
527
-
528
-
vim ~/.oci/config
464
+
465
+
vim ~/.oci/config
529
466
..
530
467
531
468
[DEFAULT]
@@ -534,9 +471,7 @@ To run Python script we need install OCI command line interface and to setup con
534
471
key_file=/<Path>/.oci/keyfilename.pem
535
472
tenancy=<Tenancy-OCID>
536
473
region=<Region-OCID>
537
-
538
-
539
-
474
+
540
475
541
476
**I** f you would like to know more about setting up OCI Command Line Interface, please check my video on that (Lab 3 of [AI for Healthcare][28] Livelabs)
0 commit comments