Skip to content

Commit 2500aea

Browse files
committed
Clear outputs
1 parent a9bbffd commit 2500aea

File tree

2 files changed

+20
-115
lines changed

2 files changed

+20
-115
lines changed

samples/python/openai/embeddings_getting_started.ipynb

Lines changed: 7 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,9 @@
2020
},
2121
{
2222
"cell_type": "code",
23-
"execution_count": 1,
23+
"execution_count": null,
2424
"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": [],
3526
"source": [
3627
"%pip install openai --quiet\n",
3728
"%pip install python-dotenv --quiet"
@@ -50,7 +41,7 @@
5041
},
5142
{
5243
"cell_type": "code",
53-
"execution_count": 2,
44+
"execution_count": null,
5445
"metadata": {},
5546
"outputs": [],
5647
"source": [
@@ -82,18 +73,9 @@
8273
},
8374
{
8475
"cell_type": "code",
85-
"execution_count": 3,
76+
"execution_count": null,
8677
"metadata": {},
87-
"outputs": [
88-
{
89-
"name": "stdout",
90-
"output_type": "stream",
91-
"text": [
92-
"1536\n",
93-
"[-0.019143931567668915, -0.025292053818702698, -0.0017211713129654527, 0.01883450709283352, -0.03382139280438423, -0.019682060927152634, -0.02102738246321678, 0.05160655081272125, -0.03218010067939758, -0.03043118305504322]\n"
94-
]
95-
}
96-
],
78+
"outputs": [],
9779
"source": [
9880
"model_name = \"text-embedding-3-small\" \n",
9981
"\n",
@@ -119,19 +101,9 @@
119101
},
120102
{
121103
"cell_type": "code",
122-
"execution_count": 4,
104+
"execution_count": null,
123105
"metadata": {},
124-
"outputs": [
125-
{
126-
"name": "stdout",
127-
"output_type": "stream",
128-
"text": [
129-
"[-0.019143931567668915, -0.025292053818702698, -0.0017211713129654527, 0.01883450709283352, -0.03382139280438423, -0.019682060927152634, -0.02102738246321678, 0.05160655081272125, -0.03218010067939758, -0.03043118305504322]\n",
130-
"[0.027567066252231598, -0.026544300839304924, -0.027091361582279205, 0.057798076421022415, -0.0034756148234009743, -0.0028126018587499857, 0.03184840455651283, 0.010120609775185585, -0.0341080017387867, -0.04464485123753548]\n",
131-
"[-0.030637985095381737, -0.0062282998114824295, -0.038596536964178085, -0.008159957826137543, 0.004671987611800432, 0.018016600981354713, 0.02050670050084591, -0.05268268659710884, 0.0091486731544137, 0.015965931117534637]\n"
132-
]
133-
}
134-
],
106+
"outputs": [],
135107
"source": [
136108
"model_name = \"text-embedding-3-small\" \n",
137109
"inputs = [\"Hello, world!\", \"How are you?\", \"What's the weather like?\"]\n",

samples/python/openai/getting_started.ipynb

Lines changed: 13 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,9 @@
2020
},
2121
{
2222
"cell_type": "code",
23-
"execution_count": 1,
23+
"execution_count": null,
2424
"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": [],
3526
"source": [
3627
"%pip install openai --quiet\n",
3728
"%pip install python-dotenv --quiet"
@@ -50,7 +41,7 @@
5041
},
5142
{
5243
"cell_type": "code",
53-
"execution_count": 2,
44+
"execution_count": null,
5445
"metadata": {},
5546
"outputs": [],
5647
"source": [
@@ -84,17 +75,9 @@
8475
},
8576
{
8677
"cell_type": "code",
87-
"execution_count": 3,
78+
"execution_count": null,
8879
"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": [],
9881
"source": [
9982
"\n",
10083
"response = client.chat.completions.create(\n",
@@ -132,17 +115,9 @@
132115
},
133116
{
134117
"cell_type": "code",
135-
"execution_count": 4,
118+
"execution_count": null,
136119
"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": [],
146121
"source": [
147122
"# Call the chat completion API\n",
148123
"response = client.chat.completions.create(\n",
@@ -187,17 +162,9 @@
187162
},
188163
{
189164
"cell_type": "code",
190-
"execution_count": 5,
165+
"execution_count": null,
191166
"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": [],
201168
"source": [
202169
"import base64\n",
203170
"model_name = \"gpt-4o-mini\"\n",
@@ -270,29 +237,9 @@
270237
},
271238
{
272239
"cell_type": "code",
273-
"execution_count": 7,
240+
"execution_count": null,
274241
"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": [],
296243
"source": [
297244
"# Call the chat completion API\n",
298245
"response = client.chat.completions.create(\n",
@@ -331,23 +278,9 @@
331278
},
332279
{
333280
"cell_type": "code",
334-
"execution_count": 8,
281+
"execution_count": null,
335282
"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": [],
351284
"source": [
352285
"import json\n",
353286
"\n",

0 commit comments

Comments
 (0)