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
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+121
View File
@@ -190,6 +190,35 @@ export type DetectProviderResponse = {
provider_name: string;
};
export type DictationProvider = 'openai' | 'elevenlabs';
export type DictationProviderStatus = {
/**
* Config key name if uses_provider_config is false
*/
config_key?: string | null;
/**
* Whether the provider is fully configured and ready to use
*/
configured: boolean;
/**
* Description of what this provider does
*/
description: string;
/**
* Custom host URL if configured (only for providers that support it)
*/
host?: string | null;
/**
* Path to settings if uses_provider_config is true
*/
settings_path?: string | null;
/**
* Whether this provider uses the main provider config (true) or has its own key (false)
*/
uses_provider_config: boolean;
};
export type EmbeddedResource = {
_meta?: {
[key: string]: unknown;
@@ -1173,6 +1202,25 @@ export type ToolResponse = {
};
};
export type TranscribeRequest = {
/**
* Base64 encoded audio data
*/
audio: string;
/**
* MIME type of the audio (e.g., "audio/webm", "audio/wav")
*/
mime_type: string;
provider: DictationProvider;
};
export type TranscribeResponse = {
/**
* Transcribed text from the audio
*/
text: string;
};
export type TunnelInfo = {
hostname: string;
secret: string;
@@ -2456,6 +2504,79 @@ export type DiagnosticsResponses = {
export type DiagnosticsResponse = DiagnosticsResponses[keyof DiagnosticsResponses];
export type GetDictationConfigData = {
body?: never;
path?: never;
query?: never;
url: '/dictation/config';
};
export type GetDictationConfigResponses = {
/**
* Audio transcription provider configurations
*/
200: {
[key: string]: DictationProviderStatus;
};
};
export type GetDictationConfigResponse = GetDictationConfigResponses[keyof GetDictationConfigResponses];
export type TranscribeDictationData = {
body: TranscribeRequest;
path?: never;
query?: never;
url: '/dictation/transcribe';
};
export type TranscribeDictationErrors = {
/**
* Invalid request (bad base64 or unsupported format)
*/
400: unknown;
/**
* Invalid API key
*/
401: unknown;
/**
* DictationProvider not configured
*/
412: unknown;
/**
* Audio file too large (max 25MB)
*/
413: unknown;
/**
* Rate limit exceeded
*/
429: unknown;
/**
* Internal server error
*/
500: unknown;
/**
* DictationProvider API error
*/
502: unknown;
/**
* Service unavailable
*/
503: unknown;
/**
* Request timeout
*/
504: unknown;
};
export type TranscribeDictationResponses = {
/**
* Audio transcribed successfully
*/
200: TranscribeResponse;
};
export type TranscribeDictationResponse = TranscribeDictationResponses[keyof TranscribeDictationResponses];
export type StartOpenrouterSetupData = {
body?: never;
path?: never;