Skip to content

Commit c61fc08

Browse files
SwimburgerAssemblyAI
andauthored
Project import generated by Copybara. (#102)
GitOrigin-RevId: 42ea5355c96d66e50300d9aafb5e1523118bd0d3 Co-authored-by: AssemblyAI <[email protected]>
1 parent 7b06b4d commit c61fc08

File tree

6 files changed

+474
-714
lines changed

6 files changed

+474
-714
lines changed

asyncapi.json

Lines changed: 18 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
},
3333
"tags": [
3434
{
35-
"name": "streaming",
35+
"name": "realtime",
3636
"description": "Streaming Speech-to-Text",
3737
"externalDocs": {
3838
"url": "https://www.assemblyai.com/docs/speech-to-text/streaming"
@@ -58,16 +58,12 @@
5858
"sample_rate": {
5959
"description": "The sample rate of the streamed audio",
6060
"type": "integer",
61-
"examples": [
62-
16000
63-
]
61+
"examples": [16000]
6462
},
6563
"word_boost": {
6664
"description": "Add up to 2500 characters of custom vocabulary.\nThe parameter value must be a JSON encoded array of strings.\n",
6765
"type": "string",
68-
"examples": [
69-
"[\"foo\",\"bar\"]"
70-
]
66+
"examples": ["[\"foo\",\"bar\"]"]
7167
},
7268
"encoding": {
7369
"description": "The encoding of the audio data",
@@ -77,9 +73,7 @@
7773
"description": "Authenticate using a [generated temporary token](https://www.assemblyai.com/docs/speech-to-text/streaming#authenticate-with-a-temporary-token)\n",
7874
"type": "string",
7975
"format": "password",
80-
"examples": [
81-
"eyJhbGciOiJIUzI1..."
82-
]
76+
"examples": ["eyJhbGciOiJIUzI1..."]
8377
},
8478
"disable_partial_transcripts": {
8579
"summary": "Disable partial transcripts",
@@ -297,9 +291,7 @@
297291
"RealtimeBaseMessage": {
298292
"type": "object",
299293
"x-fern-sdk-group-name": "realtime",
300-
"required": [
301-
"message_type"
302-
],
294+
"required": ["message_type"],
303295
"properties": {
304296
"message_type": {
305297
"description": "Describes the type of the message",
@@ -335,9 +327,7 @@
335327
"type": "object",
336328
"x-fern-sdk-group-name": "realtime",
337329
"additionalProperties": false,
338-
"required": [
339-
"error"
340-
],
330+
"required": ["error"],
341331
"properties": {
342332
"error": {
343333
"type": "string"
@@ -363,10 +353,7 @@
363353
"RealtimeTranscriptType": {
364354
"type": "string",
365355
"x-fern-sdk-group-name": "realtime",
366-
"enum": [
367-
"PartialTranscript",
368-
"FinalTranscript"
369-
]
356+
"enum": ["PartialTranscript", "FinalTranscript"]
370357
},
371358
"RealtimeTranscript": {
372359
"x-fern-sdk-group-name": "realtime",
@@ -389,11 +376,7 @@
389376
},
390377
{
391378
"type": "object",
392-
"required": [
393-
"message_type",
394-
"session_id",
395-
"expires_at"
396-
],
379+
"required": ["message_type", "session_id", "expires_at"],
397380
"properties": {
398381
"message_type": {
399382
"description": "Describes the type of the message",
@@ -434,10 +417,7 @@
434417
},
435418
{
436419
"type": "object",
437-
"required": [
438-
"message_type",
439-
"audio_duration_seconds"
440-
],
420+
"required": ["message_type", "audio_duration_seconds"],
441421
"properties": {
442422
"message_type": {
443423
"description": "Describes the type of the message",
@@ -469,9 +449,7 @@
469449
},
470450
{
471451
"type": "object",
472-
"required": [
473-
"message_type"
474-
],
452+
"required": ["message_type"],
475453
"properties": {
476454
"message_type": {
477455
"description": "Describes the type of the message",
@@ -545,9 +523,7 @@
545523
},
546524
{
547525
"type": "object",
548-
"required": [
549-
"message_type"
550-
],
526+
"required": ["message_type"],
551527
"properties": {
552528
"message_type": {
553529
"description": "Describes the type of message",
@@ -604,11 +580,7 @@
604580
},
605581
{
606582
"type": "object",
607-
"required": [
608-
"message_type",
609-
"punctuated",
610-
"text_formatted"
611-
],
583+
"required": ["message_type", "punctuated", "text_formatted"],
612584
"properties": {
613585
"message_type": {
614586
"description": "Describes the type of message",
@@ -711,12 +683,7 @@
711683
"Word": {
712684
"type": "object",
713685
"x-fern-sdk-group-name": "realtime",
714-
"required": [
715-
"start",
716-
"end",
717-
"confidence",
718-
"text"
719-
],
686+
"required": ["start", "end", "confidence", "text"],
720687
"properties": {
721688
"start": {
722689
"description": "Start time of the word in milliseconds",
@@ -795,9 +762,7 @@
795762
"description": "Manually end an utterance",
796763
"x-fern-sdk-group-name": "realtime",
797764
"type": "object",
798-
"required": [
799-
"force_end_utterance"
800-
],
765+
"required": ["force_end_utterance"],
801766
"properties": {
802767
"force_end_utterance": {
803768
"description": "A boolean value to communicate that you wish to force the end of the utterance",
@@ -815,9 +780,7 @@
815780
"description": "Configure the threshold for how long to wait before ending an utterance. Default is 700ms.",
816781
"x-fern-sdk-group-name": "realtime",
817782
"type": "object",
818-
"required": [
819-
"end_utterance_silence_threshold"
820-
],
783+
"required": ["end_utterance_silence_threshold"],
821784
"properties": {
822785
"end_utterance_silence_threshold": {
823786
"description": "The duration threshold in milliseconds",
@@ -837,9 +800,7 @@
837800
"summary": "Terminate session",
838801
"x-fern-sdk-group-name": "realtime",
839802
"type": "object",
840-
"required": [
841-
"terminate_session"
842-
],
803+
"required": ["terminate_session"],
843804
"properties": {
844805
"terminate_session": {
845806
"description": "Set to true to end your streaming session forever",
@@ -858,10 +819,7 @@
858819
"x-fern-sdk-group-name": "realtime",
859820
"description": "The encoding of the audio data",
860821
"default": "pcm_s16le",
861-
"enum": [
862-
"pcm_s16le",
863-
"pcm_mulaw"
864-
],
822+
"enum": ["pcm_s16le", "pcm_mulaw"],
865823
"x-fern-enum": {
866824
"pcm_s16le": {
867825
"description": "PCM signed 16-bit little-endian",
@@ -882,10 +840,7 @@
882840
}
883841
}
884842
},
885-
"examples": [
886-
"pcm_s16le",
887-
"pcm_mulaw"
888-
]
843+
"examples": ["pcm_s16le", "pcm_mulaw"]
889844
}
890845
},
891846
"securitySchemes": {

fern/.definition/realtime.yml

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,41 @@ service:
3737
body:
3838
token: fe4145dd1e7a2e149488dcd2d553a8018a89833fc5084837d66fd1bcf5a105d4
3939
types:
40+
Realtime:
41+
enum:
42+
- value: pcm_s16le
43+
docs: PCM signed 16-bit little-endian
44+
casing:
45+
camel: pcmS16le
46+
screaming-snake: PCM_S16LE
47+
snake: pcm_s16le
48+
pascal: PcmS16le
49+
- value: pcm_mulaw
50+
docs: PCM Mu-law
51+
casing:
52+
camel: pcmMulaw
53+
screaming-snake: PCM_MULAW
54+
snake: pcm_mulaw
55+
pascal: PcmMulaw
56+
docs: The encoding of the audio data
57+
receiveMessage:
58+
discriminated: false
59+
docs: Receive messages from the WebSocket
60+
union:
61+
- SessionBegins
62+
- PartialTranscript
63+
- FinalTranscript
64+
- SessionInformation
65+
- SessionTerminated
66+
- RealtimeError
67+
sendMessage:
68+
discriminated: false
69+
docs: Send messages to the WebSocket
70+
union:
71+
- AudioData
72+
- TerminateSession
73+
- ForceEndUtterance
74+
- ConfigureEndUtteranceSilenceThreshold
4075
RealtimeBaseMessage:
4176
properties:
4277
message_type:
@@ -217,3 +252,86 @@ types:
217252
token:
218253
type: string
219254
docs: The temporary authentication token for Streaming Speech-to-Text
255+
channel:
256+
path: /v2/realtime/ws
257+
auth: false
258+
display-name: Streaming Speech-to-Text
259+
query-parameters:
260+
sample_rate:
261+
type: optional<integer>
262+
docs: The sample rate of the streamed audio
263+
word_boost:
264+
type: optional<string>
265+
docs: |
266+
Add up to 2500 characters of custom vocabulary.
267+
The parameter value must be a JSON encoded array of strings.
268+
encoding:
269+
type: optional<Realtime>
270+
docs: The encoding of the audio data
271+
token:
272+
type: optional<string>
273+
docs: >
274+
Authenticate using a [generated temporary
275+
token](https://www.assemblyai.com/docs/speech-to-text/streaming#authenticate-with-a-temporary-token)
276+
disable_partial_transcripts:
277+
type: optional<boolean>
278+
docs: Set to true to not receive partial transcripts. Defaults to false.
279+
enable_extra_session_information:
280+
type: optional<boolean>
281+
docs: >-
282+
Set to true to receive the SessionInformation message before the session
283+
ends. Defaults to false.
284+
headers:
285+
Authentication:
286+
type: optional<string>
287+
name: authentication
288+
docs: Authenticate using your AssemblyAI API key
289+
messages:
290+
subscribe:
291+
origin: server
292+
body:
293+
type: receiveMessage
294+
docs: Receive messages from the WebSocket
295+
publish:
296+
origin: client
297+
body:
298+
type: sendMessage
299+
docs: Send messages to the WebSocket
300+
examples:
301+
- messages:
302+
- type: publish
303+
body: UklGRtjIAABXQVZFZ
304+
- type: subscribe
305+
body:
306+
audio_start: 0
307+
audio_end: 1500
308+
confidence: 0.987190506414702
309+
text: there is a house in new orleans
310+
words:
311+
- start: 0
312+
end: 300
313+
confidence: 1
314+
text: there
315+
created: "2023-05-24T05:09:10Z"
316+
message_type: PartialTranscript
317+
- type: subscribe
318+
body:
319+
audio_start: 0
320+
audio_end: 1500
321+
confidence: 0.987190506414702
322+
text: there is a house in new orleans
323+
words:
324+
- start: 0
325+
end: 300
326+
confidence: 1
327+
text: there
328+
created: "2023-05-24T05:09:10Z"
329+
message_type: FinalTranscript
330+
punctuated: true
331+
text_formatted: true
332+
- type: publish
333+
body:
334+
terminate_session: true
335+
- type: subscribe
336+
body:
337+
message_type: SessionTerminated

0 commit comments

Comments
 (0)