Skip to content

Commit 1d1ce8f

Browse files
AssemblyAISwimburger
AssemblyAI
authored andcommitted
Project import generated by Copybara.
GitOrigin-RevId: 29cbcf7a15d72ca261f3f2a9f2592378474a859c
1 parent 95e8214 commit 1d1ce8f

17 files changed

+7289
-466
lines changed

Diff for: asyncapi.json

+136-21
Original file line numberDiff line numberDiff line change
@@ -58,21 +58,40 @@
5858
"sample_rate": {
5959
"description": "The sample rate of the streamed audio",
6060
"type": "integer",
61-
"examples": [16000]
61+
"examples": [
62+
16000
63+
]
6264
},
6365
"word_boost": {
6466
"description": "Add up to 2500 characters of custom vocabulary.\nThe parameter value must be a JSON encoded array of strings.\n",
6567
"type": "string",
66-
"examples": ["[\"foo\",\"bar\"]"]
68+
"examples": [
69+
"[\"foo\",\"bar\"]"
70+
]
6771
},
6872
"encoding": {
6973
"description": "The encoding of the audio data",
7074
"$ref": "#/components/schemas/AudioEncoding"
7175
},
7276
"token": {
73-
"description": "Authenticate using a [generated temporary token](https://www.assemblyai.com/docs/speech-to-text/streaming#authenticate-with-a-temporary-token)",
77+
"description": "Authenticate using a [generated temporary token](https://www.assemblyai.com/docs/speech-to-text/streaming#authenticate-with-a-temporary-token)\n",
7478
"type": "string",
75-
"format": "password"
79+
"format": "password",
80+
"examples": [
81+
"eyJhbGciOiJIUzI1..."
82+
]
83+
},
84+
"disable_partial_transcripts": {
85+
"summary": "Disable partial transcripts",
86+
"description": "Set to true to not receive partial transcripts. Defaults to false.",
87+
"type": "boolean",
88+
"default": false
89+
},
90+
"enable_extra_session_information": {
91+
"summary": "Enable extra session information",
92+
"description": "Set to true to receive the SessionInformation message before the session ends. Defaults to false.",
93+
"type": "boolean",
94+
"default": false
7695
}
7796
}
7897
}
@@ -112,6 +131,9 @@
112131
{
113132
"$ref": "#/components/messages/FinalTranscript"
114133
},
134+
{
135+
"$ref": "#/components/messages/SessionInformation"
136+
},
115137
{
116138
"$ref": "#/components/messages/SessionTerminated"
117139
},
@@ -126,17 +148,20 @@
126148
"query-parameters": {
127149
"sample_rate": 16000,
128150
"word_boost": "[\"foo\",\"bar\"]",
129-
"encoding": "pcm_s16le"
151+
"encoding": "pcm_s16le",
152+
"token": "eyJhbGciOiJIUzI1...",
153+
"disable_partial_transcripts": true,
154+
"enable_extra_session_information": true
130155
},
131156
"messages": [
132157
{
133-
"type": "publish",
134158
"messageId": "SendAudio",
159+
"type": "publish",
135160
"value": "UklGRtjIAABXQVZFZ"
136161
},
137162
{
138-
"type": "subscribe",
139163
"messageId": "PartialTranscript",
164+
"type": "subscribe",
140165
"value": {
141166
"audio_start": 0,
142167
"audio_end": 1500,
@@ -154,8 +179,8 @@
154179
}
155180
},
156181
{
157-
"type": "subscribe",
158182
"messageId": "FinalTranscript",
183+
"type": "subscribe",
159184
"value": {
160185
"audio_start": 0,
161186
"audio_end": 1500,
@@ -230,6 +255,14 @@
230255
"$ref": "#/components/schemas/SessionBegins"
231256
}
232257
},
258+
"SessionInformation": {
259+
"messageId": "SessionInformation",
260+
"summary": "Information about the session",
261+
"description": "Information about the session that is concluding.\nThis message is sent at the end of the session, before the SessionTerminated message.\n",
262+
"payload": {
263+
"$ref": "#/components/schemas/SessionInformation"
264+
}
265+
},
233266
"SessionTerminated": {
234267
"messageId": "SessionTerminated",
235268
"summary": "Session terminated",
@@ -264,7 +297,9 @@
264297
"RealtimeBaseMessage": {
265298
"type": "object",
266299
"x-fern-sdk-group-name": "realtime",
267-
"required": ["message_type"],
300+
"required": [
301+
"message_type"
302+
],
268303
"properties": {
269304
"message_type": {
270305
"description": "Describes the type of the message",
@@ -284,6 +319,9 @@
284319
{
285320
"$ref": "#/components/schemas/FinalTranscript"
286321
},
322+
{
323+
"$ref": "#/components/schemas/SessionInformation"
324+
},
287325
{
288326
"$ref": "#/components/schemas/SessionTerminated"
289327
},
@@ -293,10 +331,13 @@
293331
]
294332
},
295333
"RealtimeError": {
334+
"summary": "Error message",
296335
"type": "object",
297336
"x-fern-sdk-group-name": "realtime",
298337
"additionalProperties": false,
299-
"required": ["error"],
338+
"required": [
339+
"error"
340+
],
300341
"properties": {
301342
"error": {
302343
"type": "string"
@@ -315,13 +356,17 @@
315356
"SessionBegins",
316357
"PartialTranscript",
317358
"FinalTranscript",
359+
"SessionInformation",
318360
"SessionTerminated"
319361
]
320362
},
321363
"RealtimeTranscriptType": {
322364
"type": "string",
323365
"x-fern-sdk-group-name": "realtime",
324-
"enum": ["PartialTranscript", "FinalTranscript"]
366+
"enum": [
367+
"PartialTranscript",
368+
"FinalTranscript"
369+
]
325370
},
326371
"RealtimeTranscript": {
327372
"x-fern-sdk-group-name": "realtime",
@@ -336,14 +381,19 @@
336381
"discriminator": "message_type"
337382
},
338383
"SessionBegins": {
384+
"summary": "Session start",
339385
"x-fern-sdk-group-name": "realtime",
340386
"allOf": [
341387
{
342388
"$ref": "#/components/schemas/RealtimeBaseMessage"
343389
},
344390
{
345391
"type": "object",
346-
"required": ["message_type", "session_id", "expires_at"],
392+
"required": [
393+
"message_type",
394+
"session_id",
395+
"expires_at"
396+
],
347397
"properties": {
348398
"message_type": {
349399
"description": "Describes the type of the message",
@@ -374,15 +424,54 @@
374424
}
375425
]
376426
},
427+
"SessionInformation": {
428+
"summary": "Information about the session",
429+
"description": "Information about the session that is concluding.\nThis message is sent at the end of the session, before the SessionTerminated message.\n",
430+
"x-fern-sdk-group-name": "realtime",
431+
"allOf": [
432+
{
433+
"$ref": "#/components/schemas/RealtimeBaseMessage"
434+
},
435+
{
436+
"type": "object",
437+
"required": [
438+
"message_type",
439+
"audio_duration_seconds"
440+
],
441+
"properties": {
442+
"message_type": {
443+
"description": "Describes the type of the message",
444+
"type": "string",
445+
"const": "SessionInformation"
446+
},
447+
"audio_duration_seconds": {
448+
"description": "The total duration of the audio in seconds",
449+
"type": "number",
450+
"format": "float"
451+
}
452+
},
453+
"additionalProperties": false
454+
}
455+
],
456+
"examples": [
457+
{
458+
"message_type": "SessionInformation",
459+
"audio_duration_seconds": 232.192
460+
}
461+
]
462+
},
377463
"SessionTerminated": {
464+
"summary": "Session terminated",
378465
"x-fern-sdk-group-name": "realtime",
379466
"allOf": [
380467
{
381468
"$ref": "#/components/schemas/RealtimeBaseMessage"
382469
},
383470
{
384471
"type": "object",
385-
"required": ["message_type"],
472+
"required": [
473+
"message_type"
474+
],
386475
"properties": {
387476
"message_type": {
388477
"description": "Describes the type of the message",
@@ -448,14 +537,17 @@
448537
"additionalProperties": false
449538
},
450539
"PartialTranscript": {
540+
"summary": "As you send audio data to the API, the API immediately starts responding with Partial Transcript results.",
451541
"x-fern-sdk-group-name": "realtime",
452542
"allOf": [
453543
{
454544
"$ref": "#/components/schemas/RealtimeBaseTranscript"
455545
},
456546
{
457547
"type": "object",
458-
"required": ["message_type"],
548+
"required": [
549+
"message_type"
550+
],
459551
"properties": {
460552
"message_type": {
461553
"description": "Describes the type of message",
@@ -504,14 +596,19 @@
504596
]
505597
},
506598
"FinalTranscript": {
599+
"summary": "Transcript text at the end of an utterance with punctuation and casing.",
507600
"x-fern-sdk-group-name": "realtime",
508601
"allOf": [
509602
{
510603
"$ref": "#/components/schemas/RealtimeBaseTranscript"
511604
},
512605
{
513606
"type": "object",
514-
"required": ["message_type", "punctuated", "text_formatted"],
607+
"required": [
608+
"message_type",
609+
"punctuated",
610+
"text_formatted"
611+
],
515612
"properties": {
516613
"message_type": {
517614
"description": "Describes the type of message",
@@ -614,7 +711,12 @@
614711
"Word": {
615712
"type": "object",
616713
"x-fern-sdk-group-name": "realtime",
617-
"required": ["start", "end", "confidence", "text"],
714+
"required": [
715+
"start",
716+
"end",
717+
"confidence",
718+
"text"
719+
],
618720
"properties": {
619721
"start": {
620722
"description": "Start time of the word in milliseconds",
@@ -693,7 +795,9 @@
693795
"description": "Manually end an utterance",
694796
"x-fern-sdk-group-name": "realtime",
695797
"type": "object",
696-
"required": ["force_end_utterance"],
798+
"required": [
799+
"force_end_utterance"
800+
],
697801
"properties": {
698802
"force_end_utterance": {
699803
"description": "A boolean value to communicate that you wish to force the end of the utterance",
@@ -711,7 +815,9 @@
711815
"description": "Configure the threshold for how long to wait before ending an utterance. Default is 700ms.",
712816
"x-fern-sdk-group-name": "realtime",
713817
"type": "object",
714-
"required": ["end_utterance_silence_threshold"],
818+
"required": [
819+
"end_utterance_silence_threshold"
820+
],
715821
"properties": {
716822
"end_utterance_silence_threshold": {
717823
"description": "The duration threshold in milliseconds",
@@ -728,9 +834,12 @@
728834
]
729835
},
730836
"TerminateSession": {
837+
"summary": "Terminate session",
731838
"x-fern-sdk-group-name": "realtime",
732839
"type": "object",
733-
"required": ["terminate_session"],
840+
"required": [
841+
"terminate_session"
842+
],
734843
"properties": {
735844
"terminate_session": {
736845
"description": "Set to true to end your streaming session forever",
@@ -749,7 +858,10 @@
749858
"x-fern-sdk-group-name": "realtime",
750859
"description": "The encoding of the audio data",
751860
"default": "pcm_s16le",
752-
"enum": ["pcm_s16le", "pcm_mulaw"],
861+
"enum": [
862+
"pcm_s16le",
863+
"pcm_mulaw"
864+
],
753865
"x-fern-enum": {
754866
"pcm_s16le": {
755867
"description": "PCM signed 16-bit little-endian",
@@ -770,7 +882,10 @@
770882
}
771883
}
772884
},
773-
"examples": ["pcm_s16le", "pcm_mulaw"]
885+
"examples": [
886+
"pcm_s16le",
887+
"pcm_mulaw"
888+
]
774889
}
775890
},
776891
"securitySchemes": {

Diff for: asyncapi.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ servers:
2323
- Token: []
2424

2525
tags:
26-
- name: streaming
26+
# This tag is used as the Fern package name for the channel and messages, even tho the tag is not linked to anything.
27+
# x-fern-group-sdk-name also doesn't work on channels and messages.
28+
# Hence, it has to be "realtime" and can't be "streaming" until these gaps in Fern are fixed.
29+
- name: realtime
2730
description: Streaming Speech-to-Text
2831
externalDocs:
2932
url: https://www.assemblyai.com/docs/speech-to-text/streaming

Diff for: fern/.definition/__package__.yml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
errors:
2+
BadRequestError:
3+
status-code: 400
4+
type: Error
5+
docs: Bad request
6+
UnauthorizedError:
7+
status-code: 401
8+
type: Error
9+
docs: Unauthorized
10+
NotFoundError:
11+
status-code: 404
12+
type: Error
13+
docs: Not found
14+
TooManyRequestsError:
15+
status-code: 429
16+
type: Error
17+
docs: Too many requests
18+
InternalServerError:
19+
status-code: 500
20+
type: Error
21+
docs: An error occurred while processing the request
22+
ServiceUnavailableError:
23+
status-code: 503
24+
type: unknown
25+
docs: Service unavailable
26+
GatewayTimeoutError:
27+
status-code: 504
28+
type: unknown
29+
docs: Gateway timeout
30+
types:
31+
Error:
32+
properties:
33+
error:
34+
type: string
35+
docs: Error message
36+
status: optional<literal<"error">>

0 commit comments

Comments
 (0)