Skip to content

Commit d906ad1

Browse files
author
Amanda Foster
committed
resolving merge conflicts
2 parents e225c1a + 79eed5c commit d906ad1

File tree

1 file changed

+129
-0
lines changed

1 file changed

+129
-0
lines changed

Basic_Samples/Functions/working_with_functions.ipynb

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@
2323
},
2424
{
2525
"cell_type": "code",
26+
<<<<<<< HEAD
2627
"execution_count": 1,
28+
=======
29+
"execution_count": 99,
30+
>>>>>>> 79eed5c26849030e91a4d89e4a9fa61c2878229b
2731
"metadata": {},
2832
"outputs": [],
2933
"source": [
@@ -33,7 +37,11 @@
3337
},
3438
{
3539
"cell_type": "code",
40+
<<<<<<< HEAD
3641
"execution_count": 17,
42+
=======
43+
"execution_count": 100,
44+
>>>>>>> 79eed5c26849030e91a4d89e4a9fa61c2878229b
3745
"metadata": {},
3846
"outputs": [],
3947
"source": [
@@ -73,7 +81,11 @@
7381
},
7482
{
7583
"cell_type": "code",
84+
<<<<<<< HEAD
7685
"execution_count": 18,
86+
=======
87+
"execution_count": 101,
88+
>>>>>>> 79eed5c26849030e91a4d89e4a9fa61c2878229b
7789
"metadata": {},
7890
"outputs": [],
7991
"source": [
@@ -118,7 +130,11 @@
118130
},
119131
{
120132
"cell_type": "code",
133+
<<<<<<< HEAD
121134
"execution_count": 19,
135+
=======
136+
"execution_count": 102,
137+
>>>>>>> 79eed5c26849030e91a4d89e4a9fa61c2878229b
122138
"metadata": {},
123139
"outputs": [
124140
{
@@ -127,9 +143,15 @@
127143
"text": [
128144
"Let the model decide what function to call:\n",
129145
"{\n",
146+
<<<<<<< HEAD
130147
" \"id\": \"chatcmpl-7e9d5AFNbVuiil0l0IWCKSX0luNPV\",\n",
131148
" \"object\": \"chat.completion\",\n",
132149
" \"created\": 1689804491,\n",
150+
=======
151+
" \"id\": \"chatcmpl-7e9QCkcvCtXbyiZwm3eKVHHQ2waXE\",\n",
152+
" \"object\": \"chat.completion\",\n",
153+
" \"created\": 1689803692,\n",
154+
>>>>>>> 79eed5c26849030e91a4d89e4a9fa61c2878229b
133155
" \"model\": \"gpt-4\",\n",
134156
" \"prompt_annotations\": [\n",
135157
" {\n",
@@ -176,9 +198,15 @@
176198
"}\n",
177199
"Don't call any function:\n",
178200
"{\n",
201+
<<<<<<< HEAD
179202
" \"id\": \"chatcmpl-7e9d6AQAqykfQ8cnGlrkJM5zEZGSl\",\n",
180203
" \"object\": \"chat.completion\",\n",
181204
" \"created\": 1689804492,\n",
205+
=======
206+
" \"id\": \"chatcmpl-7e9QDkseJ33uGMacx6X4MEmS12BuT\",\n",
207+
" \"object\": \"chat.completion\",\n",
208+
" \"created\": 1689803693,\n",
209+
>>>>>>> 79eed5c26849030e91a4d89e4a9fa61c2878229b
182210
" \"model\": \"gpt-4\",\n",
183211
" \"prompt_annotations\": [\n",
184212
" {\n",
@@ -209,7 +237,11 @@
209237
" \"finish_reason\": \"stop\",\n",
210238
" \"message\": {\n",
211239
" \"role\": \"assistant\",\n",
240+
<<<<<<< HEAD
212241
" \"content\": \"Sure, let me check that for you.\\n\\nI am using the function `get_current_weather` for this purpose.\"\n",
242+
=======
243+
" \"content\": \"Sure, let me just find that information for you.\"\n",
244+
>>>>>>> 79eed5c26849030e91a4d89e4a9fa61c2878229b
213245
" },\n",
214246
" \"content_filter_results\": {\n",
215247
" \"hate\": {\n",
@@ -232,16 +264,28 @@
232264
" }\n",
233265
" ],\n",
234266
" \"usage\": {\n",
267+
<<<<<<< HEAD
235268
" \"completion_tokens\": 23,\n",
236269
" \"prompt_tokens\": 84,\n",
237270
" \"total_tokens\": 107\n",
271+
=======
272+
" \"completion_tokens\": 11,\n",
273+
" \"prompt_tokens\": 84,\n",
274+
" \"total_tokens\": 95\n",
275+
>>>>>>> 79eed5c26849030e91a4d89e4a9fa61c2878229b
238276
" }\n",
239277
"}\n",
240278
"Force a specific function call:\n",
241279
"{\n",
280+
<<<<<<< HEAD
242281
" \"id\": \"chatcmpl-7e9d7bOcTyEe3mA9rBhAPflFEqYX3\",\n",
243282
" \"object\": \"chat.completion\",\n",
244283
" \"created\": 1689804493,\n",
284+
=======
285+
" \"id\": \"chatcmpl-7e9QEsAAhn44pwg7ty9osRltgwXPb\",\n",
286+
" \"object\": \"chat.completion\",\n",
287+
" \"created\": 1689803694,\n",
288+
>>>>>>> 79eed5c26849030e91a4d89e4a9fa61c2878229b
245289
" \"model\": \"gpt-4\",\n",
246290
" \"prompt_annotations\": [\n",
247291
" {\n",
@@ -274,16 +318,26 @@
274318
" \"role\": \"assistant\",\n",
275319
" \"function_call\": {\n",
276320
" \"name\": \"get_current_weather\",\n",
321+
<<<<<<< HEAD
277322
" \"arguments\": \"{\\n \\\"location\\\": \\\"San Francisco, CA\\\"\\n}\"\n",
323+
=======
324+
" \"arguments\": \"{\\n \\\"location\\\": \\\"San Francisco\\\"\\n}\"\n",
325+
>>>>>>> 79eed5c26849030e91a4d89e4a9fa61c2878229b
278326
" }\n",
279327
" },\n",
280328
" \"content_filter_results\": {}\n",
281329
" }\n",
282330
" ],\n",
283331
" \"usage\": {\n",
332+
<<<<<<< HEAD
284333
" \"completion_tokens\": 12,\n",
285334
" \"prompt_tokens\": 90,\n",
286335
" \"total_tokens\": 102\n",
336+
=======
337+
" \"completion_tokens\": 10,\n",
338+
" \"prompt_tokens\": 90,\n",
339+
" \"total_tokens\": 100\n",
340+
>>>>>>> 79eed5c26849030e91a4d89e4a9fa61c2878229b
287341
" }\n",
288342
"}\n"
289343
]
@@ -295,6 +349,10 @@
295349
"print(\"Let the model decide what function to call:\")\n",
296350
"print (get_function_call(first_message, \"auto\"))\n",
297351
"\n",
352+
<<<<<<< HEAD
353+
=======
354+
"\n",
355+
>>>>>>> 79eed5c26849030e91a4d89e4a9fa61c2878229b
298356
"# 'none' : Don't call any function \n",
299357
"print(\"Don't call any function:\")\n",
300358
"print (get_function_call(first_message, \"none\"))\n",
@@ -323,7 +381,11 @@
323381
},
324382
{
325383
"cell_type": "code",
384+
<<<<<<< HEAD
326385
"execution_count": 20,
386+
=======
387+
"execution_count": 103,
388+
>>>>>>> 79eed5c26849030e91a4d89e4a9fa61c2878229b
327389
"metadata": {},
328390
"outputs": [],
329391
"source": [
@@ -346,16 +408,27 @@
346408
},
347409
{
348410
"cell_type": "code",
411+
<<<<<<< HEAD
349412
"execution_count": 6,
413+
=======
414+
"execution_count": 104,
415+
>>>>>>> 79eed5c26849030e91a4d89e4a9fa61c2878229b
350416
"metadata": {},
351417
"outputs": [
352418
{
353419
"data": {
354420
"text/plain": [
421+
<<<<<<< HEAD
355422
"'06:07:59 PM'"
356423
]
357424
},
358425
"execution_count": 6,
426+
=======
427+
"'05:54:54 PM'"
428+
]
429+
},
430+
"execution_count": 104,
431+
>>>>>>> 79eed5c26849030e91a4d89e4a9fa61c2878229b
359432
"metadata": {},
360433
"output_type": "execute_result"
361434
}
@@ -374,7 +447,11 @@
374447
},
375448
{
376449
"cell_type": "code",
450+
<<<<<<< HEAD
377451
"execution_count": 7,
452+
=======
453+
"execution_count": 105,
454+
>>>>>>> 79eed5c26849030e91a4d89e4a9fa61c2878229b
378455
"metadata": {},
379456
"outputs": [],
380457
"source": [
@@ -407,7 +484,11 @@
407484
},
408485
{
409486
"cell_type": "code",
487+
<<<<<<< HEAD
410488
"execution_count": 8,
489+
=======
490+
"execution_count": 106,
491+
>>>>>>> 79eed5c26849030e91a4d89e4a9fa61c2878229b
411492
"metadata": {},
412493
"outputs": [
413494
{
@@ -431,7 +512,11 @@
431512
},
432513
{
433514
"cell_type": "code",
515+
<<<<<<< HEAD
434516
"execution_count": 9,
517+
=======
518+
"execution_count": 107,
519+
>>>>>>> 79eed5c26849030e91a4d89e4a9fa61c2878229b
435520
"metadata": {},
436521
"outputs": [],
437522
"source": [
@@ -456,7 +541,11 @@
456541
},
457542
{
458543
"cell_type": "code",
544+
<<<<<<< HEAD
459545
"execution_count": 10,
546+
=======
547+
"execution_count": 115,
548+
>>>>>>> 79eed5c26849030e91a4d89e4a9fa61c2878229b
460549
"metadata": {},
461550
"outputs": [
462551
{
@@ -476,7 +565,11 @@
476565
"cell_type": "markdown",
477566
"metadata": {},
478567
"source": [
568+
<<<<<<< HEAD
479569
"## 3.0 Calling a function using GPT\n",
570+
=======
571+
"## 3.0 Calling a Function using GPT\n",
572+
>>>>>>> 79eed5c26849030e91a4d89e4a9fa61c2878229b
480573
"\n",
481574
"Steps for Function Calling: \n",
482575
"\n",
@@ -490,7 +583,11 @@
490583
},
491584
{
492585
"cell_type": "code",
586+
<<<<<<< HEAD
493587
"execution_count": 11,
588+
=======
589+
"execution_count": 116,
590+
>>>>>>> 79eed5c26849030e91a4d89e4a9fa61c2878229b
494591
"metadata": {},
495592
"outputs": [],
496593
"source": [
@@ -554,7 +651,11 @@
554651
},
555652
{
556653
"cell_type": "code",
654+
<<<<<<< HEAD
557655
"execution_count": 12,
656+
=======
657+
"execution_count": 117,
658+
>>>>>>> 79eed5c26849030e91a4d89e4a9fa61c2878229b
558659
"metadata": {},
559660
"outputs": [],
560661
"source": [
@@ -579,7 +680,11 @@
579680
},
580681
{
581682
"cell_type": "code",
683+
<<<<<<< HEAD
582684
"execution_count": 13,
685+
=======
686+
"execution_count": 118,
687+
>>>>>>> 79eed5c26849030e91a4d89e4a9fa61c2878229b
583688
"metadata": {},
584689
"outputs": [],
585690
"source": [
@@ -656,7 +761,11 @@
656761
},
657762
{
658763
"cell_type": "code",
764+
<<<<<<< HEAD
659765
"execution_count": 14,
766+
=======
767+
"execution_count": 119,
768+
>>>>>>> 79eed5c26849030e91a4d89e4a9fa61c2878229b
660769
"metadata": {},
661770
"outputs": [
662771
{
@@ -670,16 +779,28 @@
670779
"}\n",
671780
"\n",
672781
"Output of function call:\n",
782+
<<<<<<< HEAD
673783
"06:08:07 PM\n",
784+
=======
785+
"05:55:08 PM\n",
786+
>>>>>>> 79eed5c26849030e91a4d89e4a9fa61c2878229b
674787
"\n",
675788
"Messages in second request:\n",
676789
"{'role': 'user', 'content': 'What time is it in New York?'}\n",
677790
"{'role': 'assistant', 'name': 'get_current_time', 'content': '{\\n \"location\": \"America/New_York\"\\n}'}\n",
791+
<<<<<<< HEAD
678792
"{'role': 'function', 'name': 'get_current_time', 'content': '06:08:07 PM'}\n",
679793
"\n",
680794
"{\n",
681795
" \"role\": \"assistant\",\n",
682796
" \"content\": \"The current time in New York is 06:08 PM.\"\n",
797+
=======
798+
"{'role': 'function', 'name': 'get_current_time', 'content': '05:55:08 PM'}\n",
799+
"\n",
800+
"{\n",
801+
" \"role\": \"assistant\",\n",
802+
" \"content\": \"The current time in New York is 05:55:08 PM.\"\n",
803+
>>>>>>> 79eed5c26849030e91a4d89e4a9fa61c2878229b
683804
"}\n"
684805
]
685806
}
@@ -700,7 +821,11 @@
700821
},
701822
{
702823
"cell_type": "code",
824+
<<<<<<< HEAD
703825
"execution_count": 15,
826+
=======
827+
"execution_count": 120,
828+
>>>>>>> 79eed5c26849030e91a4d89e4a9fa61c2878229b
704829
"metadata": {},
705830
"outputs": [],
706831
"source": [
@@ -780,7 +905,11 @@
780905
},
781906
{
782907
"cell_type": "code",
908+
<<<<<<< HEAD
783909
"execution_count": 16,
910+
=======
911+
"execution_count": 121,
912+
>>>>>>> 79eed5c26849030e91a4d89e4a9fa61c2878229b
784913
"metadata": {},
785914
"outputs": [
786915
{

0 commit comments

Comments
 (0)