Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions fern/pages/audio-intelligence/content-moderation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ response = requests.post(url, json=data, headers=headers)
transcript_id = response.json()['id']
polling_endpoint = base_url + "/v2/transcript/" + transcript_id

print(f"Transcript ID:", transcript_id)
print(f"Transcript ID: {transcript_id}")

while True:
transcription_result = requests.get(polling_endpoint, headers=headers).json()
Expand Down Expand Up @@ -143,7 +143,7 @@ config = aai.TranscriptionConfig(

transcript = aai.Transcriber().transcribe(audio_file, config)

print(f"Transcript ID:", transcript.id)
print(f"Transcript ID: {transcript.id}")

for result in transcript.content_safety.results:
print(result.text)
Expand Down
4 changes: 2 additions & 2 deletions fern/pages/audio-intelligence/entity-detection.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ response = requests.post(url, json=data, headers=headers)
transcript_id = response.json()['id']
polling_endpoint = base_url + "/v2/transcript/" + transcript_id

print(f"Transcript ID:", transcript_id)
print(f"Transcript ID: {transcript_id}")

while True:
transcription_result = requests.get(polling_endpoint, headers=headers).json()
Expand Down Expand Up @@ -183,7 +183,7 @@ config = aai.TranscriptionConfig(
)

transcript = aai.Transcriber().transcribe(audio_file, config)
print(f"Transcript ID:", transcript.id)
print(f"Transcript ID: {transcript.id}")

for entity in transcript.entities:
print(entity.text)
Expand Down
4 changes: 2 additions & 2 deletions fern/pages/audio-intelligence/key-phrases.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ response = requests.post(url, json=data, headers=headers)
transcript_id = response.json()['id']
polling_endpoint = base_url + "/v2/transcript/" + transcript_id

print(f"Transcript ID:", transcript_id)
print(f"Transcript ID: {transcript_id}")

while True:
transcription_result = requests.get(polling_endpoint, headers=headers).json()
Expand Down Expand Up @@ -127,7 +127,7 @@ config = aai.TranscriptionConfig(
)

transcript = aai.Transcriber().transcribe(audio_file, config)
print(f"Transcript ID:", transcript.id)
print(f"Transcript ID: {transcript.id}")

for result in transcript.auto_highlights.results:
print(f"Highlight: {result.text}, Count: {result.count}, Rank: {result.rank}, Timestamps: {result.timestamps}")
Expand Down
4 changes: 2 additions & 2 deletions fern/pages/audio-intelligence/pii-redaction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ response = requests.post(url, json=data, headers=headers)
transcript_id = response.json()['id']
polling_endpoint = base_url + "/v2/transcript/" + transcript_id

print(f"Transcript ID:", transcript_id)
print(f"Transcript ID: {transcript_id}")

while True:
transcription_result = requests.get(polling_endpoint, headers=headers).json()
Expand Down Expand Up @@ -192,7 +192,7 @@ config = aai.TranscriptionConfig(
)

transcript = aai.Transcriber().transcribe(audio_file, config)
print(f"Transcript ID:", transcript.id)
print(f"Transcript ID: {transcript.id}")

print(transcript.text)
```
Expand Down
4 changes: 2 additions & 2 deletions fern/pages/audio-intelligence/sentiment-analysis.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ response = requests.post(url, json=data, headers=headers)
transcript_id = response.json()['id']
polling_endpoint = base_url + "/v2/transcript/" + transcript_id

print(f"Transcript ID:", transcript_id)
print(f"Transcript ID: {transcript_id}")

while True:
transcription_result = requests.get(polling_endpoint, headers=headers).json()
Expand Down Expand Up @@ -122,7 +122,7 @@ config = aai.TranscriptionConfig(
)

transcript = aai.Transcriber().transcribe(audio_file, config)
print(f"Transcript ID:", transcript.id)
print(f"Transcript ID: {transcript.id}")

for sentiment_result in transcript.sentiment_analysis:
print(sentiment_result.text)
Expand Down
4 changes: 2 additions & 2 deletions fern/pages/audio-intelligence/topic-detection.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ response = requests.post(url, json=data, headers=headers)
transcript_id = response.json()['id']
polling_endpoint = base_url + "/v2/transcript/" + transcript_id

print(f"Transcript ID:", transcript_id)
print(f"Transcript ID: {transcript_id}")

while True:
transcription_result = requests.get(polling_endpoint, headers=headers).json()
Expand Down Expand Up @@ -133,7 +133,7 @@ config = aai.TranscriptionConfig(
)

transcript = aai.Transcriber().transcribe(audio_file, config)
print(f"Transcript ID:", transcript.id)
print(f"Transcript ID: {transcript.id}")

# Get the parts of the transcript that were tagged with topics
for result in transcript.iab_categories.results:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Install the SDK:
npm install assemblyai
```

```python
```bash
pip install assemblyai
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Before we begin, make sure you have an AssemblyAI account and an API key. You ca

Install the SDK.

```python
```bash
pip install -U assemblyai
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@ pip show assemblyai

If this version is not the same as the current version of the [Python SDK](https://github.com/AssemblyAI/assemblyai-python-sdk) then you can update your version by typing this code in your terminal:

```python
```bash
pip install assemblyai --upgrade
```

</Tab>
<Tab language="javascript" title="JavaScript">
```js
```bash
npm info assemblyai version
```

If this version is not the same as the current version of the [JavaScript SDK](https://github.com/AssemblyAI/assemblyai-node-sdk) then you can update your version by typing this code in your terminal:

```js
```bash
npm update assemblyai --save
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ while True:
transcript = requests.get(polling_endpoint, headers=headers).json()

if transcript['status'] == 'done':
print(f"Full Transcript:", transcript['result']['transcription']['full_transcript'])
print(f"Full Transcript: {transcript['result']['transcription']['full_transcript']}")
break

elif transcript['status'] == 'error':
Expand Down Expand Up @@ -103,7 +103,7 @@ while True:
transcript = requests.get(polling_endpoint, headers=headers).json()

if transcript['status'] == 'completed':
print(f"Full Transcript:", transcript['text'])
print(f"Full Transcript: {transcript['text']}")
break

elif transcript['status'] == 'error':
Expand Down Expand Up @@ -248,7 +248,7 @@ while True:
transcript = requests.get(polling_endpoint, headers=headers).json()

if transcript['status'] == 'done':
print(f"Full Transcript:", transcript['result']['transcription']['full_transcript'])
print(f"Full Transcript: {transcript['result']['transcription']['full_transcript']}")
break

elif transcript['status'] == 'error':
Expand Down Expand Up @@ -284,7 +284,7 @@ while True:
transcript = requests.get(polling_endpoint, headers=headers).json()

if transcript['status'] == 'completed':
print(f"Full Transcript:", transcript['text'])
print(f"Full Transcript: {transcript['text']}")
break

elif transcript['status'] == 'error':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ print("SRT file generated.")

## Step-by-Step Instructions

```python
```bash
pip install -U assemblyai

```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ The entire source code of this guide can be viewed [here](https://github.com/Ass

Install the SDK.

```python
```bash
pip install -U assemblyai
```

Expand Down
2 changes: 1 addition & 1 deletion fern/pages/guides/cookbooks/lemur/input-text-chapters.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ polling_endpoint = base_url + "/v2/transcript/" + transcript_id
while True:
transcription_result = requests.get(polling_endpoint, headers=headers).json()
if transcription_result['status'] == 'completed':
print(f"Transcript ID:", transcript_id)
print(f"Transcript ID: {transcript_id}")
break
elif transcription_result['status'] == 'error':
raise RuntimeError(f"Transcription failed: {transcription_result['error']}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ In this guide, we will include Speaker Labels to the conversation by using the `

Install the SDK.

```python
```bash
pip install -U assemblyai
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ while True:
transcription_result = requests.get(polling_endpoint, headers=headers).json()

if transcription_result['status'] == 'completed':
print(f"Transcript ID:", transcript_id)
print(f"Transcript ID: {transcript_id}")
break

elif transcription_result['status'] == 'error':
Expand Down
2 changes: 1 addition & 1 deletion fern/pages/guides/cookbooks/lemur/soap-note-generation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ response = requests.post(url, json=data, headers=headers)
transcript_id = response.json()['id']
polling_endpoint = base_url + "/v2/transcript/" + transcript_id

print(f"Transcript ID:", transcript_id)
print(f"Transcript ID: {transcript_id}")

while True:
transcription_result = requests.get(polling_endpoint, headers=headers).json()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ In this guide, you'll use AssemblyAI to transcribe a meeting recording. Then, yo

Install the SDK.

```python
```bash
pip install -U assemblyai
```

Expand All @@ -33,7 +33,7 @@ pip install -U assemblyai

Install the SDK.

```javascript
```bash
npm install assemblyai
```

Expand Down
31 changes: 14 additions & 17 deletions fern/pages/guides/generating-subtitles-for-videos.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -65,25 +65,25 @@ request.
<Tab language="python" title="Python (requests)">

```python



import requests
import time
```

</Tab>
<Tab language="python-sdk" title="Python SDK">

Install the SDK.

```python
```bash
pip install -U assemblyai
```

</Tab>
<Tab language="javascript" title="JavaScript">

```javascript

import axios from "axios";
import fs from "fs-extra";
```

</Tab>
Expand All @@ -105,7 +105,7 @@ key.
<Tab language="python" title="Python (requests)">

```python
base_url = "https://api.assemblyai.com/v2"
base_url = "https://api.assemblyai.com"

headers = {
"authorization": "<YOUR_API_KEY>"
Expand All @@ -125,7 +125,7 @@ aai.settings.api_key = "<YOUR_API_KEY>"
<Tab language="javascript" title="JavaScript">

```javascript
const baseUrl = "https://api.assemblyai.com/v2";
const baseUrl = "https://api.assemblyai.com";

const headers = {
authorization: "<YOUR_API_KEY>",
Expand Down Expand Up @@ -156,7 +156,7 @@ Create a `Transcriber` object.

```python
with open("./my-audio.mp3", "rb") as f:
response = requests.post(base_url + "/upload",
response = requests.post(base_url + "/v2/upload",
headers=headers,
data=f)

Expand All @@ -176,7 +176,7 @@ transcriber = aai.Transcriber()
```javascript
const path = "./my-audio.mp3";
const audioData = await fs.readFile(path);
const uploadResponse = await axios.post(`${baseUrl}/upload`, audioData, {
const uploadResponse = await axios.post(`${baseUrl}/v2/upload`, audioData, {
headers,
});
const uploadUrl = uploadResponse.data.upload_url;
Expand Down Expand Up @@ -252,7 +252,7 @@ headers.
<Tab language="python" title="Python (requests)">

```python
url = base_url + "/transcript"
url = base_url + "/v2/transcript"
response = requests.post(url, json=data, headers=headers)
```

Expand All @@ -267,7 +267,7 @@ transcript = transcriber.transcribe("https://example.org/audio.mp3")
<Tab language="javascript" title="JavaScript">

```javascript
const url = `${baseUrl}/transcript`;
const url = `${baseUrl}/v2/transcript`;
const response = await axios.post(url, data, { headers: headers });
```

Expand Down Expand Up @@ -398,10 +398,7 @@ print(transcript.export_subtitles_vtt())
<Tab language="javascript" title="JavaScript">

```javascript
async function getSubtitleFile(
transcriptId: string,
fileFormat: "srt"
): Promise<string> {
async function getSubtitleFile(transcriptId, fileFormat) {
if (!["srt", "vtt"].includes(fileFormat)) {
throw new Error(
`Unsupported file format: ${fileFormat}. Please specify 'srt' or 'vtt'.`
Expand All @@ -411,9 +408,9 @@ async function getSubtitleFile(
const url = `https://api.assemblyai.com/v2/transcript/${transcriptId}/${fileFormat}`;

try {
const response = await axios.get<string>(url, { headers });
const response = await axios.get(url, { headers });
return response.data;
} catch (error: any) {
} catch (error) {
throw new Error(
`Failed to retrieve ${fileFormat.toUpperCase()} file: ${
error.response?.status
Expand Down
Loading
Loading