From a1241c03e8f8f02ad9282be96259bd55057c5cf9 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Wed, 4 Feb 2026 16:45:03 +0000 Subject: [PATCH 1/4] Add Python SDK and JavaScript SDK code examples to Universal 3 Pro page Co-Authored-By: adinoto@assemblyai.com --- .../01-getting-started/universal-3-pro.mdx | 628 +++++++++++++++++- 1 file changed, 610 insertions(+), 18 deletions(-) diff --git a/fern/pages/01-getting-started/universal-3-pro.mdx b/fern/pages/01-getting-started/universal-3-pro.mdx index 8e0c2a87..f432d906 100644 --- a/fern/pages/01-getting-started/universal-3-pro.mdx +++ b/fern/pages/01-getting-started/universal-3-pro.mdx @@ -78,7 +78,27 @@ Not sure where to start? Try our [Prompt Generator](/docs/pre-recorded-audio/pro This example shows how you can transcribe a pre-recorded audio file with our Universal-3 Pro model and print the transcript text to your terminal. - + + +```python +import assemblyai as aai + +aai.settings.api_key = "" + +audio_file = "https://assembly.ai/sports_injuries.mp3" + +config = aai.TranscriptionConfig( + speech_models=["universal-3-pro", "universal-2"], + language_detection=True, +) + +transcript = aai.Transcriber().transcribe(audio_file, config) + +print(transcript.text) +``` + + + ```python import requests @@ -114,6 +134,32 @@ while True: time.sleep(3) ``` + + + +```javascript +import { AssemblyAI } from "assemblyai"; + +const client = new AssemblyAI({ + apiKey: "", +}); + +const audioFile = "https://assembly.ai/sports_injuries.mp3"; + +const params = { + audio: audioFile, + speech_models: ["universal-3-pro", "universal-2"], + language_detection: true, +}; + +const run = async () => { + const transcript = await client.transcripts.transcribe(params); + console.log(transcript.text); +}; + +run(); +``` + @@ -187,7 +233,28 @@ Hi, this is Kelly Byrne-Donoghue ``` - + + +```python {11} +import assemblyai as aai + +aai.settings.api_key = "" + +audio_file = "https://assemblyaiassets.com/audios/keyterms_prompting.wav" + +config = aai.TranscriptionConfig( + speech_models=["universal-3-pro", "universal-2"], + language_detection=True, + keyterms_prompt=["Kelly Byrne-Donoghue"], +) + +transcript = aai.Transcriber().transcribe(audio_file, config) + +print(transcript.text) +``` + + + ```python {10} import requests @@ -224,6 +291,33 @@ while True: time.sleep(3) ``` + + + +```javascript {12} +import { AssemblyAI } from "assemblyai"; + +const client = new AssemblyAI({ + apiKey: "", +}); + +const audioFile = "https://assemblyaiassets.com/audios/keyterms_prompting.wav"; + +const params = { + audio: audioFile, + speech_models: ["universal-3-pro", "universal-2"], + language_detection: true, + keyterms_prompt: ["Kelly Byrne-Donoghue"], +}; + +const run = async () => { + const transcript = await client.transcripts.transcribe(params); + console.log(transcript.text); +}; + +run(); +``` + @@ -291,7 +385,28 @@ Do you and Quentin still socialize, uh, when you come to Los Angeles, or is it l ``` - + + +```python {11} +import assemblyai as aai + +aai.settings.api_key = "" + +audio_file = "https://assemblyaiassets.com/audios/verbatim.mp3" + +config = aai.TranscriptionConfig( + speech_models=["universal-3-pro", "universal-2"], + language_detection=True, + prompt="Produce a transcript suitable for conversational analysis. Every disfluency is meaningful data. Include: fillers (um, uh, er, ah, hmm, mhm, like, you know, I mean), repetitions (I I, the the), restarts (I was- I went), stutters (th-that, b-but, no-not), and informal speech (gonna, wanna, gotta)", +) + +transcript = aai.Transcriber().transcribe(audio_file, config) + +print(transcript.text) +``` + + + ```python {11} import requests @@ -328,6 +443,34 @@ while True: time.sleep(3) ``` + + + +```javascript {12} +import { AssemblyAI } from "assemblyai"; + +const client = new AssemblyAI({ + apiKey: "", +}); + +const audioFile = "https://assemblyaiassets.com/audios/verbatim.mp3"; + +const params = { + audio: audioFile, + speech_models: ["universal-3-pro", "universal-2"], + language_detection: true, + prompt: + "Produce a transcript suitable for conversational analysis. Every disfluency is meaningful data. Include: fillers (um, uh, er, ah, hmm, mhm, like, you know, I mean), repetitions (I I, the the), restarts (I was- I went), stutters (th-that, b-but, no-not), and informal speech (gonna, wanna, gotta)", +}; + +const run = async () => { + const transcript = await client.transcripts.transcribe(params); + console.log(transcript.text); +}; + +run(); +``` + @@ -413,7 +556,28 @@ You got called because you were being loud and screaming. No, I wasn't. That's l ``` - + + +```python +import assemblyai as aai + +aai.settings.api_key = "" + +audio_file = "https://assemblyaiassets.com/audios/ouput_formatting.mp3" + +config = aai.TranscriptionConfig( + speech_models=["universal-3-pro", "universal-2"], + language_detection=True, + prompt="Add punctuation based on the speaker's tone and expressiveness. Use exclamation marks (!) when the speaker is yelling, excited, or emphatic. Use question marks (?) for questioning intonation. Apply standard punctuation (periods, commas) based on natural speech patterns and pauses.", +) + +transcript = aai.Transcriber().transcribe(audio_file, config) + +print(transcript.text) +``` + + + ```python import requests @@ -450,6 +614,34 @@ while True: time.sleep(3) ``` + + + +```javascript +import { AssemblyAI } from "assemblyai"; + +const client = new AssemblyAI({ + apiKey: "", +}); + +const audioFile = "https://assemblyaiassets.com/audios/ouput_formatting.mp3"; + +const params = { + audio: audioFile, + speech_models: ["universal-3-pro", "universal-2"], + language_detection: true, + prompt: + "Add punctuation based on the speaker's tone and expressiveness. Use exclamation marks (!) when the speaker is yelling, excited, or emphatic. Use question marks (?) for questioning intonation. Apply standard punctuation (periods, commas) based on natural speech patterns and pauses.", +}; + +const run = async () => { + const transcript = await client.transcripts.transcribe(params); + console.log(transcript.text); +}; + +run(); +``` + @@ -528,7 +720,28 @@ I just wanna move you along a bit further. Do you take any prescribed medicines? ``` - + + +```python {11} +import assemblyai as aai + +aai.settings.api_key = "" + +audio_file = "https://assemblyaiassets.com/audios/nlp_prompting.mp3" + +config = aai.TranscriptionConfig( + speech_models=["universal-3-pro", "universal-2"], + language_detection=True, + prompt="Produce a transcript for a clinical history evaluation. It's important to capture medication and dosage accurately. Every disfluency is meaningful data. Include: fillers (um, uh, er, erm, ah, hmm, mhm, like, you know, I mean), repetitions (I I I, the the), restarts (I was- I went), stutters (th-that, b-but, no-not), and informal speech (gonna, wanna, gotta)", +) + +transcript = aai.Transcriber().transcribe(audio_file, config) + +print(transcript.text) +``` + + + ```python {11} import requests @@ -565,6 +778,34 @@ while True: time.sleep(3) ``` + + + +```javascript {12} +import { AssemblyAI } from "assemblyai"; + +const client = new AssemblyAI({ + apiKey: "", +}); + +const audioFile = "https://assemblyaiassets.com/audios/nlp_prompting.mp3"; + +const params = { + audio: audioFile, + speech_models: ["universal-3-pro", "universal-2"], + language_detection: true, + prompt: + "Produce a transcript for a clinical history evaluation. It's important to capture medication and dosage accurately. Every disfluency is meaningful data. Include: fillers (um, uh, er, erm, ah, hmm, mhm, like, you know, I mean), repetitions (I I I, the the), restarts (I was- I went), stutters (th-that, b-but, no-not), and informal speech (gonna, wanna, gotta)", +}; + +const run = async () => { + const transcript = await client.transcripts.transcribe(params); + console.log(transcript.text); +}; + +run(); +``` + @@ -643,7 +884,28 @@ Watch again closely. This is the potential game changer. The first responder NK ``` - + + +```python {11} +import assemblyai as aai + +aai.settings.api_key = "" + +audio_file = "https://assemblyaiassets.com/audios/entity_accuracy.mp3" + +config = aai.TranscriptionConfig( + speech_models=["universal-3-pro", "universal-2"], + language_detection=True, + prompt="The speaker is discussing the cancer drug Anktiva (spelled A-N-K-T-I-V-A). When you hear what sounds like Entiva or similar pronunciations, transcribe it as Anktiva. This is the correct pharmaceutical name.", +) + +transcript = aai.Transcriber().transcribe(audio_file, config) + +print(transcript.text) +``` + + + ```python {11} import requests @@ -680,6 +942,34 @@ while True: time.sleep(3) ``` + + + +```javascript {12} +import { AssemblyAI } from "assemblyai"; + +const client = new AssemblyAI({ + apiKey: "", +}); + +const audioFile = "https://assemblyaiassets.com/audios/entity_accuracy.mp3"; + +const params = { + audio: audioFile, + speech_models: ["universal-3-pro", "universal-2"], + language_detection: true, + prompt: + "The speaker is discussing the cancer drug Anktiva (spelled A-N-K-T-I-V-A). When you hear what sounds like Entiva or similar pronunciations, transcribe it as Anktiva. This is the correct pharmaceutical name.", +}; + +const run = async () => { + const transcript = await client.transcripts.transcribe(params); + console.log(transcript.text); +}; + +run(); +``` + @@ -767,7 +1057,30 @@ With prompt: Without prompting, it may appear that speaker B said everything. But with prompting, the model correctly identifies this as 5 separate speaker turns, capturing utterances as short as a single word, like "good". - + + +```python {12} +import assemblyai as aai + +aai.settings.api_key = "" + +audio_file = "https://assemblyaiassets.com/audios/speaker_diarization.mp3" + +config = aai.TranscriptionConfig( + speech_models=["universal-3-pro", "universal-2"], + language_detection=True, + speaker_labels=True, + prompt="Produce a transcript with every disfluency data. Additionally, label speakers with their respective roles. 1. Place [Speaker:role] at the start of each speaker turn. Example format: [Speaker:NURSE] Hello there. How can I help you today? [Speaker:PATIENT] I'm feeling unwell. I have a headache.", +) + +transcript = aai.Transcriber().transcribe(audio_file, config) + +for utterance in transcript.utterances: + print(f"Speaker {utterance.speaker}: {utterance.text}") +``` + + + ```python {12} import requests @@ -806,6 +1119,38 @@ while True: time.sleep(3) ``` + + + +```javascript {12} +import { AssemblyAI } from "assemblyai"; + +const client = new AssemblyAI({ + apiKey: "", +}); + +const audioFile = "https://assemblyaiassets.com/audios/speaker_diarization.mp3"; + +const params = { + audio: audioFile, + speech_models: ["universal-3-pro", "universal-2"], + language_detection: true, + speaker_labels: true, + prompt: + "Produce a transcript with every disfluency data. Additionally, label speakers with their respective roles. 1. Place [Speaker:role] at the start of each speaker turn. Example format: [Speaker:NURSE] Hello there. How can I help you today? [Speaker:PATIENT] I'm feeling unwell. I have a headache.", +}; + +const run = async () => { + const transcript = await client.transcripts.transcribe(params); + + for (const utterance of transcript.utterances!) { + console.log(`Speaker ${utterance.speaker}: ${utterance.text}`); + } +}; + +run(); +``` + @@ -875,7 +1220,28 @@ Your call has been forwarded to an automatic voice message system. At the tone, Here are some examples of audio tags you can prompt for: [music], [laugher], [applause], [noise], [pause], [inaudible], [sigh], [gasp], [cheering], [sound], [screaming], [bell], [beep], [sound effect], [buzzer], and more. - + + +```python {11} +import assemblyai as aai + +aai.settings.api_key = "" + +audio_file = "https://assemblyaiassets.com/audios/audio_tag.mp3" + +config = aai.TranscriptionConfig( + speech_models=["universal-3-pro", "universal-2"], + language_detection=True, + prompt="Produce a transcript suitable for conversational analysis. Every disfluency is meaningful data. Include: Tag sounds: [beep]", +) + +transcript = aai.Transcriber().transcribe(audio_file, config) + +print(transcript.text) +``` + + + ```python {12} import requests @@ -912,6 +1278,34 @@ while True: time.sleep(3) ``` + + + +```javascript {11} +import { AssemblyAI } from "assemblyai"; + +const client = new AssemblyAI({ + apiKey: "", +}); + +const audioFile = "https://assemblyaiassets.com/audios/audio_tag.mp3"; + +const params = { + audio: audioFile, + speech_models: ["universal-3-pro", "universal-2"], + language_detection: true, + prompt: + "Produce a transcript suitable for conversational analysis. Every disfluency is meaningful data. Include: Tag sounds: [beep]", +}; + +const run = async () => { + const transcript = await client.transcripts.transcribe(params); + console.log(transcript.text); +}; + +run(); +``` + @@ -976,7 +1370,28 @@ You literally lost your French? No, no, no. Mon français est là. L'italien, j' ``` - + + +```python +import assemblyai as aai + +aai.settings.api_key = "" + +audio_file = "https://assemblyaiassets.com/audios/code_switching_multilingual.mp3" + +config = aai.TranscriptionConfig( + speech_models=["universal-3-pro", "universal-2"], + language_detection=True, + prompt="The spoken language may change throughout the audio, transcribe in the original language mix (code-switching), preserving the words in the language they are spoken.", +) + +transcript = aai.Transcriber().transcribe(audio_file, config) + +print(transcript.text) +``` + + + ```python import requests @@ -1013,6 +1428,34 @@ while True: time.sleep(3) ``` + + + +```javascript +import { AssemblyAI } from "assemblyai"; + +const client = new AssemblyAI({ + apiKey: "", +}); + +const audioFile = "https://assemblyaiassets.com/audios/code_switching_multilingual.mp3"; + +const params = { + audio: audioFile, + speech_models: ["universal-3-pro", "universal-2"], + language_detection: true, + prompt: + "The spoken language may change throughout the audio, transcribe in the original language mix (code-switching), preserving the words in the language they are spoken.", +}; + +const run = async () => { + const transcript = await client.transcripts.transcribe(params); + console.log(transcript.text); +}; + +run(); +``` + @@ -1091,7 +1534,28 @@ Commission has presented their communication, a hydrogen strategy for climate-ne ``` - + + +```python +import assemblyai as aai + +aai.settings.api_key = "" + +audio_file = "https://assemblyaiassets.com/audios/numbers_formatting.mp3" + +config = aai.TranscriptionConfig( + speech_models=["universal-3-pro", "universal-2"], + language_detection=True, + prompt="Transcribe with numbers normalized to standard formats. For example, when you see $1 billion, convert to $1,000,000,000.", +) + +transcript = aai.Transcriber().transcribe(audio_file, config) + +print(transcript.text) +``` + + + ```python import requests @@ -1101,7 +1565,7 @@ base_url = "https://api.assemblyai.com" headers = {"authorization": ""} data = { - "audio_url": "https://assemblyaiassets.com/audios/verbatim.mp3", + "audio_url": "https://assemblyaiassets.com/audios/numbers_formatting.mp3", "language_detection": True, "speech_models": ["universal-3-pro", "universal-2"], "prompt": "Transcribe with numbers normalized to standard formats. For example, when you see $1 billion, convert to $1,000,000,000." @@ -1128,6 +1592,34 @@ while True: time.sleep(3) ``` + + + +```javascript +import { AssemblyAI } from "assemblyai"; + +const client = new AssemblyAI({ + apiKey: "", +}); + +const audioFile = "https://assemblyaiassets.com/audios/numbers_formatting.mp3"; + +const params = { + audio: audioFile, + speech_models: ["universal-3-pro", "universal-2"], + language_detection: true, + prompt: + "Transcribe with numbers normalized to standard formats. For example, when you see $1 billion, convert to $1,000,000,000.", +}; + +const run = async () => { + const transcript = await client.transcripts.transcribe(params); + console.log(transcript.text); +}; + +run(); +``` + @@ -1140,11 +1632,11 @@ const headers = { }; const data = { - audio_url: "https://assemblyaiassets.com/audios/verbatim.mp3", + audio_url: "https://assemblyaiassets.com/audios/numbers_formatting.mp3", language_detection: true, speech_models: ["universal-3-pro", "universal-2"], prompt: - "Convert spoken numbers to digits.", + "Transcribe with numbers normalized to standard formats. For example, when you see $1 billion, convert to $1,000,000,000.", }; const url = `${baseUrl}/v2/transcript`; @@ -1206,7 +1698,28 @@ I hope you got our card. [CROSSTALK] Okay, nobody talk. We'll just wait for her ``` - + + +```python +import assemblyai as aai + +aai.settings.api_key = "" + +audio_file = "https://assemblyaiassets.com/audios/Difficult_audio.mp3" + +config = aai.TranscriptionConfig( + speech_models=["universal-3-pro", "universal-2"], + language_detection=True, + prompt="When multiple speakers talk simultaneously, mark crosstalk segments.", +) + +transcript = aai.Transcriber().transcribe(audio_file, config) + +print(transcript.text) +``` + + + ```python import requests @@ -1216,7 +1729,7 @@ base_url = "https://api.assemblyai.com" headers = {"authorization": ""} data = { - "audio_url": "https://assemblyaiassets.com/audios/verbatim.mp3", + "audio_url": "https://assemblyaiassets.com/audios/Difficult_audio.mp3", "language_detection": True, "speech_models": ["universal-3-pro", "universal-2"], "prompt": "When multiple speakers talk simultaneously, mark crosstalk segments." @@ -1243,6 +1756,34 @@ while True: time.sleep(3) ``` + + + +```javascript +import { AssemblyAI } from "assemblyai"; + +const client = new AssemblyAI({ + apiKey: "", +}); + +const audioFile = "https://assemblyaiassets.com/audios/Difficult_audio.mp3"; + +const params = { + audio: audioFile, + speech_models: ["universal-3-pro", "universal-2"], + language_detection: true, + prompt: + "When multiple speakers talk simultaneously, mark crosstalk segments.", +}; + +const run = async () => { + const transcript = await client.transcripts.transcribe(params); + console.log(transcript.text); +}; + +run(); +``` + @@ -1255,11 +1796,11 @@ const headers = { }; const data = { - audio_url: "https://assemblyaiassets.com/audios/verbatim.mp3", + audio_url: "https://assemblyaiassets.com/audios/Difficult_audio.mp3", language_detection: true, speech_models: ["universal-3-pro", "universal-2"], prompt: - "Mark inaudible segments. Preserve overlapping speech and crosstalk.", + "When multiple speakers talk simultaneously, mark crosstalk segments.", }; const url = `${baseUrl}/v2/transcript`; @@ -1315,7 +1856,29 @@ Low non-zero temperatures often produce better transcription accuracy (lower WER - + + +```python +import assemblyai as aai + +aai.settings.api_key = "" + +audio_file = "https://assemblyaiassets.com/audios/nlp_prompting.mp3" + +config = aai.TranscriptionConfig( + speech_models=["universal-3-pro", "universal-2"], + language_detection=True, + prompt="Produce a transcript for a clinical history evaluation. It's important to capture medication and dosage accurately. Every disfluency is meaningful data. Include: fillers (um, uh, er, erm, ah, hmm, mhm, like, you know, I mean), repetitions (I I I, the the), restarts (I was- I went), stutters (th-that, b-but, no-not), and informal speech (gonna, wanna, gotta)", + temperature=0.1, +) + +transcript = aai.Transcriber().transcribe(audio_file, config) + +print(transcript.text) +``` + + + ```python import requests @@ -1353,6 +1916,35 @@ while True: time.sleep(3) ``` + + + +```javascript +import { AssemblyAI } from "assemblyai"; + +const client = new AssemblyAI({ + apiKey: "", +}); + +const audioFile = "https://assemblyaiassets.com/audios/nlp_prompting.mp3"; + +const params = { + audio: audioFile, + speech_models: ["universal-3-pro", "universal-2"], + language_detection: true, + prompt: + "Produce a transcript for a clinical history evaluation. It's important to capture medication and dosage accurately. Every disfluency is meaningful data. Include: fillers (um, uh, er, erm, ah, hmm, mhm, like, you know, I mean), repetitions (I I I, the the), restarts (I was- I went), stutters (th-that, b-but, no-not), and informal speech (gonna, wanna, gotta)", + temperature: 0.1, +}; + +const run = async () => { + const transcript = await client.transcripts.transcribe(params); + console.log(transcript.text); +}; + +run(); +``` + From c4792a445f24d6a9b4b586ecd4c202b398486214 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Wed, 4 Feb 2026 17:15:34 +0000 Subject: [PATCH 2/4] Add syntax highlighting for prompt and temperature parameters in SDK code examples Co-Authored-By: adinoto@assemblyai.com --- .../01-getting-started/universal-3-pro.mdx | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/fern/pages/01-getting-started/universal-3-pro.mdx b/fern/pages/01-getting-started/universal-3-pro.mdx index f432d906..df3f5a67 100644 --- a/fern/pages/01-getting-started/universal-3-pro.mdx +++ b/fern/pages/01-getting-started/universal-3-pro.mdx @@ -558,7 +558,7 @@ You got called because you were being loud and screaming. No, I wasn't. That's l -```python +```python {11} import assemblyai as aai aai.settings.api_key = "" @@ -579,7 +579,7 @@ print(transcript.text) -```python +```python {12} import requests import time @@ -617,7 +617,7 @@ while True: -```javascript +```javascript {13-14} import { AssemblyAI } from "assemblyai"; const client = new AssemblyAI({ @@ -645,7 +645,7 @@ run(); -```javascript +```javascript {12-13} import axios from "axios"; const baseUrl = "https://api.assemblyai.com"; @@ -1372,7 +1372,7 @@ You literally lost your French? No, no, no. Mon français est là. L'italien, j' -```python +```python {11} import assemblyai as aai aai.settings.api_key = "" @@ -1393,7 +1393,7 @@ print(transcript.text) -```python +```python {11} import requests import time @@ -1431,7 +1431,7 @@ while True: -```javascript +```javascript {13-14} import { AssemblyAI } from "assemblyai"; const client = new AssemblyAI({ @@ -1459,7 +1459,7 @@ run(); -```javascript +```javascript {12-13} import axios from "axios"; const baseUrl = "https://api.assemblyai.com"; @@ -1536,7 +1536,7 @@ Commission has presented their communication, a hydrogen strategy for climate-ne -```python +```python {11} import assemblyai as aai aai.settings.api_key = "" @@ -1557,7 +1557,7 @@ print(transcript.text) -```python +```python {11} import requests import time @@ -1595,7 +1595,7 @@ while True: -```javascript +```javascript {13-14} import { AssemblyAI } from "assemblyai"; const client = new AssemblyAI({ @@ -1623,7 +1623,7 @@ run(); -```javascript +```javascript {12-13} import axios from "axios"; const baseUrl = "https://api.assemblyai.com"; @@ -1700,7 +1700,7 @@ I hope you got our card. [CROSSTALK] Okay, nobody talk. We'll just wait for her -```python +```python {11} import assemblyai as aai aai.settings.api_key = "" @@ -1721,7 +1721,7 @@ print(transcript.text) -```python +```python {11} import requests import time @@ -1759,7 +1759,7 @@ while True: -```javascript +```javascript {13-14} import { AssemblyAI } from "assemblyai"; const client = new AssemblyAI({ @@ -1787,7 +1787,7 @@ run(); -```javascript +```javascript {12-13} import axios from "axios"; const baseUrl = "https://api.assemblyai.com"; @@ -1858,7 +1858,7 @@ Low non-zero temperatures often produce better transcription accuracy (lower WER -```python +```python {11-12} import assemblyai as aai aai.settings.api_key = "" @@ -1880,7 +1880,7 @@ print(transcript.text) -```python +```python {11-12} import requests import time @@ -1919,7 +1919,7 @@ while True: -```javascript +```javascript {13-15} import { AssemblyAI } from "assemblyai"; const client = new AssemblyAI({ @@ -1948,7 +1948,7 @@ run(); -```javascript +```javascript {12-14} import axios from "axios"; const baseUrl = "https://api.assemblyai.com"; From 27d4a1811026c3682725ef49c725e5f03c23cb6b Mon Sep 17 00:00:00 2001 From: Amanda DiNoto Date: Thu, 5 Feb 2026 15:23:09 -0500 Subject: [PATCH 3/4] correct line highlighting for each code block --- .../01-getting-started/universal-3-pro.mdx | 122 ++++++++---------- 1 file changed, 52 insertions(+), 70 deletions(-) diff --git a/fern/pages/01-getting-started/universal-3-pro.mdx b/fern/pages/01-getting-started/universal-3-pro.mdx index df3f5a67..7a6e621b 100644 --- a/fern/pages/01-getting-started/universal-3-pro.mdx +++ b/fern/pages/01-getting-started/universal-3-pro.mdx @@ -235,7 +235,7 @@ Hi, this is Kelly Byrne-Donoghue -```python {11} +```python {10} import assemblyai as aai aai.settings.api_key = "" @@ -256,7 +256,7 @@ print(transcript.text) -```python {10} +```python {11} import requests import time @@ -294,7 +294,7 @@ while True: -```javascript {12} +```javascript {13} import { AssemblyAI } from "assemblyai"; const client = new AssemblyAI({ @@ -321,7 +321,7 @@ run(); -```javascript {11} +```javascript {12} import axios from "axios"; const baseUrl = "https://api.assemblyai.com"; @@ -387,7 +387,7 @@ Do you and Quentin still socialize, uh, when you come to Los Angeles, or is it l -```python {11} +```python {10} import assemblyai as aai aai.settings.api_key = "" @@ -446,7 +446,7 @@ while True: -```javascript {12} +```javascript {13} import { AssemblyAI } from "assemblyai"; const client = new AssemblyAI({ @@ -459,8 +459,7 @@ const params = { audio: audioFile, speech_models: ["universal-3-pro", "universal-2"], language_detection: true, - prompt: - "Produce a transcript suitable for conversational analysis. Every disfluency is meaningful data. Include: fillers (um, uh, er, ah, hmm, mhm, like, you know, I mean), repetitions (I I, the the), restarts (I was- I went), stutters (th-that, b-but, no-not), and informal speech (gonna, wanna, gotta)", + prompt: "Produce a transcript suitable for conversational analysis. Every disfluency is meaningful data. Include: fillers (um, uh, er, ah, hmm, mhm, like, you know, I mean), repetitions (I I, the the), restarts (I was- I went), stutters (th-that, b-but, no-not), and informal speech (gonna, wanna, gotta)", }; const run = async () => { @@ -486,8 +485,7 @@ const data = { audio_url: "https://assemblyaiassets.com/audios/verbatim.mp3", language_detection: true, speech_models: ["universal-3-pro", "universal-2"], - prompt: - "Produce a transcript suitable for conversational analysis. Every disfluency is meaningful data. Include: fillers (um, uh, er, ah, hmm, mhm, like, you know, I mean), repetitions (I I, the the), restarts (I was- I went), stutters (th-that, b-but, no-not), and informal speech (gonna, wanna, gotta)", + prompt: "Produce a transcript suitable for conversational analysis. Every disfluency is meaningful data. Include: fillers (um, uh, er, ah, hmm, mhm, like, you know, I mean), repetitions (I I, the the), restarts (I was- I went), stutters (th-that, b-but, no-not), and informal speech (gonna, wanna, gotta)", }; const url = `${baseUrl}/v2/transcript`; @@ -558,7 +556,7 @@ You got called because you were being loud and screaming. No, I wasn't. That's l -```python {11} +```python {10} import assemblyai as aai aai.settings.api_key = "" @@ -579,7 +577,7 @@ print(transcript.text) -```python {12} +```python {11} import requests import time @@ -617,7 +615,7 @@ while True: -```javascript {13-14} +```javascript {13} import { AssemblyAI } from "assemblyai"; const client = new AssemblyAI({ @@ -630,8 +628,7 @@ const params = { audio: audioFile, speech_models: ["universal-3-pro", "universal-2"], language_detection: true, - prompt: - "Add punctuation based on the speaker's tone and expressiveness. Use exclamation marks (!) when the speaker is yelling, excited, or emphatic. Use question marks (?) for questioning intonation. Apply standard punctuation (periods, commas) based on natural speech patterns and pauses.", + prompt: "Add punctuation based on the speaker's tone and expressiveness. Use exclamation marks (!) when the speaker is yelling, excited, or emphatic. Use question marks (?) for questioning intonation. Apply standard punctuation (periods, commas) based on natural speech patterns and pauses.", }; const run = async () => { @@ -645,7 +642,7 @@ run(); -```javascript {12-13} +```javascript {12} import axios from "axios"; const baseUrl = "https://api.assemblyai.com"; @@ -657,8 +654,7 @@ const data = { audio_url: "https://assemblyaiassets.com/audios/ouput_formatting.mp3", language_detection: true, speech_models: ["universal-3-pro", "universal-2"], - prompt: - "Add punctuation based on the speaker's tone and expressiveness. Use exclamation marks (!) when the speaker is yelling, excited, or emphatic. Use question marks (?) for questioning intonation. Apply standard punctuation (periods, commas) based on natural speech patterns and pauses.", + prompt: "Add punctuation based on the speaker's tone and expressiveness. Use exclamation marks (!) when the speaker is yelling, excited, or emphatic. Use question marks (?) for questioning intonation. Apply standard punctuation (periods, commas) based on natural speech patterns and pauses.", }; const url = `${baseUrl}/v2/transcript`; @@ -722,7 +718,7 @@ I just wanna move you along a bit further. Do you take any prescribed medicines? -```python {11} +```python {10} import assemblyai as aai aai.settings.api_key = "" @@ -781,7 +777,7 @@ while True: -```javascript {12} +```javascript {13} import { AssemblyAI } from "assemblyai"; const client = new AssemblyAI({ @@ -794,8 +790,7 @@ const params = { audio: audioFile, speech_models: ["universal-3-pro", "universal-2"], language_detection: true, - prompt: - "Produce a transcript for a clinical history evaluation. It's important to capture medication and dosage accurately. Every disfluency is meaningful data. Include: fillers (um, uh, er, erm, ah, hmm, mhm, like, you know, I mean), repetitions (I I I, the the), restarts (I was- I went), stutters (th-that, b-but, no-not), and informal speech (gonna, wanna, gotta)", + prompt: "Produce a transcript for a clinical history evaluation. It's important to capture medication and dosage accurately. Every disfluency is meaningful data. Include: fillers (um, uh, er, erm, ah, hmm, mhm, like, you know, I mean), repetitions (I I I, the the), restarts (I was- I went), stutters (th-that, b-but, no-not), and informal speech (gonna, wanna, gotta)", }; const run = async () => { @@ -821,8 +816,7 @@ const data = { audio_url: "https://assemblyaiassets.com/audios/nlp_prompting.mp3", language_detection: true, speech_models: ["universal-3-pro", "universal-2"], - prompt: - "Produce a transcript for a clinical history evaluation. It's important to capture medication and dosage accurately. Every disfluency is meaningful data. Include: fillers (um, uh, er, erm, ah, hmm, mhm, like, you know, I mean), repetitions (I I I, the the), restarts (I was- I went), stutters (th-that, b-but, no-not), and informal speech (gonna, wanna, gotta)", + prompt: "Produce a transcript for a clinical history evaluation. It's important to capture medication and dosage accurately. Every disfluency is meaningful data. Include: fillers (um, uh, er, erm, ah, hmm, mhm, like, you know, I mean), repetitions (I I I, the the), restarts (I was- I went), stutters (th-that, b-but, no-not), and informal speech (gonna, wanna, gotta)", }; const url = `${baseUrl}/v2/transcript`; @@ -886,7 +880,7 @@ Watch again closely. This is the potential game changer. The first responder NK -```python {11} +```python {10} import assemblyai as aai aai.settings.api_key = "" @@ -945,7 +939,7 @@ while True: -```javascript {12} +```javascript {13} import { AssemblyAI } from "assemblyai"; const client = new AssemblyAI({ @@ -958,8 +952,7 @@ const params = { audio: audioFile, speech_models: ["universal-3-pro", "universal-2"], language_detection: true, - prompt: - "The speaker is discussing the cancer drug Anktiva (spelled A-N-K-T-I-V-A). When you hear what sounds like Entiva or similar pronunciations, transcribe it as Anktiva. This is the correct pharmaceutical name.", + prompt: "The speaker is discussing the cancer drug Anktiva (spelled A-N-K-T-I-V-A). When you hear what sounds like Entiva or similar pronunciations, transcribe it as Anktiva. This is the correct pharmaceutical name.", }; const run = async () => { @@ -985,8 +978,7 @@ const data = { audio_url: "https://assemblyaiassets.com/audios/entity_accuracy.mp3", language_detection: true, speech_models: ["universal-3-pro", "universal-2"], - prompt: - "The speaker is discussing the cancer drug Anktiva (spelled A-N-K-T-I-V-A). When you hear what sounds like Entiva or similar pronunciations, transcribe it as Anktiva. This is the correct pharmaceutical name.", + prompt: "The speaker is discussing the cancer drug Anktiva (spelled A-N-K-T-I-V-A). When you hear what sounds like Entiva or similar pronunciations, transcribe it as Anktiva. This is the correct pharmaceutical name.", }; const url = `${baseUrl}/v2/transcript`; @@ -1059,7 +1051,7 @@ Without prompting, it may appear that speaker B said everything. But with prompt -```python {12} +```python {11} import assemblyai as aai aai.settings.api_key = "" @@ -1122,7 +1114,7 @@ while True: -```javascript {12} +```javascript {14} import { AssemblyAI } from "assemblyai"; const client = new AssemblyAI({ @@ -1136,8 +1128,7 @@ const params = { speech_models: ["universal-3-pro", "universal-2"], language_detection: true, speaker_labels: true, - prompt: - "Produce a transcript with every disfluency data. Additionally, label speakers with their respective roles. 1. Place [Speaker:role] at the start of each speaker turn. Example format: [Speaker:NURSE] Hello there. How can I help you today? [Speaker:PATIENT] I'm feeling unwell. I have a headache.", + prompt: "Produce a transcript with every disfluency data. Additionally, label speakers with their respective roles. 1. Place [Speaker:role] at the start of each speaker turn. Example format: [Speaker:NURSE] Hello there. How can I help you today? [Speaker:PATIENT] I'm feeling unwell. I have a headache.", }; const run = async () => { @@ -1154,7 +1145,7 @@ run(); -```javascript {12} +```javascript {13} import axios from "axios"; const baseUrl = "https://api.assemblyai.com"; @@ -1167,8 +1158,7 @@ const data = { language_detection: true, speech_models: ["universal-3-pro", "universal-2"], speaker_labels: true, - prompt: - "Produce a transcript with every disfluency data. Additionally, label speakers with their respective roles. 1. Place [Speaker:role] at the start of each speaker turn. Example format: [Speaker:NURSE] Hello there. How can I help you today? [Speaker:PATIENT] I'm feeling unwell. I have a headache.", + prompt: "Produce a transcript with every disfluency data. Additionally, label speakers with their respective roles. 1. Place [Speaker:role] at the start of each speaker turn. Example format: [Speaker:NURSE] Hello there. How can I help you today? [Speaker:PATIENT] I'm feeling unwell. I have a headache.", }; const url = `${baseUrl}/v2/transcript`; @@ -1222,7 +1212,7 @@ Here are some examples of audio tags you can prompt for: [music], [laugher], [ap -```python {11} +```python {10} import assemblyai as aai aai.settings.api_key = "" @@ -1243,7 +1233,7 @@ print(transcript.text) -```python {12} +```python {11} import requests import time @@ -1281,7 +1271,7 @@ while True: -```javascript {11} +```javascript {13} import { AssemblyAI } from "assemblyai"; const client = new AssemblyAI({ @@ -1294,8 +1284,7 @@ const params = { audio: audioFile, speech_models: ["universal-3-pro", "universal-2"], language_detection: true, - prompt: - "Produce a transcript suitable for conversational analysis. Every disfluency is meaningful data. Include: Tag sounds: [beep]", + prompt: "Produce a transcript suitable for conversational analysis. Every disfluency is meaningful data. Include: Tag sounds: [beep]", }; const run = async () => { @@ -1309,7 +1298,7 @@ run(); -```javascript {13} +```javascript {12} import axios from "axios"; const baseUrl = "https://api.assemblyai.com"; @@ -1321,8 +1310,7 @@ const data = { audio_url: "https://assemblyaiassets.com/audios/audio_tag.mp3", language_detection: true, speech_models: ["universal-3-pro", "universal-2"], - prompt: - "Produce a transcript suitable for conversational analysis. Every disfluency is meaningful data. Include: Tag sounds: [beep]", + prompt: "Produce a transcript suitable for conversational analysis. Every disfluency is meaningful data. Include: Tag sounds: [beep]", }; const url = `${baseUrl}/v2/transcript`; @@ -1372,7 +1360,7 @@ You literally lost your French? No, no, no. Mon français est là. L'italien, j' -```python {11} +```python {10} import assemblyai as aai aai.settings.api_key = "" @@ -1431,7 +1419,7 @@ while True: -```javascript {13-14} +```javascript {13} import { AssemblyAI } from "assemblyai"; const client = new AssemblyAI({ @@ -1444,8 +1432,7 @@ const params = { audio: audioFile, speech_models: ["universal-3-pro", "universal-2"], language_detection: true, - prompt: - "The spoken language may change throughout the audio, transcribe in the original language mix (code-switching), preserving the words in the language they are spoken.", + prompt: "The spoken language may change throughout the audio, transcribe in the original language mix (code-switching), preserving the words in the language they are spoken.", }; const run = async () => { @@ -1459,7 +1446,7 @@ run(); -```javascript {12-13} +```javascript {12} import axios from "axios"; const baseUrl = "https://api.assemblyai.com"; @@ -1471,8 +1458,7 @@ const data = { audio_url: "https://assemblyaiassets.com/audios/code_switching_multilingual.mp3", language_detection: true, speech_models: ["universal-3-pro", "universal-2"], - prompt: - "The spoken language may change throughout the audio, transcribe in the original language mix (code-switching), preserving the words in the language they are spoken.", + prompt: "The spoken language may change throughout the audio, transcribe in the original language mix (code-switching), preserving the words in the language they are spoken.", }; const url = `${baseUrl}/v2/transcript`; @@ -1536,7 +1522,7 @@ Commission has presented their communication, a hydrogen strategy for climate-ne -```python {11} +```python {10} import assemblyai as aai aai.settings.api_key = "" @@ -1595,7 +1581,7 @@ while True: -```javascript {13-14} +```javascript {13} import { AssemblyAI } from "assemblyai"; const client = new AssemblyAI({ @@ -1608,8 +1594,7 @@ const params = { audio: audioFile, speech_models: ["universal-3-pro", "universal-2"], language_detection: true, - prompt: - "Transcribe with numbers normalized to standard formats. For example, when you see $1 billion, convert to $1,000,000,000.", + prompt: "Transcribe with numbers normalized to standard formats. For example, when you see $1 billion, convert to $1,000,000,000.", }; const run = async () => { @@ -1623,7 +1608,7 @@ run(); -```javascript {12-13} +```javascript {12} import axios from "axios"; const baseUrl = "https://api.assemblyai.com"; @@ -1635,8 +1620,7 @@ const data = { audio_url: "https://assemblyaiassets.com/audios/numbers_formatting.mp3", language_detection: true, speech_models: ["universal-3-pro", "universal-2"], - prompt: - "Transcribe with numbers normalized to standard formats. For example, when you see $1 billion, convert to $1,000,000,000.", + prompt: "Transcribe with numbers normalized to standard formats. For example, when you see $1 billion, convert to $1,000,000,000.", }; const url = `${baseUrl}/v2/transcript`; @@ -1700,7 +1684,7 @@ I hope you got our card. [CROSSTALK] Okay, nobody talk. We'll just wait for her -```python {11} +```python {10} import assemblyai as aai aai.settings.api_key = "" @@ -1759,7 +1743,7 @@ while True: -```javascript {13-14} +```javascript {13} import { AssemblyAI } from "assemblyai"; const client = new AssemblyAI({ @@ -1772,8 +1756,7 @@ const params = { audio: audioFile, speech_models: ["universal-3-pro", "universal-2"], language_detection: true, - prompt: - "When multiple speakers talk simultaneously, mark crosstalk segments.", + prompt: "When multiple speakers talk simultaneously, mark crosstalk segments.", }; const run = async () => { @@ -1787,7 +1770,7 @@ run(); -```javascript {12-13} +```javascript {12} import axios from "axios"; const baseUrl = "https://api.assemblyai.com"; @@ -1799,8 +1782,7 @@ const data = { audio_url: "https://assemblyaiassets.com/audios/Difficult_audio.mp3", language_detection: true, speech_models: ["universal-3-pro", "universal-2"], - prompt: - "When multiple speakers talk simultaneously, mark crosstalk segments.", + prompt: "When multiple speakers talk simultaneously, mark crosstalk segments.", }; const url = `${baseUrl}/v2/transcript`; @@ -1858,7 +1840,7 @@ Low non-zero temperatures often produce better transcription accuracy (lower WER -```python {11-12} +```python {11} import assemblyai as aai aai.settings.api_key = "" @@ -1880,7 +1862,7 @@ print(transcript.text) -```python {11-12} +```python {12} import requests import time @@ -1919,7 +1901,7 @@ while True: -```javascript {13-15} +```javascript {15} import { AssemblyAI } from "assemblyai"; const client = new AssemblyAI({ @@ -1948,7 +1930,7 @@ run(); -```javascript {12-14} +```javascript {14} import axios from "axios"; const baseUrl = "https://api.assemblyai.com"; From 4935dc53e41a14d39832d19ebb350e3c13101160 Mon Sep 17 00:00:00 2001 From: Amanda DiNoto Date: Thu, 5 Feb 2026 15:32:23 -0500 Subject: [PATCH 4/4] add note about prompt and keyterms --- fern/pages/01-getting-started/universal-3-pro.mdx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/fern/pages/01-getting-started/universal-3-pro.mdx b/fern/pages/01-getting-started/universal-3-pro.mdx index 7a6e621b..c3013364 100644 --- a/fern/pages/01-getting-started/universal-3-pro.mdx +++ b/fern/pages/01-getting-started/universal-3-pro.mdx @@ -366,6 +366,12 @@ while (true) { Universal-3 Pro delivers great accuracy out of the box. To fine-tune transcription results to your use case, provide a prompt with up to 1,500 words of context in plain language. This helps the model consistently recognize domain-specific terminology, apply your preferred formatting conventions, handle code switching between languages, and better interpret ambiguous speech. + + +`prompt` and `keyterms_prompt` cannot be used in the same request. + + + ### Verbatim transcription and disfluencies Capture natural speech patterns exactly as spoken, including um, uh, false starts, repetitions, stutters. Add examples of the verbatim elements you want to transcribe in the prompt parameter to guide the model.