Skip to content

Commit 25186f5

Browse files
committed
Check precommit in GH workflow
1 parent 7366870 commit 25186f5

35 files changed

+1417
-1395
lines changed

.github/workflows/ci.yml

+8-4
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,15 @@ jobs:
1111

1212
- name: Install pnpm
1313
uses: pnpm/action-setup@v4
14-
with:
15-
version: 8
1614

17-
- name: Run precommit
18-
run: pnpm run precommit
15+
- name: Install dependencies
16+
run: pnpm install --frozen-lockfile
17+
18+
- name: Convert specs to JSON
19+
run: pnpm run to-json
20+
21+
- name: Format files
22+
run: pnpm run format
1923

2024
- name: Check for uncommitted changes
2125
run: |

.prettierignore

+2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
pnpm-lock.yaml
22
jupyter-to-mdx.py
3+
.gitignore
4+
.prettierignore

.prettierrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{ "semi": true, "tabWidth": 2, "singleQuote": false, "trailingComma": "es5" }

.spectral.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
extends: ["spectral:oas", "spectral:asyncapi"]
22
overrides:
33
- files:
4-
- "openapi.yml"
5-
- "asyncapi.yml"
4+
- "openapi.yml"
5+
- "asyncapi.yml"
66
rules:
77
oas3-valid-schema-example: "off"
88
asyncapi-payload-examples: "off"

