|
20 | 20 | }, |
21 | 21 | { |
22 | 22 | "cell_type": "code", |
23 | | - "execution_count": 1, |
| 23 | + "execution_count": null, |
24 | 24 | "metadata": {}, |
25 | | - "outputs": [ |
26 | | - { |
27 | | - "name": "stdout", |
28 | | - "output_type": "stream", |
29 | | - "text": [ |
30 | | - "Note: you may need to restart the kernel to use updated packages.\n", |
31 | | - "Note: you may need to restart the kernel to use updated packages.\n" |
32 | | - ] |
33 | | - } |
34 | | - ], |
| 25 | + "outputs": [], |
35 | 26 | "source": [ |
36 | 27 | "%pip install openai --quiet\n", |
37 | 28 | "%pip install python-dotenv --quiet" |
|
50 | 41 | }, |
51 | 42 | { |
52 | 43 | "cell_type": "code", |
53 | | - "execution_count": 2, |
| 44 | + "execution_count": null, |
54 | 45 | "metadata": {}, |
55 | 46 | "outputs": [], |
56 | 47 | "source": [ |
|
84 | 75 | }, |
85 | 76 | { |
86 | 77 | "cell_type": "code", |
87 | | - "execution_count": 3, |
| 78 | + "execution_count": null, |
88 | 79 | "metadata": {}, |
89 | | - "outputs": [ |
90 | | - { |
91 | | - "name": "stdout", |
92 | | - "output_type": "stream", |
93 | | - "text": [ |
94 | | - "The capital of France is Paris.\n" |
95 | | - ] |
96 | | - } |
97 | | - ], |
| 80 | + "outputs": [], |
98 | 81 | "source": [ |
99 | 82 | "\n", |
100 | 83 | "response = client.chat.completions.create(\n", |
|
132 | 115 | }, |
133 | 116 | { |
134 | 117 | "cell_type": "code", |
135 | | - "execution_count": 4, |
| 118 | + "execution_count": null, |
136 | 119 | "metadata": {}, |
137 | | - "outputs": [ |
138 | | - { |
139 | | - "name": "stdout", |
140 | | - "output_type": "stream", |
141 | | - "text": [ |
142 | | - "The capital of Spain is Madrid.\n" |
143 | | - ] |
144 | | - } |
145 | | - ], |
| 120 | + "outputs": [], |
146 | 121 | "source": [ |
147 | 122 | "# Call the chat completion API\n", |
148 | 123 | "response = client.chat.completions.create(\n", |
|
187 | 162 | }, |
188 | 163 | { |
189 | 164 | "cell_type": "code", |
190 | | - "execution_count": 5, |
| 165 | + "execution_count": null, |
191 | 166 | "metadata": {}, |
192 | | - "outputs": [ |
193 | | - { |
194 | | - "name": "stdout", |
195 | | - "output_type": "stream", |
196 | | - "text": [ |
197 | | - "The image features a cute, fluffy puppy with a golden coat seated on a textured mat. In front of the puppy is a black and gray food bowl, which reflects the surroundings. The floor appears to be wooden, and there are elements of a cozy environment visible in the background, including a brick wall and wooden furniture. The overall atmosphere of the image is warm and inviting.\n" |
198 | | - ] |
199 | | - } |
200 | | - ], |
| 167 | + "outputs": [], |
201 | 168 | "source": [ |
202 | 169 | "import base64\n", |
203 | 170 | "model_name = \"gpt-4o-mini\"\n", |
|
270 | 237 | }, |
271 | 238 | { |
272 | 239 | "cell_type": "code", |
273 | | - "execution_count": 7, |
| 240 | + "execution_count": null, |
274 | 241 | "metadata": {}, |
275 | | - "outputs": [ |
276 | | - { |
277 | | - "name": "stdout", |
278 | | - "output_type": "stream", |
279 | | - "text": [ |
280 | | - "Exercising every day offers numerous benefits for both your physical and mental well-being. Here are five compelling reasons to make daily exercise a part of your routine:\n", |
281 | | - "\n", |
282 | | - "1. **Improved Physical Health**: Regular exercise strengthens your heart, improves circulation, boosts your immune system, and helps maintain a healthy weight. It can lower the risk of chronic diseases such as heart disease, type 2 diabetes, and certain cancers.\n", |
283 | | - "\n", |
284 | | - "2. **Enhanced Mental Well-being**: Physical activity releases endorphins, often referred to as \"feel-good\" hormones. This can reduce feelings of stress, anxiety, and depression while improving your mood and overall emotional health.\n", |
285 | | - "\n", |
286 | | - "3. **Increased Energy Levels**: Contrary to what one might expect, regular exercise can lead to increased energy levels. It improves your stamina and reduces fatigue, making daily tasks easier and more enjoyable.\n", |
287 | | - "\n", |
288 | | - "4. **Better Sleep Quality**: Engaging in physical activity can help you fall asleep faster and deepen your sleep. Exercise helps regulate your sleep patterns and can alleviate issues like insomnia.\n", |
289 | | - "\n", |
290 | | - "5. **Social Connections and Routine**: Exercising daily can provide opportunities for social interaction, whether through group classes, team sports, or simply exercising with friends. Additionally, establishing a regular exercise routine can enhance your sense of discipline and structure in your daily life.\n", |
291 | | - "\n", |
292 | | - "Incorporating daily exercise can have a profound impact on multiple dimensions of your health and well-being." |
293 | | - ] |
294 | | - } |
295 | | - ], |
| 242 | + "outputs": [], |
296 | 243 | "source": [ |
297 | 244 | "# Call the chat completion API\n", |
298 | 245 | "response = client.chat.completions.create(\n", |
|
331 | 278 | }, |
332 | 279 | { |
333 | 280 | "cell_type": "code", |
334 | | - "execution_count": 8, |
| 281 | + "execution_count": null, |
335 | 282 | "metadata": {}, |
336 | | - "outputs": [ |
337 | | - { |
338 | | - "name": "stdout", |
339 | | - "output_type": "stream", |
340 | | - "text": [ |
341 | | - "Calling function `get_flight_info` with arguments {'origin_city': 'Seattle', 'destination_city': 'Miami'}\n", |
342 | | - "Function returned = {\"airline\": \"Delta\", \"flight_number\": \"DL123\", \"flight_date\": \"May 7th, 2024\", \"flight_time\": \"10:00AM\"}\n", |
343 | | - "Model response = The next flight from Seattle to Miami is with Delta Airlines. Here are the details:\n", |
344 | | - "\n", |
345 | | - "- **Flight Number**: DL123\n", |
346 | | - "- **Date**: May 7th, 2024\n", |
347 | | - "- **Time**: 10:00 AM\n" |
348 | | - ] |
349 | | - } |
350 | | - ], |
| 283 | + "outputs": [], |
351 | 284 | "source": [ |
352 | 285 | "import json\n", |
353 | 286 | "\n", |
|
0 commit comments