Skip to content

Commit a2d9500

Browse files
committed
cleaned imports
1 parent 02be231 commit a2d9500

File tree

1 file changed

+4
-24
lines changed

1 file changed

+4
-24
lines changed

examples/Speech_transcription_methods.ipynb

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@
8888
"source": [
8989
"# ─── Standard Library ──────────────────────────────────────────────────────────\n",
9090
"import asyncio\n",
91+
"import struct\n",
9192
"import base64 # encode raw PCM bytes → base64 before sending JSON\n",
9293
"import json # compose/parse WebSocket messages\n",
9394
"import os\n",
@@ -97,7 +98,7 @@
9798
"\n",
9899
"# ─── Third-Party ───────────────────────────────────────────────────────────────\n",
99100
"import nest_asyncio\n",
100-
"import numpy as np # efficient numeric processing for audio arrays\n",
101+
"import numpy as np\n",
101102
"from openai import OpenAI\n",
102103
"import resampy # high-quality sample-rate conversion\n",
103104
"import soundfile as sf # reads many audio formats into float32 arrays\n",
@@ -110,11 +111,6 @@
110111
" VoicePipelineConfig,\n",
111112
")\n",
112113
"from IPython.display import Audio, display\n",
113-
"\n",
114-
"import asyncio, base64, json, time, struct\n",
115-
"from typing import List\n",
116-
"\n",
117-
"import numpy as np, resampy, soundfile as sf, websockets\n",
118114
"# ───────────────────────────────────────────────────────────────────────────────\n",
119115
"nest_asyncio.apply()\n",
120116
"\n",
@@ -208,7 +204,7 @@
208204
},
209205
{
210206
"cell_type": "code",
211-
"execution_count": 3,
207+
"execution_count": null,
212208
"id": "7ae4af8d",
213209
"metadata": {},
214210
"outputs": [
@@ -233,7 +229,7 @@
233229
" response_format='text',\n",
234230
" )\n",
235231
" print('\\n--- TRANSCRIPT ---\\n')\n",
236-
" print(transcript)\n"
232+
" print(transcript)"
237233
]
238234
},
239235
{
@@ -344,8 +340,6 @@
344340
"\n",
345341
"EV_DELTA = \"conversation.item.input_audio_transcription.delta\"\n",
346342
"EV_DONE = \"conversation.item.input_audio_transcription.completed\"\n",
347-
"\n",
348-
"\n",
349343
"# ── helpers ────────────────────────────────────────────────────────────────\n",
350344
"def float_to_16bit_pcm(float32_array):\n",
351345
" clipped = [max(-1.0, min(1.0, x)) for x in float32_array]\n",
@@ -473,14 +467,6 @@
473467
"transcript"
474468
]
475469
},
476-
{
477-
"cell_type": "markdown",
478-
"id": "6b9630f8",
479-
"metadata": {},
480-
"source": [
481-
"And lots of times you need to give people more than one link at a time. A band could give their fans a couple new videos from a live concert, a behind the scenes photo gallery, an album to purchase, like these next few links."
482-
]
483-
},
484470
{
485471
"cell_type": "markdown",
486472
"id": "c20826c4",
@@ -652,12 +638,6 @@
652638
"* Explore the [Agents SDK reference](https://openai.github.io/openai-agents-python/).\n",
653639
"* Explore the [Agents SDK Voice Pipeline reference](https://openai.github.io/openai-agents-python/voice/)"
654640
]
655-
},
656-
{
657-
"cell_type": "markdown",
658-
"id": "dd511fc0",
659-
"metadata": {},
660-
"source": []
661641
}
662642
],
663643
"metadata": {

0 commit comments

Comments
 (0)