cookbook-master/core-transcription/automatic-language-detection-route-default-language-js.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,11 @@ const run = async (params) => {
6262
if (transcript.status === "error") {
6363
if (
6464
transcript.error.includes(
65-
"below the requested confidence threshold value",
65+
"below the requested confidence threshold value"
6666
)
6767
) {
6868
console.log(
69-
`${transcript.error}. Running transcript again with language set to '${default_language}'.`,
69+
`${transcript.error}. Running transcript again with language set to '${default_language}'.`
7070
);
7171
params = {
7272
...params,

cookbook-master/core-transcription/detecting-low-confidence-words.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,15 @@ Next, we will filter the sentences array down to just sentences that contain wor
4747
const sentencesWithLowConfidenceWords = (sentences, confidenceThreshold) => {
4848
return sentences.filter((sentence) => {
4949
const hasLowConfidenceWord = sentence.words.some(
50-
(word) => word.confidence < confidenceThreshold,
50+
(word) => word.confidence < confidenceThreshold
5151
);
5252
return hasLowConfidenceWord;
5353
});
5454
};
5555

5656
const filteredSentences = sentencesWithLowConfidenceWords(
5757
sentences,
58-
confidenceThreshold,
58+
confidenceThreshold
5959
);
6060
```
6161

cookbook-master/core-transcription/do-more-with-sdk-js.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ const allTranscriptsResponse = await fetch(
7878
headers: {
7979
Authorization: "<YOUR_API_KEY>",
8080
},
81-
},
81+
}
8282
);
8383
const allTranscripts = await allTranscriptsResponse.json();
8484
console.log(allTranscripts);
@@ -96,7 +96,7 @@ const transcriptResponse = await fetch(
9696
headers: {
9797
Authorization: "<YOUR_API_KEY>",
9898
},
99-
},
99+
}
100100
);
101101
const previousTranscript = await transcriptResponse.json();
102102
console.log(previousTranscript);

cookbook-master/streaming-stt/file-transcription-nodejs/stream_api.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const ASSEMBLY_API_KEY = "YOUR_API_KEY";
55

66
if (ASSEMBLY_API_KEY === "YOUR_API_KEY") {
77
throw console.error(
8-
"Please set your AssemblyAI API key in the ASSEMBLY_API_KEY variable.",
8+
"Please set your AssemblyAI API key in the ASSEMBLY_API_KEY variable."
99
);
1010
}
1111

@@ -69,7 +69,7 @@ function transcribeFile(filePath) {
6969
});
7070

7171
console.log(
72-
`Got socket close event type=${event.type} code=${event.code} reason="${event.reason}" wasClean=${event.wasClean}`,
72+
`Got socket close event type=${event.type} code=${event.code} reason="${event.reason}" wasClean=${event.wasClean}`
7373
);
7474
};
7575

fern/kapa.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ window.Kapa(
7171
rudderanalytics.track("docs_click_search-ask-ai", {
7272
search_query: question,
7373
});
74-
},
74+
}
7575
);
7676

7777
// track event for kapa modal search result clicking "ask ai" completing
@@ -81,7 +81,7 @@ window.Kapa(
8181
rudderanalytics.track("docs_completed_search-ask-ai", {
8282
search_query: question,
8383
});
84-
},
84+
}
8585
);
8686

8787
// track event for kapa modal search result clicked from "ask ai" answer text
@@ -92,7 +92,7 @@ window.Kapa(
9292
search_query: question,
9393
clicked_url: href,
9494
});
95-
},
95+
}
9696
);
9797

9898
// track event for kapa modal search result clicked from "ask ai" answer sources
@@ -104,7 +104,7 @@ window.Kapa(
104104
clicked_url: source.url,
105105
clicked_title: source.title,
106106
});
107-
},
107+
}
108108
);
109109

110110
function insertKapa() {
@@ -120,21 +120,21 @@ function insertKapa() {
120120
script.async = true;
121121
script.setAttribute(
122122
"data-website-id",
123-
"42353092-36d7-42bd-a213-6fd7af0de0cd",
123+
"42353092-36d7-42bd-a213-6fd7af0de0cd"
124124
);
125125
script.setAttribute("data-project-name", "AssemblyAI");
126126
script.setAttribute("data-project-color", "#2C4BD4");
127127
script.setAttribute(
128128
"data-project-logo",
129-
"https://www.assemblyai.com/static/images/logo-blue400x400.jpeg",
129+
"https://www.assemblyai.com/static/images/logo-blue400x400.jpeg"
130130
);
131131
script.setAttribute(
132132
"data-modal-override-open-id-search",
133-
"fern-search-button",
133+
"fern-search-button"
134134
);
135135
script.setAttribute(
136136
"data-search-include-source-names",
137-
'["FAQ", "Documentation"]',
137+
'["FAQ", "Documentation"]'
138138
);
139139
script.setAttribute("data-user-analytics-fingerprint-enabled", true);
140140
document.head.appendChild(script);

fern/pages/01-getting-started/transcribe-streaming-audio-from-a-microphone/typescript.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ const ws = new WebSocket(
299299
headers: {
300300
Authorization: API_KEY,
301301
},
302-
},
302+
}
303303
);
304304

305305
ws.on("open", () => onOpen(ws))

fern/pages/02-speech-to-text/pre-recorded-audio/word-level-timestamps.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ const run = async () => {
8787
// Print word-level details
8888
for (const word of transcript.words) {
8989
console.log(
90-
`Word: ${word.text}, Start: ${word.start}, End: ${word.end}, Confidence: ${word.confidence}`,
90+
`Word: ${word.text}, Start: ${word.start}, End: ${word.end}, Confidence: ${word.confidence}`
9191
);
9292
}
9393
};
@@ -133,7 +133,7 @@ while (true) {
133133
// Print word-level details
134134
for (const word of transcriptionResult.words) {
135135
console.log(
136-
`Word: ${word.text}, Start: ${word.start}, End: ${word.end}, Confidence: ${word.confidence}`,
136+
`Word: ${word.text}, Start: ${word.start}, End: ${word.end}, Confidence: ${word.confidence}`
137137
);
138138
}
139139
break;

fern/pages/02-speech-to-text/pre-recorded-audio/word-search.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ const words = ["foo", "bar", "foo bar", "42"];
163163

164164
const response = await axios.get(
165165
`${baseUrl}/v2/transcript/${transcriptId}/word-search?words=${words.join(",")}`,
166-
{ headers },
166+
{ headers }
167167
);
168168

169169
for (const match of response.data.matches) {

fern/pages/02-speech-to-text/streaming.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ const token = await axios
294294
Authorization: "<apiKey>",
295295
"Content-Type": "application/json",
296296
},
297-
},
297+
}
298298
)
299299
.then((response) => response.data.token);
300300
```

fern/pages/03-audio-intelligence/content-moderation.mdx

+14-14
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ const run = async () => {
162162
for (const result of contentSafetyLabels.results) {
163163
console.log(result.text);
164164
console.log(
165-
`Timestamp: ${result.timestamp.start} - ${result.timestamp.end}`,
165+
`Timestamp: ${result.timestamp.start} - ${result.timestamp.end}`
166166
);
167167

168168
// Get category, confidence, and severity
@@ -173,25 +173,25 @@ const run = async () => {
173173

174174
// Get the confidence of the most common labels in relation to the entire audio file
175175
for (const [label, confidence] of Object.entries(
176-
contentSafetyLabels.summary,
176+
contentSafetyLabels.summary
177177
)) {
178178
console.log(
179-
`${confidence * 100}% confident that the audio contains ${label}`,
179+
`${confidence * 100}% confident that the audio contains ${label}`
180180
);
181181
}
182182

183183
// Get the overall severity of the most common labels in relation to the entire audio file
184184
for (const [label, severity_confidence] of Object.entries(
185-
contentSafetyLabels.severity_score_summary,
185+
contentSafetyLabels.severity_score_summary
186186
)) {
187187
console.log(
188-
`${severity_confidence.low * 100}% confident that the audio contains low-severity ${label}`,
188+
`${severity_confidence.low * 100}% confident that the audio contains low-severity ${label}`
189189
);
190190
console.log(
191-
`${severity_confidence.medium * 100}% confident that the audio contains medium-severity ${label}`,
191+
`${severity_confidence.medium * 100}% confident that the audio contains medium-severity ${label}`
192192
);
193193
console.log(
194-
`${severity_confidence.high * 100}% confident that the audio contains high-severity ${label}`,
194+
`${severity_confidence.high * 100}% confident that the audio contains high-severity ${label}`
195195
);
196196
}
197197
};
@@ -244,7 +244,7 @@ while (true) {
244244
for (const result of contentSafetyLabels.results) {
245245
console.log(result.text);
246246
console.log(
247-
`Timestamp: ${result.timestamp.start} - ${result.timestamp.end}`,
247+
`Timestamp: ${result.timestamp.start} - ${result.timestamp.end}`
248248
);
249249

250250
// Get category, confidence, and severity.
@@ -254,24 +254,24 @@ while (true) {
254254
}
255255
// Get the confidence of the most common labels in relation to the entire audio file
256256
for (const [label, confidence] of Object.entries(
257-
contentSafetyLabels.summary,
257+
contentSafetyLabels.summary
258258
)) {
259259
console.log(
260-
`${confidence * 100}% confident that the audio contains ${label}`,
260+
`${confidence * 100}% confident that the audio contains ${label}`
261261
);
262262
}
263263
// Get the confidence of the most common labels in relation to the entire audio file.
264264
for (const [label, severity_confidence] of Object.entries(
265-
contentSafetyLabels.severity_score_summary,
265+
contentSafetyLabels.severity_score_summary
266266
)) {
267267
console.log(
268-
`${severity_confidence.low * 100}% confident that the audio contains low-severity ${label}`,
268+
`${severity_confidence.low * 100}% confident that the audio contains low-severity ${label}`
269269
);
270270
console.log(
271-
`${severity_confidence.medium * 100}% confident that the audio contains medium-severity ${label}`,
271+
`${severity_confidence.medium * 100}% confident that the audio contains medium-severity ${label}`
272272
);
273273
console.log(
274-
`${severity_confidence.high * 100}% confident that the audio contains high-severity ${label}`,
274+
`${severity_confidence.high * 100}% confident that the audio contains high-severity ${label}`
275275
);
276276
}
277277

fern/pages/03-audio-intelligence/key-phrases.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ const run = async () => {
122122
.map(({ start, end }) => `[Timestamp(start=${start}, end=${end})]`)
123123
.join(", ");
124124
console.log(
125-
`Highlight: ${result.text}, Count: ${result.count}, Rank ${result.rank}, Timestamps: ${timestamps}`,
125+
`Highlight: ${result.text}, Count: ${result.count}, Rank ${result.rank}, Timestamps: ${timestamps}`
126126
);
127127
}
128128
};
@@ -177,7 +177,7 @@ while (true) {
177177
.map(({ start, end }) => `[Timestamp(start=${start}, end=${end})]`)
178178
.join(", ");
179179
console.log(
180-
`Highlight: ${result.text}, Count: ${result.count}, Rank: ${result.rank}, Timestamps: ${timestamps}`,
180+
`Highlight: ${result.text}, Count: ${result.count}, Rank: ${result.rank}, Timestamps: ${timestamps}`
181181
);
182182
}
183183
break;

fern/pages/03-audio-intelligence/pii-redaction.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,7 @@ const run = async () => {
654654
const transcript = await client.transcripts.transcribe(params);
655655

656656
const { status, redacted_audio_url } = await client.transcripts.redactedAudio(
657-
transcript.id,
657+
transcript.id
658658
);
659659

660660
console.log(`Status: ${status}, Redacted audio URL: ${redacted_audio_url}`);
@@ -700,7 +700,7 @@ while (true) {
700700
redactedAudioPollingEndpoint,
701701
{
702702
headers: headers,
703-
},
703+
}
704704
);
705705
const redactedAudioResult = redactedAudioPollingResponse.data;
706706

fern/pages/03-audio-intelligence/sentiment-analysis.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ while (true) {
181181
console.log(sentimentResult.sentiment); // POSITIVE, NEUTRAL, or NEGATIVE
182182
console.log(sentimentResult.confidence);
183183
console.log(
184-
`Timestamp: ${sentimentResult.start} - ${sentimentResult.end}`,
184+
`Timestamp: ${sentimentResult.start} - ${sentimentResult.end}`
185185
);
186186
}
187187
} else if (transcriptionResult.status === "error") {

fern/pages/03-audio-intelligence/topic-detection.mdx

+4-4
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ const run = async () => {
144144
for (const result of transcript.iab_categories_result!.results) {
145145
console.log(result.text);
146146
console.log(
147-
`Timestamp: ${result.timestamp?.start} - ${result.timestamp?.end}`,
147+
`Timestamp: ${result.timestamp?.start} - ${result.timestamp?.end}`
148148
);
149149
for (const label of result.labels!) {
150150
console.log(`${label.label} (${label.relevance})`);
@@ -153,7 +153,7 @@ const run = async () => {
153153

154154
// Get a summary of all topics in the transcript
155155
for (const [topic, relevance] of Object.entries(
156-
transcript.iab_categories_result!.summary,
156+
transcript.iab_categories_result!.summary
157157
)) {
158158
console.log(`Audio is ${relevance * 100} relevant to ${topic}`);
159159
}
@@ -208,7 +208,7 @@ while (true) {
208208
for (const result of transcriptionResult.iab_categories_result.results!) {
209209
console.log(result.text);
210210
console.log(
211-
`Timestamp: ${result.timestamp.start} - ${result.timestamp.end}`,
211+
`Timestamp: ${result.timestamp.start} - ${result.timestamp.end}`
212212
);
213213

214214
for (const label of result.labels) {
@@ -217,7 +217,7 @@ while (true) {
217217
}
218218
// Get a summary of all topics in the transcript
219219
for (const [topic, relevance] of Object.entries(
220-
transcriptionResult.iab_categories_result.summary,
220+
transcriptionResult.iab_categories_result.summary
221221
)) {
222222
console.log(`Audio is ${relevance * 100} relevant to ${topic}`);
223223
}

fern/pages/04-lemur/apply-llms-to-audio-files.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -909,7 +909,7 @@ const transcript = await client.transcripts.get("YOUR_TRANSCRIPT_ID");
909909
const transcript = (
910910
await axios.get(
911911
"https://api.assemblyai.com/v2/transcript/YOUR_TRANSCRIPT_ID",
912-
{ headers },
912+
{ headers }
913913
)
914914
).data;
915915
```
@@ -1086,7 +1086,7 @@ const lemur_data = {
10861086
const result = await axios.post(
10871087
base_url + "/lemur/v3/generate/task",
10881088
lemur_data,
1089-
{ headers },
1089+
{ headers }
10901090
);
10911091
```
10921092

0 commit comments

Comments
 (0)