Rejig dictation (#6844)

Co-authored-by: Douwe Osinga <douwe@squareup.com>
This commit is contained in:
Douwe Osinga
2026-02-02 14:25:23 +01:00
committed by GitHub
parent dd15fd0dd8
commit 2661454426
22 changed files with 1177 additions and 1448 deletions
+157
View File
@@ -1571,6 +1571,86 @@
}
}
},
"/dictation/config": {
"get": {
"tags": [
"super::routes::dictation"
],
"operationId": "get_dictation_config",
"responses": {
"200": {
"description": "Audio transcription provider configurations",
"content": {
"application/json": {
"schema": {
"type": "object",
"additionalProperties": {
"$ref": "#/components/schemas/DictationProviderStatus"
}
}
}
}
}
}
}
},
"/dictation/transcribe": {
"post": {
"tags": [
"super::routes::dictation"
],
"operationId": "transcribe_dictation",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/TranscribeRequest"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Audio transcribed successfully",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/TranscribeResponse"
}
}
}
},
"400": {
"description": "Invalid request (bad base64 or unsupported format)"
},
"401": {
"description": "Invalid API key"
},
"412": {
"description": "DictationProvider not configured"
},
"413": {
"description": "Audio file too large (max 25MB)"
},
"429": {
"description": "Rate limit exceeded"
},
"500": {
"description": "Internal server error"
},
"502": {
"description": "DictationProvider API error"
},
"503": {
"description": "Service unavailable"
},
"504": {
"description": "Request timeout"
}
}
}
},
"/handle_openrouter": {
"post": {
"tags": [
@@ -3593,6 +3673,50 @@
}
}
},
"DictationProvider": {
"type": "string",
"enum": [
"openai",
"elevenlabs"
]
},
"DictationProviderStatus": {
"type": "object",
"required": [
"configured",
"description",
"uses_provider_config"
],
"properties": {
"config_key": {
"type": "string",
"description": "Config key name if uses_provider_config is false",
"nullable": true
},
"configured": {
"type": "boolean",
"description": "Whether the provider is fully configured and ready to use"
},
"description": {
"type": "string",
"description": "Description of what this provider does"
},
"host": {
"type": "string",
"description": "Custom host URL if configured (only for providers that support it)",
"nullable": true
},
"settings_path": {
"type": "string",
"description": "Path to settings if uses_provider_config is true",
"nullable": true
},
"uses_provider_config": {
"type": "boolean",
"description": "Whether this provider uses the main provider config (true) or has its own key (false)"
}
}
},
"EmbeddedResource": {
"type": "object",
"required": [
@@ -6612,6 +6736,39 @@
}
}
},
"TranscribeRequest": {
"type": "object",
"required": [
"audio",
"mime_type",
"provider"
],
"properties": {
"audio": {
"type": "string",
"description": "Base64 encoded audio data"
},
"mime_type": {
"type": "string",
"description": "MIME type of the audio (e.g., \"audio/webm\", \"audio/wav\")"
},
"provider": {
"$ref": "#/components/schemas/DictationProvider"
}
}
},
"TranscribeResponse": {
"type": "object",
"required": [
"text"
],
"properties": {
"text": {
"type": "string",
"description": "Transcribed text from the audio"
}
}
},
"TunnelInfo": {
"type": "object",
"required": [