Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(fix): update example for ws #3

Merged
merged 2 commits into from
Jul 31, 2024
Merged
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
61 changes: 50 additions & 11 deletions fern/openapi/asyncapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,38 @@ channels:
subscribe:
message:
oneOf:
- $ref: "#/components/messages/VoiceEmbeddingResponse"
- $ref: "#/components/messages/WebSocketResponse"
- $ref: "#/components/messages/Error"
x-fern-examples:
- query-parameters:
api_key: "your-api-key"
cartesia_version: "2024-06-10"
messages:
- messageId: TTSRequest
type: publish
value:
context_id: "happy-monkeys-fly"
model_id: "sonic-english"
transcript: "Hello, world! I'm generating audio on Cartesia."
duration: 180
voice:
mode: "id"
id: "a0e99841-438c-4a64-b679-ae501e7d6091"
output_format:
container: "raw"
encoding: "pcm_s16le"
sample_rate: 8000
language: "en"
add_timestamps: false
- messageId: WebSocketResponse
type: subscribe
value:
status_code: 206
done: false
type: "chunk"
data: "aSDinaTvuI8gbWludGxpZnk="
step_time: 123
context_id: "happy-monkeys-fly"
components:
messages:
TTSRequest:
Expand All @@ -45,10 +75,10 @@ components:
name: SessionSettings
payload:
"$ref": "#/components/schemas/StreamInputRequest"
VoiceEmbeddingResponse:
WebSocketResponse:
name: UserInput
payload:
"$ref": "#/components/schemas/VoiceEmbeddingResponse"
"$ref": "#/components/schemas/WebSocketResponse"
Error:
name: Error
payload:
Expand All @@ -57,6 +87,10 @@ components:
TTSRequest:
type: object
additionalProperties: false
required:
- context_id
- model_id
- transcript
properties:
context_id:
type: string
Expand Down Expand Up @@ -130,16 +164,21 @@ components:
type: string
example: error in voice

VoiceEmbeddingResponse:
name: Voice Embedding
WebSocketResponse:
properties:
embedding:
type: array
items:
type: number
type:
type: string
done:
type: boolean
status-code:
type: number
step_time:
type: number
context_id:
type: string
data:
type: string
type: object
required:
- embedding

Voice:
type: object
Expand Down
Loading