diff --git a/.mock/asyncapi.yml b/.mock/asyncapi.yml index 85b53ffc..8d0a49ff 100644 --- a/.mock/asyncapi.yml +++ b/.mock/asyncapi.yml @@ -36,136 +36,220 @@ channels: to a standard HTTP request. * You want to quickly experiment or prototype. Working with WebSockets can be harder and more complex than using a standard HTTP API, which might slow down rapid development and testing. + bindings: + ws: + query: + $ref: '#/components/schemas/StreamInputQueryParameters' + publish: + description: Send messages to the WebSocket + operationId: sendMessage + message: + oneOf: + - $ref: '#/components/messages/InitializeConnection' + - $ref: '#/components/messages/SendText' + - $ref: '#/components/messages/CloseConnection' + subscribe: + description: Receive messages from the WebSocket + operationId: receiveMessage + message: + oneOf: + - $ref: '#/components/messages/AudioOutput' + - $ref: '#/components/messages/FinalOutput' + x-fern-examples: + - query-parameters: + model_id: pcm_s16le + messages: + - type: publish + messageId: InitializeConnection + value: + text: ' ' + voice_settings: + speed: 1.0 + stability: 0.5 + similarity_boost: 0.8 + xi_api_key: + - type: publish + messageId: SendText + value: + text: 'Hello World' + try_trigger_generation: true + - type: publish + messageId: CloseConnection + value: + text: '' + - type: subscribe + messageId: AudioOutput + value: + audio: Y3VyaW91cyBtaW5kcyB0aGluayBhbGlrZSA6KQ== + isFinal: false + normalizedAlignment: + charStartTimesMs: [0, 3, 7, 9, 11, 12, 13, 15, 17, 19, 21] + charsDurationsMs: [3, 4, 2, 2, 1, 1, 2, 2, 2, 2, 3] + chars: ['H', 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd'] + alignment: + charStartTimesMs: [0, 3, 7, 9, 11, 12, 13, 15, 17, 19, 21] + charsDurationsMs: [3, 4, 2, 2, 1, 1, 2, 2, 2, 2, 3] + chars: ['H', 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd'] + /v1/text-to-speech/{voice_id}/multi-stream-input: + parameters: + voice_id: + description: The unique identifier for the voice to use in the TTS process. + schema: + type: string + description: | + The Multi-Context Text-to-Speech WebSockets API allows for generating audio from text input + while managing multiple independent audio generation streams (contexts) over a single WebSocket connection. + This is useful for scenarios requiring concurrent or interleaved audio generations, such as dynamic + conversational AI applications. + + Each context, identified by a context id, maintains its own state. You can send text to specific + contexts, flush them, or close them independently. A `close_socket` message can be used to terminate + the entire connection gracefully. + + For more information on how to use this API for conversational agents see the [conversational agents guide](/docs/best-practices/conversational-agents). + bindings: ws: query: type: object properties: + authorization: + description: Your authorization bearer token. + type: string model_id: - description: The model ID to use + description: The model ID to use. type: string language_code: - description: The ISO 639-1 language code (for Turbo v2.5 and Flash v2.5 models only) + description: The ISO 639-1 language code (for specific models). type: string enable_logging: - description: Whether to enable logging of the request - type: string + description: Whether to enable logging of the request. + type: boolean + default: true enable_ssml_parsing: - description: Whether to enable SSML parsing + description: Whether to enable SSML parsing. type: boolean default: false - optimize_streaming_latency: - description: Latency optimization level (deprecated) - type: string - enum: ['0', '1', '2', '3', '4'] - default: '0' - deprecated: true output_format: - description: The output audio format - type: string - enum: - [ - 'mp3_22050_32', - 'mp3_44100_32', - 'mp3_44100_64', - 'mp3_44100_96', - 'mp3_44100_128', - 'mp3_44100_192', - 'pcm_8000', - 'pcm_16000', - 'pcm_22050', - 'pcm_24000', - 'pcm_44100', - 'ulaw_8000', - 'alaw_8000', - 'opus_48000_32', - 'opus_48000_64', - 'opus_48000_96', - 'opus_48000_128', - 'opus_48000_192', - ] - default: 'mp3_44100' + $ref: '#/components/schemas/TextToSpeechOutputFormatEnum' inactivity_timeout: - description: Timeout for inactivity before connection is closed - type: number + description: Timeout for inactivity before a context is closed (seconds), can be up to 180 seconds. + type: integer default: 20 sync_alignment: - description: Whether to include timing data with every audio chunk + description: Whether to include timing data with every audio chunk. type: boolean default: false auto_mode: - description: This parameter focuses on reducing the latency by disabling the chunk schedule and all buffers. It is only recommended when sending full sentences or phrases, sending partial phrases will result in highly reduced quality. By default it's set to false. + description: Reduces latency by disabling chunk schedule and buffers. Recommended for full sentences/phrases. type: boolean default: false apply_text_normalization: - description: >- - This parameter controls text normalization with three modes - 'auto', 'on', and 'off'. When set to 'auto', - the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', - text normalization will always be applied, while with 'off', it will be skipped. Cannot be turned on for - 'eleven_turbo_v2_5' or 'eleven_flash_v2_5' models. Defaults to 'auto'. - type: string - enum: ['auto', 'on', 'off'] - default: 'auto' + $ref: '#/components/schemas/TextToSpeechApplyTextNormalizationEnum' seed: - description: >- - If specified, our system will make a best effort to sample deterministically, such that repeated requests - with the same seed and parameters should return the same result. Determinism is not guaranteed. Must be an - integer between 0 and 4294967295. + description: If specified, system will best-effort sample deterministically. Integer between 0 and 4294967295. type: integer minimum: 0 maximum: 4294967295 example: 12345 publish: - description: Send messages to the WebSocket - operationId: sendMessage + description: Send messages to the multi-context WebSocket. + operationId: sendMessageMulti message: oneOf: - - $ref: '#/components/messages/InitializeConnection' - - $ref: '#/components/messages/SendText' - - $ref: '#/components/messages/CloseConnection' + - $ref: '#/components/messages/InitializeConnectionMulti' + - $ref: '#/components/messages/InitialiseContext' + - $ref: '#/components/messages/SendTextMulti' + - $ref: '#/components/messages/FlushContextClient' + - $ref: '#/components/messages/CloseContextClient' + - $ref: '#/components/messages/CloseSocketClient' + - $ref: '#/components/messages/KeepContextAlive' subscribe: - description: Receive messages from the WebSocket - operationId: receiveMessage + description: Receive messages from the multi-context WebSocket. + operationId: receiveMessageMulti message: oneOf: - - $ref: '#/components/messages/AudioOutput' - - $ref: '#/components/messages/FinalOutput' + - $ref: '#/components/messages/AudioOutputMulti' + - $ref: '#/components/messages/FinalOutputMulti' x-fern-examples: - - query-parameters: - model_id: pcm_s16le + - name: Multi-Context TTS Example + description: Demonstrates initializing two contexts, sending text, and managing them. + query-parameters: + model_id: eleven_multilingual_v2 messages: - type: publish - messageId: InitializeConnection + messageId: InitializeConnectionMulti value: text: ' ' voice_settings: - speed: 1.0 stability: 0.5 similarity_boost: 0.8 - xi_api_key: + context_id: 'conv_1' - type: publish - messageId: SendText + messageId: SendTextMulti value: - text: 'Hello World' - try_trigger_generation: true + text: 'Hello from conversation one. ' + context_id: 'conv_1' - type: publish - messageId: CloseConnection + messageId: FlushContextClient value: - text: '' + text: 'This is added to the buffer of text to flush. ' + context_id: 'conv_1' + flush: true - type: subscribe - messageId: AudioOutput + messageId: AudioOutputMulti value: audio: Y3VyaW91cyBtaW5kcyB0aGluayBhbGlrZSA6KQ== - isFinal: false + is_final: false normalizedAlignment: - char_start_times_ms: [0, 3, 7, 9, 11, 12, 13, 15, 17, 19, 21] - chars_durations_ms: [3, 4, 2, 2, 1, 1, 2, 2, 2, 2, 3] + charStartTimesMs: [0, 3, 7, 9, 11, 12, 13, 15, 17, 19, 21] + charsDurationsMs: [3, 4, 2, 2, 1, 1, 2, 2, 2, 2, 3] chars: ['H', 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd'] alignment: - char_start_times_ms: [0, 3, 7, 9, 11, 12, 13, 15, 17, 19, 21] - chars_durations_ms: [3, 4, 2, 2, 1, 1, 2, 2, 2, 2, 3] + charStartTimesMs: [0, 3, 7, 9, 11, 12, 13, 15, 17, 19, 21] + charsDurationsMs: [3, 4, 2, 2, 1, 1, 2, 2, 2, 2, 3] chars: ['H', 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd'] + contextId: 'conv_1' + - type: publish + messageId: InitialiseContext + value: + text: 'Hi this is a new context with different settings! ' + context_id: 'interruption_context' + voice_settings: + stability: 0.2 + similarity_boost: 0.9 + - type: publish + messageId: CloseContextClient + value: + context_id: 'conv_1' + close_context: true + - type: publish + messageId: FlushContextClient + value: + context_id: 'interruption_context' + flush: true + - type: subscribe + messageId: AudioOutputMulti + value: + audio: Y3VyaW91cyBtaW5kcyB0aGluayBhbGlrZSA6KQ== + is_final: false + contextId: 'interruption_context' + - type: subscribe + messageId: FinalOutputMulti + value: + is_final: true + contextId: 'interruption_context' + - type: publish + messageId: KeepContextAlive + value: + context_id: 'interruption_context' + text: '' + - type: publish + messageId: CloseSocketClient + value: + close_socket: true + components: messages: SendText: @@ -188,6 +272,57 @@ components: messageId: finalOutput payload: $ref: '#/components/schemas/FinalOutput' + ClientMultiMessage: + payload: + $ref: '#/components/schemas/WebsocketTTSClientMessageMulti' + ServerMultiMessage: + payload: + $ref: '#/components/schemas/WebsocketTTSServerMessageMulti' + InitializeConnectionMulti: + messageId: initializeConnectionMulti + description: Message to initialize a new TTS context in a multi-context stream. + payload: + $ref: '#/components/schemas/InitializeConnectionMulti' + SendTextMulti: + messageId: sendTextMulti + description: Message to send text for synthesis to a specific context. + payload: + $ref: '#/components/schemas/SendTextMulti' + FlushContextClient: + messageId: flushContextClient + description: Message to flush the audio buffer for a specific context. + payload: + $ref: '#/components/schemas/FlushContext' + CloseContextClient: + messageId: closeContextClient + description: Message to close a specific TTS context. + payload: + $ref: '#/components/schemas/CloseContext' + CloseSocketClient: + messageId: closeSocketClient + description: Message to gracefully close the entire WebSocket connection. + payload: + $ref: '#/components/schemas/CloseSocket' + AudioOutputMulti: + messageId: audioOutputMulti + description: Server message containing an audio chunk for a specific context. + payload: + $ref: '#/components/schemas/AudioOutputMulti' + FinalOutputMulti: + messageId: finalOutputMulti + description: Server message indicating the final output for a specific context. + payload: + $ref: '#/components/schemas/FinalOutputMulti' + KeepContextAlive: + messageId: keepContextAlive + description: Message to keep a specific context alive by resetting its inactivity timeout. + payload: + $ref: '#/components/schemas/KeepContextAlive' + InitialiseContext: + messageId: initialiseContext + description: Message to initialize or re-initialize a TTS context with text and settings for multi-stream connections. + payload: + $ref: '#/components/schemas/InitialiseContext' schemas: InitializeConnection: type: object @@ -354,14 +489,14 @@ components: description: | Alignment information for the generated audio given the input normalized text sequence. properties: - char_start_times_ms: + charStartTimesMs: x-fern-type: list description: | A list of starting times (in milliseconds) for each character in the normalized text as it corresponds to the audio. For instance, the character 'H' starts at time 0 ms in the audio. Note these times are relative to the returned chunk from the model, and not the full audio response. - chars_durations_ms: + charsDurationsMs: x-fern-type: list description: | A list of durations (in milliseconds) for each character in the normalized text as it @@ -373,21 +508,21 @@ components: description: | A list of characters in the normalized text sequence. For instance, the first character is 'H'. Note that this list may contain spaces, punctuation, and other special characters. - The length of this list should be the same as the lengths of `char_start_times_ms` and `chars_durations_ms`. + The length of this list should be the same as the lengths of `charStartTimesMs` and `charsDurationsMs`. Alignment: type: object description: | Alignment information for the generated audio given the input text sequence. properties: - char_start_times_ms: + charStartTimesMs: x-fern-type: list description: | A list of starting times (in milliseconds) for each character in the text as it corresponds to the audio. For instance, the character 'H' starts at time 0 ms in the audio. Note these times are relative to the returned chunk from the model, and not the full audio response. - chars_durations_ms: + charsDurationsMs: x-fern-type: list description: | A list of durations (in milliseconds) for each character in the text as it @@ -399,7 +534,7 @@ components: description: | A list of characters in the text sequence. For instance, the first character is 'H'. Note that this list may contain spaces, punctuation, and other special characters. - The length of this list should be the same as the lengths of `char_start_times_ms` and `chars_durations_ms`. + The length of this list should be the same as the lengths of `charStartTimesMs` and `charsDurationsMs`. PronunciationDictionaryLocator: type: object @@ -414,3 +549,314 @@ components: required: - dictionary_id - version_id + + WebsocketTTSClientMessageMulti: + type: object + description: Message sent from the client to the multi-context TTS WebSocket. + properties: + text: + type: string + nullable: true + description: | + Text to be synthesized. + For the first message establishing a new context (identified by `context_id`, or a default context if `context_id` is absent), this should be a single space character (' '). + For subsequent messages to an active context, this is the text to synthesize. + This field can be null or an empty string if the message is primarily for control (e.g., using `flush`, `close_context`, or `close_socket`). + voice_settings: + $ref: '#/components/schemas/RealtimeVoiceSettings' + description: Voice settings. Can only be provided in the first message for a given context_id (or first message overall if context_id is not used/default). + generation_config: + $ref: '#/components/schemas/GenerationConfig' + description: Generation config. Can only be provided in the first message for a given context_id (or first message overall if context_id is not used/default). + xi-api-key: + type: string + description: Your ElevenLabs API key. Can only be provided in the first message for a given context_id if not present in the header. + authorization: + type: string + description: Your authorization bearer token. Can only be provided in the first message for a given context_id if not present in the header. + flush: + type: boolean + default: false + description: If true, flushes the audio buffer and returns the remaining audio for the specified `context_id`. + pronunciation_dictionary_locators: + type: array + items: + $ref: '#/components/schemas/PronunciationDictionaryLocator' + description: Optional list of pronunciation dictionary locators. Can only be provided in the first message for a given context_id. + context_id: + type: string + nullable: true + description: An identifier for the text-to-speech context. Allows managing multiple independent audio generation streams over a single WebSocket connection. If omitted, a default context is used. + close_context: + type: boolean + default: false + description: If true, closes the specified `context_id`. No further audio will be generated for this context. The `text` field is ignored. + close_socket: + type: boolean + default: false + description: If true, flushes all contexts and closes the entire WebSocket connection. The `text` and `context_id` fields are ignored. + + WebsocketTTSServerMessageMulti: + type: object + description: Message sent from the server to the client for the multi-context TTS WebSocket. + properties: + audio: + type: string + nullable: true + description: A generated partial audio chunk, encoded using the selected output_format (e.g., MP3 as a base64 string). + is_final: + type: boolean + nullable: true + description: If true, indicates that this is the final message for the specified contextId. This is sent when a context is closed. `audio` will be null or empty. + normalizedAlignment: + $ref: '#/components/schemas/NormalizedAlignment' + nullable: true + alignment: + $ref: '#/components/schemas/Alignment' + nullable: true + contextId: + type: string + nullable: true + description: The context identifier to which this message pertains. + + InitializeConnectionMulti: + type: object + description: Payload to initialize a new context in a multi-stream WebSocket connection. + properties: + text: + x-fern-type: literal<" "> + description: Must be a single space character to initiate the context. + voice_settings: + $ref: '#/components/schemas/RealtimeVoiceSettings' + generation_config: + $ref: '#/components/schemas/GenerationConfig' + pronunciation_dictionary_locators: + type: array + items: + $ref: '#/components/schemas/PronunciationDictionaryLocator' + description: Optional pronunciation dictionaries for this context. + xi_api_key: + type: string + description: Your ElevenLabs API key (if not in header). For this context's first message only. + authorization: + type: string + description: Your authorization bearer token (if not in header). For this context's first message only. + context_id: + type: string + description: A unique identifier for the first context created in the websocket. If not provided, a default context will be used. + required: + - text + + SendTextMulti: + type: object + description: Payload to send text for synthesis to an existing context. + required: + - text + properties: + text: + type: string + description: Text to synthesize. Should end with a single space. + context_id: + type: string + description: The target context_id for this text. + flush: + type: boolean + default: false + description: If true, flushes the audio buffer for the specified context. If false, the text will be appended to the buffer to be generated. + + FlushContext: + type: object + description: Payload to flush the audio buffer for a specific context. + required: + - context_id + - flush + properties: + context_id: + type: string + description: The context_id to flush. + text: + type: string + description: The text to append to the buffer to be flushed. + flush: + type: boolean + default: false + description: If true, flushes the audio buffer for the specified context. If false, the context will remain open and the text will be appended to the buffer to be generated. + + CloseContext: + type: object + description: Payload to close a specific TTS context. + required: + - context_id + - close_context + properties: + context_id: + type: string + description: The context_id to close. + close_context: + type: boolean + default: false + description: Must set the close_context to true, to close the specified context. If false, the context will remain open and the text will be ignored. If set to true, the context will close. If it has already been set to flush it will continue flushing. The same context id can be used again but will not be linked to the previous context with the same name. + + CloseSocket: + type: object + description: Payload to signal closing the entire WebSocket connection. + properties: + close_socket: + type: boolean + default: false + description: If true, closes all contexts and closes the entire WebSocket connection. Any context that was previously set to flush will wait to flush before closing. + + AudioOutputMulti: + type: object + description: Server payload containing an audio chunk for a specific context. + required: + - audio + properties: + audio: + type: string + description: Base64 encoded audio chunk. + normalizedAlignment: + $ref: '#/components/schemas/NormalizedAlignment' + nullable: true + alignment: + $ref: '#/components/schemas/Alignment' + nullable: true + context_id: + type: string + description: The context_id for which this audio is. + + FinalOutputMulti: + type: object + description: Server payload indicating the final output for a specific context. + required: + - isFinal + properties: + isFinal: + x-fern-type: literal + description: Indicates this is the final message for the context. + contextId: + type: string + description: The context_id for which this is the final message. + + KeepContextAlive: + type: object + description: Payload to keep a specific context alive by resetting its inactivity timeout. Empty text is ignored but resets the clock. + required: + - text + - context_id + properties: + text: + x-fern-type: literal<""> + description: An empty string. This text is ignored by the server but its presence resets the inactivity timeout for the specified context. + context_id: + type: string + description: The identifier of the context to keep alive. + + InitialiseContext: + type: object + description: Payload to initialize or re-initialize a TTS context with specific settings and initial text for multi-stream connections. + properties: + text: + type: string + description: The initial text to synthesize. Should end with a single space. + voice_settings: + $ref: '#/components/schemas/RealtimeVoiceSettings' + generation_config: + $ref: '#/components/schemas/GenerationConfig' + pronunciation_dictionary_locators: + type: array + items: + $ref: '#/components/schemas/PronunciationDictionaryLocator' + description: Optional list of pronunciation dictionary locators to be used for this context. + xi_api_key: + type: string + description: Your ElevenLabs API key. Required if not provided in the WebSocket connection's header or query parameters. This applies to the (re)initialization of this specific context. + authorization: + type: string + description: Your authorization bearer token. Required if not provided in the WebSocket connection's header or query parameters. This applies to the (re)initialization of this specific context. + context_id: + type: string + description: An identifier for the text-to-speech context. If omitted, a default context ID may be assigned by the server. If provided, this message will create a new context with this ID or re-initialize an existing one with the new settings and text. + required: + - text + TextToSpeechApplyTextNormalizationEnum: + description: >- + This parameter controls text normalization with three modes - 'auto', 'on', and 'off'. When set to 'auto', + the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', + text normalization will always be applied, while with 'off', it will be skipped. Cannot be turned on for + 'eleven_turbo_v2_5' or 'eleven_flash_v2_5' models. Defaults to 'auto'. + type: string + enum: ['auto', 'on', 'off'] + default: 'auto' + TextToSpeechOutputFormatEnum: + description: The output audio format + type: string + enum: + [ + 'mp3_22050_32', + 'mp3_44100_32', + 'mp3_44100_64', + 'mp3_44100_96', + 'mp3_44100_128', + 'mp3_44100_192', + 'pcm_8000', + 'pcm_16000', + 'pcm_22050', + 'pcm_24000', + 'pcm_44100', + 'ulaw_8000', + 'alaw_8000', + 'opus_48000_32', + 'opus_48000_64', + 'opus_48000_96', + 'opus_48000_128', + 'opus_48000_192', + ] + default: 'mp3_44100' + StreamInputQueryParameters: + type: object + properties: + model_id: + description: The model ID to use + type: string + language_code: + description: The ISO 639-1 language code (for Turbo v2.5 and Flash v2.5 models only) + type: string + enable_logging: + description: Whether to enable logging of the request + type: string + enable_ssml_parsing: + description: Whether to enable SSML parsing + type: boolean + default: false + optimize_streaming_latency: + description: Latency optimization level (deprecated) + type: string + enum: ['0', '1', '2', '3', '4'] + default: '0' + deprecated: true + output_format: + $ref: '#/components/schemas/TextToSpeechOutputFormatEnum' + inactivity_timeout: + description: Timeout for inactivity before connection is closed + type: number + default: 20 + sync_alignment: + description: Whether to include timing data with every audio chunk + type: boolean + default: false + auto_mode: + description: This parameter focuses on reducing the latency by disabling the chunk schedule and all buffers. It is only recommended when sending full sentences or phrases, sending partial phrases will result in highly reduced quality. By default it's set to false. + type: boolean + default: false + apply_text_normalization: + $ref: '#/components/schemas/TextToSpeechApplyTextNormalizationEnum' + seed: + description: >- + If specified, our system will make a best effort to sample deterministically, such that repeated requests + with the same seed and parameters should return the same result. Determinism is not guaranteed. Must be an + integer between 0 and 4294967295. + type: integer + minimum: 0 + maximum: 4294967295 + example: 12345 diff --git a/.mock/definition/__package__.yml b/.mock/definition/__package__.yml index 4ef31941..56345ae7 100644 --- a/.mock/definition/__package__.yml +++ b/.mock/definition/__package__.yml @@ -231,6 +231,25 @@ types: docs: The prompt for the agent source: openapi: openapi.json + AgentConfigDbModel: + properties: + first_message: + type: optional + docs: >- + If non-empty, the first message the agent will say. If empty, the + agent waits for the user to start the discussion. + default: '' + language: + type: optional + docs: Language of the agent - used for ASR and TTS + default: en + dynamic_variables: + type: optional + docs: Configuration for dynamic variables + prompt: + type: optional + source: + openapi: openapi.json AgentConfigOverride: properties: prompt: @@ -326,6 +345,14 @@ types: type: optional source: openapi: openapi.json + AgentSimulatedChatTestResponseModel: + properties: + simulated_conversation: + type: list + analysis: + type: ConversationHistoryAnalysisCommonModel + source: + openapi: openapi.json AgentSummaryResponseModel: properties: agent_id: @@ -334,8 +361,8 @@ types: name: type: string docs: The name of the agent - categories: - docs: The categories of the agent + tags: + docs: Agent tags used to categorize the agent type: list created_at_unix_secs: type: integer @@ -389,12 +416,12 @@ types: properties: type: type: optional> - items: - display-name: Items - type: ArrayJsonSchemaPropertyInputItems description: type: optional default: '' + items: + display-name: Items + type: ArrayJsonSchemaPropertyInputItems source: openapi: openapi.json ArrayJsonSchemaPropertyOutputItems: @@ -410,12 +437,12 @@ types: properties: type: type: optional> - items: - display-name: Items - type: ArrayJsonSchemaPropertyOutputItems description: type: optional default: '' + items: + display-name: Items + type: ArrayJsonSchemaPropertyOutputItems source: openapi: openapi.json AudioNativeCreateProjectResponseModel: @@ -531,6 +558,8 @@ types: - authorization_header - signed_url - shareable_link + - livekit_token + - livekit_token_website source: openapi: openapi.json BanReasonType: @@ -539,6 +568,43 @@ types: - manual source: openapi: openapi.json + BatchCallDetailedResponse: + docs: Detailed response model for a batch call including all recipients. + properties: + id: string + phone_number_id: string + name: string + agent_id: string + created_at_unix: integer + scheduled_time_unix: integer + total_calls_dispatched: integer + total_calls_scheduled: integer + last_updated_at_unix: integer + status: + type: BatchCallStatus + agent_name: string + recipients: + type: list + source: + openapi: openapi.json + BatchCallRecipientStatus: + enum: + - pending + - in_progress + - completed + - failed + - cancelled + source: + openapi: openapi.json + BatchCallStatus: + enum: + - pending + - in_progress + - completed + - failed + - cancelled + source: + openapi: openapi.json BodyAddChapterToAProjectV1ProjectsProjectIdChaptersAddPost: properties: name: @@ -763,6 +829,8 @@ types: name: type: optional docs: A custom, human-readable name for the document. + validation: + minLength: 1 url: type: optional docs: >- @@ -782,6 +850,8 @@ types: name: type: optional docs: A custom, human-readable name for the document. + validation: + minLength: 1 url: type: optional docs: >- @@ -1403,6 +1473,15 @@ types: type: string validation: minLength: 0 + response_timeout_secs: + type: optional + docs: >- + The maximum time in seconds to wait for the tool call to complete. + Must be between 1 and 30 seconds (inclusive). + default: 20 + validation: + min: 1 + max: 30 parameters: type: optional docs: Schema for any parameters to pass to the client @@ -1415,14 +1494,6 @@ types: client to respond, this is useful to show content to a user but not block the conversation default: false - response_timeout_secs: - type: optional - docs: >- - The maximum time in seconds to wait for a response from the client. - Should only be set if expects_response is true - validation: - min: 1 - max: 30 dynamic_variables: type: optional docs: Configuration for dynamic variables @@ -1445,6 +1516,15 @@ types: type: string validation: minLength: 0 + response_timeout_secs: + type: optional + docs: >- + The maximum time in seconds to wait for the tool call to complete. + Must be between 1 and 30 seconds (inclusive). + default: 20 + validation: + min: 1 + max: 30 parameters: type: optional docs: Schema for any parameters to pass to the client @@ -1457,14 +1537,6 @@ types: client to respond, this is useful to show content to a user but not block the conversation default: false - response_timeout_secs: - type: optional - docs: >- - The maximum time in seconds to wait for a response from the client. - Should only be set if expects_response is true - validation: - min: 1 - max: 30 dynamic_variables: type: optional docs: Configuration for dynamic variables @@ -1619,6 +1691,12 @@ types: transcript_summary: string source: openapi: openapi.json + ConversationHistoryBatchCallModel: + properties: + batch_call_id: string + batch_call_recipient_id: string + source: + openapi: openapi.json ConversationHistoryErrorCommonModel: properties: code: integer @@ -1650,6 +1728,8 @@ types: discriminant: type base-properties: {} union: + sip_trunking: + type: ConversationHistorySipTrunkingPhoneCallModel twilio: type: ConversationHistoryTwilioPhoneCallModel source: @@ -1672,6 +1752,8 @@ types: type: optional phone_call: type: optional + batch_call: + type: optional termination_reason: type: optional default: '' @@ -1689,17 +1771,64 @@ types: embedding_model: string source: openapi: openapi.json - ConversationHistoryTranscriptCommonModelRole: + ConversationHistorySipTrunkingPhoneCallModelDirection: + enum: + - inbound + - outbound + inline: true + source: + openapi: openapi.json + ConversationHistorySipTrunkingPhoneCallModel: + properties: + direction: + type: ConversationHistorySipTrunkingPhoneCallModelDirection + phone_number_id: string + agent_number: string + external_number: string + call_sid: string + source: + openapi: openapi.json + ConversationHistoryTranscriptCommonModelInputRole: + enum: + - user + - agent + inline: true + source: + openapi: openapi.json + ConversationHistoryTranscriptCommonModelInput: + properties: + role: + type: ConversationHistoryTranscriptCommonModelInputRole + message: + type: optional + tool_calls: + type: optional> + tool_results: + type: optional> + feedback: + type: optional + llm_override: + type: optional + time_in_call_secs: integer + conversation_turn_metrics: + type: optional + rag_retrieval_info: + type: optional + llm_usage: + type: optional + source: + openapi: openapi.json + ConversationHistoryTranscriptCommonModelOutputRole: enum: - user - agent inline: true source: openapi: openapi.json - ConversationHistoryTranscriptCommonModel: + ConversationHistoryTranscriptCommonModelOutput: properties: role: - type: ConversationHistoryTranscriptCommonModelRole + type: ConversationHistoryTranscriptCommonModelOutputRole message: type: optional tool_calls: @@ -1716,7 +1845,7 @@ types: rag_retrieval_info: type: optional llm_usage: - type: optional + type: optional source: openapi: openapi.json ConversationHistoryTranscriptToolCallClientDetails: @@ -1822,6 +1951,28 @@ types: default: false source: openapi: openapi.json + ConversationInitiationClientDataInternalDynamicVariablesValue: + discriminated: false + union: + - string + - double + - integer + - boolean + source: + openapi: openapi.json + inline: true + ConversationInitiationClientDataInternal: + properties: + conversation_config_override: + type: optional + custom_llm_extra_body: + type: optional> + dynamic_variables: + type: >- + optional>> + source: + openapi: openapi.json ConversationInitiationClientDataRequestInputDynamicVariablesValue: discriminated: false union: @@ -1891,6 +2042,22 @@ types: signed_url: string source: openapi: openapi.json + ConversationSimulationSpecification: + docs: >- + A specification that will be used to simulate a conversation between an + agent and an AI user. + properties: + simulated_user_config: + type: AgentConfigDbModel + tool_mock_config: + type: optional> + partial_conversation_history: + type: optional> + docs: >- + A partial conversation history to start the simulation from. If empty, + simulation starts fresh. + source: + openapi: openapi.json ConversationSummaryResponseModelStatus: enum: - value: in-progress @@ -2025,14 +2192,26 @@ types: phone_number: type: string docs: Phone number - provider: - type: optional label: type: string docs: Label for the phone number termination_uri: type: string docs: SIP trunk termination URI + address: + type: optional + docs: Hostname or IP the SIP INVITE is sent to. + transport: + type: optional + docs: Protocol to use for SIP transport (signalling layer). + media_encryption: + type: optional + docs: Whether or not to encrypt media (data layer). + headers: + type: optional> + docs: >- + SIP X-* headers for INVITE request. These headers are sent as-is and + may help identify this call. credentials: type: optional docs: >- @@ -2045,8 +2224,6 @@ types: phone_number: type: string docs: Phone number - provider: - type: optional label: type: string docs: Label for the phone number @@ -2082,6 +2259,12 @@ types: criteria_id: string source: openapi: openapi.json + DashboardDataCollectionChartModel: + properties: + name: string + data_collection_id: string + source: + openapi: openapi.json DataCollectionResultCommonModel: properties: data_collection_id: string @@ -2312,6 +2495,7 @@ types: start_time: double end_time: double text: optional + audio_stale: boolean media_ref: optional source: openapi: openapi.json @@ -2755,6 +2939,16 @@ types: docs: The token data for the agent source: openapi: openapi.json + GetAgentResponseModelPhoneNumbersItem: + discriminant: provider + base-properties: {} + union: + sip_trunk: + type: GetPhoneNumberSipTrunkResponseModel + twilio: + type: GetPhoneNumberTwilioResponseModel + source: + openapi: openapi.json GetAgentResponseModel: properties: agent_id: @@ -2773,14 +2967,14 @@ types: type: optional docs: The platform settings of the agent phone_numbers: - type: optional> + type: optional> docs: The phone numbers of the agent access_info: type: optional docs: The access information of the agent for the user - categories: + tags: type: optional> - docs: The categories of the agent + docs: Agent tags used to categorize the agent source: openapi: openapi.json GetAgentsPageResponseModel: @@ -2823,6 +3017,8 @@ types: type: DashboardCallSuccessChartModel criteria: type: DashboardCriteriaChartModel + data_collection: + type: DashboardDataCollectionChartModel source: openapi: openapi.json GetConvAiDashboardSettingsResponseModel: @@ -2837,6 +3033,11 @@ types: type: optional webhooks: type: optional + rag_retention_period_days: + type: optional + default: 10 + validation: + max: 30 source: openapi: openapi.json GetConversationResponseModelStatus: @@ -2856,7 +3057,7 @@ types: status: type: GetConversationResponseModelStatus transcript: - type: list + type: list metadata: type: ConversationHistoryMetadataCommonModel analysis: @@ -3036,14 +3237,29 @@ types: type: optional source: openapi: openapi.json - GetPhoneNumberResponseModel: + GetPhoneNumberSipTrunkResponseModel: + properties: + phone_number: + type: string + docs: Phone number + label: + type: string + docs: Label for the phone number + phone_number_id: + type: string + docs: The ID of the phone number + assigned_agent: + type: optional + docs: The agent that is assigned to the phone number + provider_config: + type: optional + source: + openapi: openapi.json + GetPhoneNumberTwilioResponseModel: properties: phone_number: type: string docs: Phone number - provider: - type: TelephonyProvider - docs: Phone provider label: type: string docs: Label for the phone number @@ -3303,9 +3519,9 @@ types: LlmCategoryUsage: properties: irreversible_generation: - type: optional + type: optional initiated_generation: - type: optional + type: optional source: openapi: openapi.json LlmInputOutputTokensUsage: @@ -3330,7 +3546,13 @@ types: default: 0 source: openapi: openapi.json - LlmUsage: + LlmUsageInput: + properties: + model_usage: + type: optional> + source: + openapi: openapi.json + LlmUsageOutput: properties: model_usage: type: optional> @@ -3524,6 +3746,66 @@ types: docs: The constant value of the property source: openapi: openapi.json + McpToolConfigInput: + docs: A MCP tool is a tool that is used to call a MCP server + properties: + id: + type: optional + default: '' + name: + type: string + validation: + pattern: ^[a-zA-Z0-9_-]{1,64}$ + minLength: 0 + description: + type: string + validation: + minLength: 0 + response_timeout_secs: + type: optional + docs: The maximum time in seconds to wait for the tool call to complete. + default: 20 + parameters: + type: optional + docs: Schema for any parameters the LLM needs to provide to the MCP tool. + mcp_tool_name: + type: string + docs: The name of the MCP tool to call + mcp_server_id: + type: string + docs: The id of the MCP server to call + source: + openapi: openapi.json + McpToolConfigOutput: + docs: A MCP tool is a tool that is used to call a MCP server + properties: + id: + type: optional + default: '' + name: + type: string + validation: + pattern: ^[a-zA-Z0-9_-]{1,64}$ + minLength: 0 + description: + type: string + validation: + minLength: 0 + response_timeout_secs: + type: optional + docs: The maximum time in seconds to wait for the tool call to complete. + default: 20 + parameters: + type: optional + docs: Schema for any parameters the LLM needs to provide to the MCP tool. + mcp_tool_name: + type: string + docs: The name of the MCP tool to call + mcp_server_id: + type: string + docs: The id of the MCP server to call + source: + openapi: openapi.json ManualVerificationFileResponse: properties: file_id: @@ -3702,13 +3984,13 @@ types: properties: type: type: optional> - properties: - type: optional> required: type: optional> description: type: optional default: '' + properties: + type: optional> source: openapi: openapi.json ObjectJsonSchemaPropertyOutputPropertiesValue: @@ -3724,13 +4006,13 @@ types: properties: type: type: optional> - properties: - type: optional> required: type: optional> description: type: optional default: '' + properties: + type: optional> source: openapi: openapi.json OrbAvatar: @@ -3745,6 +4027,19 @@ types: default: '#9ce6e6' source: openapi: openapi.json + OutboundCallRecipientResponseModel: + properties: + id: string + phone_number: string + status: + type: BatchCallRecipientStatus + created_at_unix: integer + updated_at_unix: integer + conversation_id: optional + conversation_initiation_client_data: + type: optional + source: + openapi: openapi.json PdfExportOptions: properties: include_speakers: @@ -3868,15 +4163,10 @@ types: type: optional docs: Whether to apply the privacy settings to existing conversations default: false - source: - openapi: openapi.json - ProfilePageResponseModel: - properties: - handle: optional - public_user_id: optional - name: optional - bio: optional - profile_picture: optional + zero_retention_mode: + type: optional + docs: Whether to enable zero retention mode - no PII data is stored + default: false source: openapi: openapi.json ProjectCreationMetaResponseModelStatus: @@ -4276,6 +4566,8 @@ types: union: client: type: ClientToolConfigInput + mcp: + type: McpToolConfigInput system: type: SystemToolConfigInput webhook: @@ -4307,6 +4599,9 @@ types: tool_ids: type: optional> docs: A list of IDs of tools used by the agent + mcp_server_ids: + type: optional> + docs: A list of MCP server ids to be used by the agent knowledge_base: type: optional> docs: A list of knowledge bases to be used by the agent @@ -4328,18 +4623,79 @@ types: union: client: type: ClientToolConfigOutput + mcp: + type: McpToolConfigOutput system: type: SystemToolConfigOutput webhook: type: WebhookToolConfigOutput source: openapi: openapi.json - PromptAgentOverride: - properties: - prompt: - type: optional - docs: >- - The initial system message that defines the agent, e.g. “You are a + PromptAgentDbModelToolsItem: + discriminant: type + base-properties: {} + docs: The type of tool + union: + client: + type: ClientToolConfigInput + mcp: + type: McpToolConfigInput + system: + type: SystemToolConfigInput + webhook: + type: WebhookToolConfigInput + source: + openapi: openapi.json + PromptAgentDbModel: + properties: + prompt: + type: optional + docs: The prompt for the agent + default: '' + llm: + type: optional + docs: The LLM to query with the prompt and the chat history + temperature: + type: optional + docs: The temperature for the LLM + default: 0 + max_tokens: + type: optional + docs: If greater than 0, maximum number of tokens the LLM can predict + default: -1 + tools: + type: optional> + docs: >- + A list of tools that the agent can use over the course of the + conversation + tool_ids: + type: optional> + docs: A list of IDs of tools used by the agent + mcp_server_ids: + type: optional> + docs: A list of MCP server ids to be used by the agent + knowledge_base: + type: optional> + docs: A list of knowledge bases to be used by the agent + custom_llm: + type: optional + docs: Definition for a custom LLM if LLM field is set to 'CUSTOM_LLM' + ignore_default_personality: + type: optional + docs: Whether to ignore the default personality + rag: + type: optional + docs: Configuration for RAG + knowledge_base_document_ids: + type: optional> + source: + openapi: openapi.json + PromptAgentOverride: + properties: + prompt: + type: optional + docs: >- + The initial system message that defines the agent, e.g. “You are a German language teacher named Laura.” default: '' source: @@ -4419,8 +4775,14 @@ types: openapi: openapi.json PronunciationDictionaryVersionLocator: properties: - pronunciation_dictionary_id: string - version_id: optional + pronunciation_dictionary_id: + type: string + docs: The ID of the pronunciation dictionary. + version_id: + type: optional + docs: >- + The ID of the version of the pronunciation dictionary. If not + provided, the latest version will be used. source: openapi: openapi.json PronunciationDictionaryVersionResponseModelPermissionOnResource: @@ -4646,6 +5008,40 @@ types: type: list source: openapi: openapi.json + SipMediaEncryptionEnum: + enum: + - disabled + - allowed + - required + source: + openapi: openapi.json + SipTrunkConfigResponseModel: + docs: SIP Trunk configuration details for a phone number + properties: + address: + type: string + docs: Hostname or IP the SIP INVITE is sent to + transport: + type: SipTrunkTransportEnum + docs: Protocol to use for SIP transport + media_encryption: + type: SipMediaEncryptionEnum + docs: Whether or not to encrypt media (data layer). + headers: + type: optional> + docs: SIP headers for INVITE request + has_auth_credentials: + type: boolean + docs: Whether authentication credentials are configured + username: + type: optional + docs: SIP trunk username (if available) + has_outbound_trunk: + type: optional + docs: Whether a LiveKit SIP outbound trunk is configured + default: false + source: + openapi: openapi.json SipTrunkCredentials: properties: username: @@ -4656,6 +5052,21 @@ types: docs: SIP trunk password source: openapi: openapi.json + SipTrunkOutboundCallResponse: + properties: + success: boolean + message: string + sip_call_id: optional + source: + openapi: openapi.json + SipTrunkTransportEnum: + enum: + - auto + - udp + - tcp + - tls + source: + openapi: openapi.json SafetyCommonModel: docs: >- Safety object that has the information of safety evaluations based on used @@ -4819,6 +5230,34 @@ types: 'key'). source: openapi: openapi.json + SimilarVoiceCategory: + enum: + - premade + - cloned + - generated + - professional + - famous + inline: true + source: + openapi: openapi.json + SimilarVoice: + properties: + voice_id: string + name: string + category: + type: SimilarVoiceCategory + description: + type: optional + preview_url: + type: optional + source: + openapi: openapi.json + SimilarVoicesForSpeakerResponse: + properties: + voices: + type: list + source: + openapi: openapi.json SpeakerAudioResponseModel: properties: audio_base_64: @@ -4890,10 +5329,17 @@ types: media_ref: type: DubbingMediaReference speaker_name: string + voices: + type: map segments: type: list source: openapi: openapi.json + SpeakerUpdatedResponse: + properties: + version: integer + source: + openapi: openapi.json SpeechHistoryItemResponseModelVoiceCategory: enum: - premade @@ -4908,9 +5354,11 @@ types: - TTS - STS - Projects + - PD - AN - Dubbing - PlayAPI + - ConvAI inline: true source: openapi: openapi.json @@ -4967,7 +5415,8 @@ types: type: optional docs: >- The source of the history item. Either TTS (text to speech), STS - (speech to text), AN (audio native), Projects, Dubbing or PlayAPI. + (speech to text), AN (audio native), Projects, Dubbing, PlayAPI, PD + (pronunciation dictionary) or ConvAI (conversational AI). alignments: type: optional docs: The alignments of the history item. @@ -5037,6 +5486,12 @@ types: speaker_id: type: optional docs: Unique identifier for the speaker of this word. + logprob: + type: double + docs: >- + The log of the probability with which this word was predicted. + Logprobs are in range [-infinity, 0], higher logprobs indicate a + higher confidence the model has in its predictions. characters: type: optional> docs: The characters that make up the word and their timing information. @@ -5292,6 +5747,10 @@ types: type: string validation: minLength: 0 + response_timeout_secs: + type: optional + docs: The maximum time in seconds to wait for the tool call to complete. + default: 20 params: display-name: Params type: SystemToolConfigInputParams @@ -5326,6 +5785,10 @@ types: type: string validation: minLength: 0 + response_timeout_secs: + type: optional + docs: The maximum time in seconds to wait for the tool call to complete. + default: 20 params: display-name: Params type: SystemToolConfigOutputParams @@ -5414,6 +5877,16 @@ types: - sip_trunk source: openapi: openapi.json + ToolMockConfig: + properties: + default_return_value: + type: optional + default: Tool Called. + default_is_error: + type: optional + default: false + source: + openapi: openapi.json TransferToAgentToolConfig: properties: transfers: @@ -5829,10 +6302,9 @@ types: speed: type: optional docs: >- - Controls the speed of the generated speech. Values range from 0.7 to - 1.2, with 1.0 being the default speed. Lower values create slower, - more deliberate speech while higher values produce faster-paced - speech. Extreme values can impact the quality of the generated speech. + Adjusts the speed of the voice. A value of 1.0 is the default speed, + while values less than 1.0 slow down the speech, and values greater + than 1.0 speed it up. source: openapi: openapi.json VoiceSharingModerationCheckResponseModel: @@ -6148,6 +6620,15 @@ types: type: string validation: minLength: 0 + response_timeout_secs: + type: optional + docs: >- + The maximum time in seconds to wait for the tool call to complete. + Must be between 5 and 120 seconds (inclusive). + default: 20 + validation: + min: 5 + max: 120 api_schema: type: WebhookToolApiSchemaConfigInput docs: >- @@ -6173,6 +6654,15 @@ types: type: string validation: minLength: 0 + response_timeout_secs: + type: optional + docs: >- + The maximum time in seconds to wait for the tool call to complete. + Must be between 5 and 120 seconds (inclusive). + default: 20 + validation: + min: 5 + max: 120 api_schema: type: WebhookToolApiSchemaConfigOutput docs: >- @@ -6443,6 +6933,7 @@ types: - convai_secrets - music_latent - convai_phone_numbers + - convai_mcps - convai_batch_calls docs: >- Resource types that can be shared in the workspace. The name always need @@ -6495,6 +6986,7 @@ types: AddSharingVoiceRequest: unknown CreateAudioNativeProjectRequest: unknown TextToSpeechStreamRequest: unknown + GetPhoneNumberResponse: unknown EditVoiceSettingsRequest: unknown GetChaptersRequest: unknown GetChapterRequest: unknown @@ -6739,7 +7231,7 @@ types: Alignment information for the generated audio given the input normalized text sequence. properties: - char_start_times_ms: + charStartTimesMs: type: optional> docs: > A list of starting times (in milliseconds) for each character in the @@ -6752,7 +7244,7 @@ types: and not the full audio response. - chars_durations_ms: + charsDurationsMs: type: optional> docs: > A list of durations (in milliseconds) for each character in the @@ -6775,7 +7267,7 @@ types: characters. The length of this list should be the same as the lengths of - `char_start_times_ms` and `chars_durations_ms`. + `charStartTimesMs` and `charsDurationsMs`. source: openapi: asyncapi.yml Alignment: @@ -6783,7 +7275,7 @@ types: Alignment information for the generated audio given the input text sequence. properties: - char_start_times_ms: + charStartTimesMs: type: optional> docs: > A list of starting times (in milliseconds) for each character in the @@ -6796,7 +7288,7 @@ types: and not the full audio response. - chars_durations_ms: + charsDurationsMs: type: optional> docs: > A list of durations (in milliseconds) for each character in the text @@ -6819,7 +7311,7 @@ types: characters. The length of this list should be the same as the lengths of - `char_start_times_ms` and `chars_durations_ms`. + `charStartTimesMs` and `charsDurationsMs`. source: openapi: asyncapi.yml PronunciationDictionaryLocator: @@ -6833,3 +7325,371 @@ types: docs: The version identifier of the pronunciation dictionary source: openapi: asyncapi.yml + WebsocketTtsClientMessageMulti: + docs: Message sent from the client to the multi-context TTS WebSocket. + properties: + text: + type: optional + docs: > + Text to be synthesized. + + For the first message establishing a new context (identified by + `context_id`, or a default context if `context_id` is absent), this + should be a single space character (' '). + + For subsequent messages to an active context, this is the text to + synthesize. + + This field can be null or an empty string if the message is primarily + for control (e.g., using `flush`, `close_context`, or `close_socket`). + voice_settings: + type: optional + docs: >- + Voice settings. Can only be provided in the first message for a given + context_id (or first message overall if context_id is not + used/default). + generation_config: + type: optional + docs: >- + Generation config. Can only be provided in the first message for a + given context_id (or first message overall if context_id is not + used/default). + xi-api-key: + type: optional + docs: >- + Your ElevenLabs API key. Can only be provided in the first message for + a given context_id if not present in the header. + authorization: + type: optional + docs: >- + Your authorization bearer token. Can only be provided in the first + message for a given context_id if not present in the header. + flush: + type: optional + docs: >- + If true, flushes the audio buffer and returns the remaining audio for + the specified `context_id`. + default: false + pronunciation_dictionary_locators: + type: optional> + docs: >- + Optional list of pronunciation dictionary locators. Can only be + provided in the first message for a given context_id. + context_id: + type: optional + docs: >- + An identifier for the text-to-speech context. Allows managing multiple + independent audio generation streams over a single WebSocket + connection. If omitted, a default context is used. + close_context: + type: optional + docs: >- + If true, closes the specified `context_id`. No further audio will be + generated for this context. The `text` field is ignored. + default: false + close_socket: + type: optional + docs: >- + If true, flushes all contexts and closes the entire WebSocket + connection. The `text` and `context_id` fields are ignored. + default: false + source: + openapi: asyncapi.yml + WebsocketTtsServerMessageMulti: + docs: >- + Message sent from the server to the client for the multi-context TTS + WebSocket. + properties: + audio: + type: optional + docs: >- + A generated partial audio chunk, encoded using the selected + output_format (e.g., MP3 as a base64 string). + is_final: + type: optional + docs: >- + If true, indicates that this is the final message for the specified + contextId. This is sent when a context is closed. `audio` will be null + or empty. + normalizedAlignment: optional + alignment: optional + contextId: + type: optional + docs: The context identifier to which this message pertains. + source: + openapi: asyncapi.yml + InitializeConnectionMulti: + docs: >- + Payload to initialize a new context in a multi-stream WebSocket + connection. + properties: + text: + type: literal<" "> + docs: Must be a single space character to initiate the context. + voice_settings: optional + generation_config: optional + pronunciation_dictionary_locators: + type: optional> + docs: Optional pronunciation dictionaries for this context. + xi_api_key: + type: optional + docs: >- + Your ElevenLabs API key (if not in header). For this context's first + message only. + authorization: + type: optional + docs: >- + Your authorization bearer token (if not in header). For this context's + first message only. + context_id: + type: optional + docs: >- + A unique identifier for the first context created in the websocket. If + not provided, a default context will be used. + source: + openapi: asyncapi.yml + SendTextMulti: + docs: Payload to send text for synthesis to an existing context. + properties: + text: + type: string + docs: Text to synthesize. Should end with a single space. + context_id: + type: optional + docs: The target context_id for this text. + flush: + type: optional + docs: >- + If true, flushes the audio buffer for the specified context. If false, + the text will be appended to the buffer to be generated. + default: false + source: + openapi: asyncapi.yml + FlushContext: + docs: Payload to flush the audio buffer for a specific context. + properties: + context_id: + type: string + docs: The context_id to flush. + text: + type: optional + docs: The text to append to the buffer to be flushed. + flush: + type: boolean + docs: >- + If true, flushes the audio buffer for the specified context. If false, + the context will remain open and the text will be appended to the + buffer to be generated. + default: false + source: + openapi: asyncapi.yml + CloseContext: + docs: Payload to close a specific TTS context. + properties: + context_id: + type: string + docs: The context_id to close. + close_context: + type: boolean + docs: >- + Must set the close_context to true, to close the specified context. If + false, the context will remain open and the text will be ignored. If + set to true, the context will close. If it has already been set to + flush it will continue flushing. The same context id can be used again + but will not be linked to the previous context with the same name. + default: false + source: + openapi: asyncapi.yml + CloseSocket: + docs: Payload to signal closing the entire WebSocket connection. + properties: + close_socket: + type: optional + docs: >- + If true, closes all contexts and closes the entire WebSocket + connection. Any context that was previously set to flush will wait to + flush before closing. + default: false + source: + openapi: asyncapi.yml + AudioOutputMulti: + docs: Server payload containing an audio chunk for a specific context. + properties: + audio: + type: string + docs: Base64 encoded audio chunk. + normalizedAlignment: optional + alignment: optional + context_id: + type: optional + docs: The context_id for which this audio is. + source: + openapi: asyncapi.yml + FinalOutputMulti: + docs: Server payload indicating the final output for a specific context. + properties: + isFinal: + type: literal + docs: Indicates this is the final message for the context. + contextId: + type: optional + docs: The context_id for which this is the final message. + source: + openapi: asyncapi.yml + KeepContextAlive: + docs: >- + Payload to keep a specific context alive by resetting its inactivity + timeout. Empty text is ignored but resets the clock. + properties: + text: + type: literal<""> + docs: >- + An empty string. This text is ignored by the server but its presence + resets the inactivity timeout for the specified context. + context_id: + type: string + docs: The identifier of the context to keep alive. + source: + openapi: asyncapi.yml + InitialiseContext: + docs: >- + Payload to initialize or re-initialize a TTS context with specific + settings and initial text for multi-stream connections. + properties: + text: + type: string + docs: The initial text to synthesize. Should end with a single space. + voice_settings: optional + generation_config: optional + pronunciation_dictionary_locators: + type: optional> + docs: >- + Optional list of pronunciation dictionary locators to be used for this + context. + xi_api_key: + type: optional + docs: >- + Your ElevenLabs API key. Required if not provided in the WebSocket + connection's header or query parameters. This applies to the + (re)initialization of this specific context. + authorization: + type: optional + docs: >- + Your authorization bearer token. Required if not provided in the + WebSocket connection's header or query parameters. This applies to the + (re)initialization of this specific context. + context_id: + type: optional + docs: >- + An identifier for the text-to-speech context. If omitted, a default + context ID may be assigned by the server. If provided, this message + will create a new context with this ID or re-initialize an existing + one with the new settings and text. + source: + openapi: asyncapi.yml + TextToSpeechApplyTextNormalizationEnum: + enum: + - auto + - 'on' + - 'off' + docs: >- + This parameter controls text normalization with three modes - 'auto', + 'on', and 'off'. When set to 'auto', the system will automatically decide + whether to apply text normalization (e.g., spelling out numbers). With + 'on', text normalization will always be applied, while with 'off', it will + be skipped. Cannot be turned on for 'eleven_turbo_v2_5' or + 'eleven_flash_v2_5' models. Defaults to 'auto'. + default: auto + source: + openapi: asyncapi.yml + TextToSpeechOutputFormatEnum: + enum: + - mp3_22050_32 + - mp3_44100_32 + - mp3_44100_64 + - mp3_44100_96 + - mp3_44100_128 + - mp3_44100_192 + - pcm_8000 + - pcm_16000 + - pcm_22050 + - pcm_24000 + - pcm_44100 + - ulaw_8000 + - alaw_8000 + - opus_48000_32 + - opus_48000_64 + - opus_48000_96 + - opus_48000_128 + - opus_48000_192 + docs: The output audio format + source: + openapi: asyncapi.yml + StreamInputQueryParametersOptimizeStreamingLatency: + enum: + - value: '0' + name: Zero + - value: '1' + name: One + - value: '2' + name: Two + - value: '3' + name: Three + - value: '4' + name: Four + docs: Latency optimization level (deprecated) + default: '0' + inline: true + source: + openapi: asyncapi.yml + StreamInputQueryParameters: + properties: + model_id: + type: optional + docs: The model ID to use + language_code: + type: optional + docs: >- + The ISO 639-1 language code (for Turbo v2.5 and Flash v2.5 models + only) + enable_logging: + type: optional + docs: Whether to enable logging of the request + enable_ssml_parsing: + type: optional + docs: Whether to enable SSML parsing + default: false + optimize_streaming_latency: + type: optional + docs: Latency optimization level (deprecated) + default: '0' + availability: deprecated + output_format: optional + inactivity_timeout: + type: optional + docs: Timeout for inactivity before connection is closed + default: 20 + sync_alignment: + type: optional + docs: Whether to include timing data with every audio chunk + default: false + auto_mode: + type: optional + docs: >- + This parameter focuses on reducing the latency by disabling the chunk + schedule and all buffers. It is only recommended when sending full + sentences or phrases, sending partial phrases will result in highly + reduced quality. By default it's set to false. + default: false + apply_text_normalization: optional + seed: + type: optional + docs: >- + If specified, our system will make a best effort to sample + deterministically, such that repeated requests with the same seed and + parameters should return the same result. Determinism is not + guaranteed. Must be an integer between 0 and 4294967295. + validation: + min: 0 + source: + openapi: asyncapi.yml diff --git a/.mock/definition/api.yml b/.mock/definition/api.yml index 29a7f1c6..6e964595 100644 --- a/.mock/definition/api.yml +++ b/.mock/definition/api.yml @@ -11,6 +11,10 @@ environments: urls: Base: https://api.us.elevenlabs.io/ WSS: wss://api.elevenlabs.io + Production EU: + urls: + Base: https://api.eu.residency.elevenlabs.io + WSS: wss://api.elevenlabs.io default-environment: Production default-url: Base headers: diff --git a/.mock/definition/audioNative.yml b/.mock/definition/audioNative.yml index f941f3d5..e9f03368 100644 --- a/.mock/definition/audioNative.yml +++ b/.mock/definition/audioNative.yml @@ -80,8 +80,8 @@ service: Either txt or HTML input file containing the article content. HTML should be formatted as follows '<html><body><div><p>Your - content</p><h5>More of your - content</h5><p>Some more of your + content</p><h3>More of your + content</h3><p>Some more of your content</p></div></body></html>' auto_convert: type: optional diff --git a/.mock/definition/conversationalAi.yml b/.mock/definition/conversationalAi.yml index 365c6fd2..5b8d3fc7 100644 --- a/.mock/definition/conversationalAi.yml +++ b/.mock/definition/conversationalAi.yml @@ -5,7 +5,7 @@ service: base-path: '' endpoints: get_signed_url: - path: /v1/convai/conversation/get_signed_url + path: /v1/convai/conversation/get-signed-url method: GET auth: false docs: >- @@ -35,7 +35,7 @@ service: audiences: - convai twilio_outbound_call: - path: /v1/convai/twilio/outbound_call + path: /v1/convai/twilio/outbound-call method: POST auth: false docs: Handle an outbound call via Twilio @@ -93,9 +93,9 @@ service: name: type: optional docs: A name to make the agent easier to find - categories: + tags: type: optional> - docs: Categories to help classify and filter the agent + docs: Tags to help classify and filter the agent content-type: application/json response: docs: Successful Response @@ -268,6 +268,7 @@ service: delete_transcript_and_pii: false delete_audio: false apply_to_existing_conversations: false + zero_retention_mode: false workspace_overrides: conversation_initiation_client_data_webhook: url: https://example.com/webhook @@ -279,19 +280,24 @@ service: ignore_safety_evaluation: true phone_numbers: - phone_number: phone_number - provider: twilio label: label phone_number_id: X3Pbu5gP6NNKBscdCdwB assigned_agent: agent_id: F3Pbu5gP6NNKBscdCdwB agent_name: My Agent + provider_config: + address: address + transport: auto + media_encryption: disabled + has_auth_credentials: true + provider: sip_trunk access_info: is_creator: true creator_name: John Doe creator_email: john.doe@example.com role: admin - categories: - - categories + tags: + - tags audiences: - convai delete_agent: @@ -336,9 +342,9 @@ service: name: type: optional docs: A name to make the agent easier to find - categories: + tags: type: optional> - docs: Categories to help classify and filter the agent + docs: Tags to help classify and filter the agent content-type: application/json response: docs: Successful Response @@ -486,6 +492,7 @@ service: delete_transcript_and_pii: false delete_audio: false apply_to_existing_conversations: false + zero_retention_mode: false workspace_overrides: conversation_initiation_client_data_webhook: url: https://example.com/webhook @@ -497,19 +504,24 @@ service: ignore_safety_evaluation: true phone_numbers: - phone_number: phone_number - provider: twilio label: label phone_number_id: X3Pbu5gP6NNKBscdCdwB assigned_agent: agent_id: F3Pbu5gP6NNKBscdCdwB agent_name: My Agent + provider_config: + address: address + transport: auto + media_encryption: disabled + has_auth_credentials: true + provider: sip_trunk access_info: is_creator: true creator_name: John Doe creator_email: john.doe@example.com role: admin - categories: - - categories + tags: + - tags audiences: - convai get_agent_widget: @@ -530,9 +542,9 @@ service: conversation_signature: type: optional docs: >- - An expiring token that enables a conversation to start. These can - be generated for an agent using the - /v1/convai/conversation/get_signed_url endpoint + An expiring token that enables a websocket conversation to start. + These can be generated for an agent using the + /v1/convai/conversation/get-signed-url endpoint response: docs: Successful Response type: root.GetAgentEmbedResponseModel @@ -685,7 +697,7 @@ service: agents: - agent_id: J3Pbu5gP6NNKBscdCdwB name: My Agent - categories: + tags: - Customer Support - Technical Help - Eleven @@ -911,6 +923,7 @@ service: label: label sid: sid token: token + provider: twilio response: body: phone_number_id: phone_number_id @@ -930,7 +943,7 @@ service: display-name: Get Phone Number response: docs: Successful Response - type: root.GetPhoneNumberResponseModel + type: ConversationalAiGetPhoneNumberResponse status-code: 200 errors: - root.UnprocessableEntityError @@ -940,12 +953,12 @@ service: response: body: phone_number: phone_number - provider: twilio label: label phone_number_id: X3Pbu5gP6NNKBscdCdwB assigned_agent: agent_id: F3Pbu5gP6NNKBscdCdwB agent_name: My Agent + provider: twilio audiences: - convai delete_phone_number: @@ -995,7 +1008,7 @@ service: content-type: application/json response: docs: Successful Response - type: root.GetPhoneNumberResponseModel + type: ConversationalAiUpdatePhoneNumberResponse status-code: 200 errors: - root.UnprocessableEntityError @@ -1006,12 +1019,12 @@ service: response: body: phone_number: phone_number - provider: twilio label: label phone_number_id: X3Pbu5gP6NNKBscdCdwB assigned_agent: agent_id: F3Pbu5gP6NNKBscdCdwB agent_name: My Agent + provider: twilio audiences: - convai get_phone_numbers: @@ -1024,7 +1037,7 @@ service: display-name: List Phone Numbers response: docs: Successful Response - type: list + type: list status-code: 200 errors: - root.UnprocessableEntityError @@ -1032,12 +1045,12 @@ service: - response: body: - phone_number: phone_number - provider: twilio label: label phone_number_id: X3Pbu5gP6NNKBscdCdwB assigned_agent: agent_id: F3Pbu5gP6NNKBscdCdwB agent_name: My Agent + provider: twilio audiences: - convai get_knowledge_base_list: @@ -1139,6 +1152,8 @@ service: name: type: optional docs: A custom, human-readable name for the document. + validation: + minLength: 1 url: type: optional docs: >- @@ -1186,6 +1201,8 @@ service: name: type: optional docs: A custom, human-readable name for the document. + validation: + minLength: 1 content-type: application/json response: docs: Successful Response @@ -1223,6 +1240,8 @@ service: name: type: optional docs: A custom, human-readable name for the document. + validation: + minLength: 1 content-type: multipart/form-data response: docs: Successful Response @@ -1257,6 +1276,8 @@ service: name: type: optional docs: A custom, human-readable name for the document. + validation: + minLength: 1 content-type: application/json response: docs: Successful Response @@ -1274,46 +1295,6 @@ service: prompt_injectable: true audiences: - convai - rag_index_status: - path: /v1/convai/knowledge-base/{documentation_id}/rag-index - method: POST - auth: false - docs: >- - In case the document is not RAG indexed, it triggers rag indexing task, - otherwise it just returns the current status. - source: - openapi: openapi.json - path-parameters: - documentation_id: - type: string - docs: >- - The id of a document from the knowledge base. This is returned on - document addition. - display-name: Compute Rag Index. - request: - name: RagIndexRequestModel - body: - properties: - model: - type: root.EmbeddingModelEnum - content-type: application/json - response: - docs: Successful Response - type: root.RagIndexResponseModel - status-code: 200 - errors: - - root.UnprocessableEntityError - examples: - - path-parameters: - documentation_id: 21m00Tcm4TlvDq8ikWAM - request: - model: e5_mistral_7b_instruct - response: - body: - status: created - progress_percentage: 1.1 - audiences: - - convai get_knowledge_base_document_by_id: path: /v1/convai/knowledge-base/{documentation_id} method: GET @@ -1386,6 +1367,60 @@ service: key: value audiences: - convai + update_knowledge_base_document: + path: /v1/convai/knowledge-base/{documentation_id} + method: PATCH + auth: false + docs: Update the name of a document + source: + openapi: openapi.json + path-parameters: + documentation_id: + type: string + docs: >- + The id of a document from the knowledge base. This is returned on + document addition. + display-name: Update Document + request: + name: BodyUpdateDocumentV1ConvaiKnowledgeBaseDocumentationIdPatch + body: + properties: + name: + type: string + docs: A custom, human-readable name for the document. + validation: + minLength: 1 + content-type: application/json + response: + docs: Successful Response + type: ConversationalAiUpdateKnowledgeBaseDocumentResponse + status-code: 200 + errors: + - root.UnprocessableEntityError + examples: + - path-parameters: + documentation_id: 21m00Tcm4TlvDq8ikWAM + request: + name: name + response: + body: + id: id + name: name + metadata: + created_at_unix_secs: 1 + last_updated_at_unix_secs: 1 + size_bytes: 1 + prompt_injectable: true + access_info: + is_creator: true + creator_name: John Doe + creator_email: john.doe@example.com + role: admin + extracted_inner_html: extracted_inner_html + url: url + type: url + audiences: + - convai get_dependent_agents: path: /v1/convai/knowledge-base/{documentation_id}/dependent-agents method: GET @@ -1514,6 +1549,7 @@ service: Content-Type: application/json webhooks: post_call_webhook_id: post_call_webhook_id + rag_retention_period_days: 1 audiences: - convai update_settings: @@ -1532,6 +1568,11 @@ service: type: optional webhooks: type: optional + rag_retention_period_days: + type: optional + default: 10 + validation: + max: 30 content-type: application/json response: docs: Successful Response @@ -1549,6 +1590,7 @@ service: Content-Type: application/json webhooks: post_call_webhook_id: post_call_webhook_id + rag_retention_period_days: 1 audiences: - convai get_dashboard_settings: @@ -1695,15 +1737,89 @@ service: secret_id: secret_id audiences: - convai + get_batch_call: + path: /v1/convai/batch-calling/{batch_id} + method: GET + auth: false + docs: Get detailed information about a batch call including all recipients. + source: + openapi: openapi.json + path-parameters: + batch_id: string + display-name: Get A Batch Call By Id. + response: + docs: Successful Response + type: root.BatchCallDetailedResponse + status-code: 200 + errors: + - root.UnprocessableEntityError + examples: + - path-parameters: + batch_id: batch_id + response: + body: + id: id + phone_number_id: phone_number_id + name: name + agent_id: agent_id + created_at_unix: 1 + scheduled_time_unix: 1 + total_calls_dispatched: 1 + total_calls_scheduled: 1 + last_updated_at_unix: 1 + status: pending + agent_name: agent_name + recipients: + - id: id + phone_number: phone_number + status: pending + created_at_unix: 1 + updated_at_unix: 1 + conversation_id: conversation_id + audiences: + - convai source: openapi: openapi.json types: ConversationalAiCreatePhoneNumberRequestBody: - discriminated: false + discriminant: provider + base-properties: {} docs: Create Phone Request Information union: - - type: root.CreateTwilioPhoneNumberRequest - - type: root.CreateSipTrunkPhoneNumberRequest + twilio: + type: root.CreateTwilioPhoneNumberRequest + sip_trunk: + type: root.CreateSipTrunkPhoneNumberRequest + source: + openapi: openapi.json + ConversationalAiGetPhoneNumberResponse: + discriminant: provider + base-properties: {} + union: + twilio: + type: root.GetPhoneNumberTwilioResponseModel + sip_trunk: + type: root.GetPhoneNumberSipTrunkResponseModel + source: + openapi: openapi.json + ConversationalAiUpdatePhoneNumberResponse: + discriminant: provider + base-properties: {} + union: + twilio: + type: root.GetPhoneNumberTwilioResponseModel + sip_trunk: + type: root.GetPhoneNumberSipTrunkResponseModel + source: + openapi: openapi.json + ConversationalAiGetPhoneNumbersResponseItem: + discriminant: provider + base-properties: {} + union: + twilio: + type: root.GetPhoneNumberTwilioResponseModel + sip_trunk: + type: root.GetPhoneNumberSipTrunkResponseModel source: openapi: openapi.json ConversationalAiGetKnowledgeBaseDocumentByIdResponse: @@ -1718,6 +1834,18 @@ types: type: root.GetKnowledgeBaseTextResponseModel source: openapi: openapi.json + ConversationalAiUpdateKnowledgeBaseDocumentResponse: + discriminant: type + base-properties: {} + union: + url: + type: root.GetKnowledgeBaseUrlResponseModel + file: + type: root.GetKnowledgeBaseFileResponseModel + text: + type: root.GetKnowledgeBaseTextResponseModel + source: + openapi: openapi.json PatchConvAiDashboardSettingsRequestChartsItem: discriminant: type base-properties: {} @@ -1726,5 +1854,7 @@ types: type: root.DashboardCallSuccessChartModel criteria: type: root.DashboardCriteriaChartModel + data_collection: + type: root.DashboardDataCollectionChartModel source: openapi: openapi.json diff --git a/.mock/definition/conversationalAi/agents.yml b/.mock/definition/conversationalAi/agents.yml new file mode 100644 index 00000000..cb311e11 --- /dev/null +++ b/.mock/definition/conversationalAi/agents.yml @@ -0,0 +1,134 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + simulate_conversation: + path: /v1/convai/agents/{agent_id}/simulate-conversation + method: POST + auth: false + docs: Run a conversation between the agent and a simulated user. + source: + openapi: openapi.json + path-parameters: + agent_id: + type: string + docs: The id of an agent. This is returned on agent creation. + display-name: Simulates A Conversation + request: + name: >- + BodySimulatesAConversationV1ConvaiAgentsAgentIdSimulateConversationPost + body: + properties: + simulation_specification: + type: root.ConversationSimulationSpecification + docs: >- + A specification detailing how the conversation should be + simulated + extra_evaluation_criteria: + type: optional> + docs: A list of evaluation criteria to test + content-type: application/json + response: + docs: Successful Response + type: root.AgentSimulatedChatTestResponseModel + status-code: 200 + errors: + - root.UnprocessableEntityError + examples: + - path-parameters: + agent_id: 21m00Tcm4TlvDq8ikWAM + request: + simulation_specification: + simulated_user_config: + first_message: Hello, how can I help you today? + language: en + response: + body: + simulated_conversation: + - role: user + message: message + tool_calls: + - request_id: request_id + tool_name: tool_name + params_as_json: params_as_json + tool_has_been_called: true + tool_results: + - request_id: request_id + tool_name: tool_name + result_value: result_value + is_error: true + tool_has_been_called: true + feedback: + score: like + time_in_call_secs: 1 + llm_override: llm_override + time_in_call_secs: 1 + rag_retrieval_info: + chunks: + - document_id: document_id + chunk_id: chunk_id + vector_distance: 1.1 + embedding_model: e5_mistral_7b_instruct + retrieval_query: retrieval_query + rag_latency_secs: 1.1 + analysis: + evaluation_criteria_results: + key: + criteria_id: criteria_id + result: success + rationale: rationale + data_collection_results: + key: + data_collection_id: data_collection_id + rationale: rationale + call_successful: success + transcript_summary: transcript_summary + audiences: + - convai + simulate_conversation_stream: + path: /v1/convai/agents/{agent_id}/simulate-conversation/stream + method: POST + auth: false + docs: >- + Run a conversation between the agent and a simulated user and stream + back the response. Response is streamed back as partial lists of + messages that should be concatenated and once the conversation has + complete a single final message with the conversation analysis will be + sent. + source: + openapi: openapi.json + path-parameters: + agent_id: + type: string + docs: The id of an agent. This is returned on agent creation. + display-name: Simulates A Conversation (Stream) + request: + name: >- + BodySimulatesAConversationStreamV1ConvaiAgentsAgentIdSimulateConversationStreamPost + body: + properties: + simulation_specification: + type: root.ConversationSimulationSpecification + docs: >- + A specification detailing how the conversation should be + simulated + extra_evaluation_criteria: + type: optional> + docs: A list of evaluation criteria to test + content-type: application/json + errors: + - root.UnprocessableEntityError + examples: + - path-parameters: + agent_id: 21m00Tcm4TlvDq8ikWAM + request: + simulation_specification: + simulated_user_config: + first_message: Hello, how can I help you today? + language: en + audiences: + - convai + source: + openapi: openapi.json diff --git a/.mock/definition/conversationalAi/knowledgeBase/document.yml b/.mock/definition/conversationalAi/knowledgeBase/document.yml new file mode 100644 index 00000000..dff8d70f --- /dev/null +++ b/.mock/definition/conversationalAi/knowledgeBase/document.yml @@ -0,0 +1,48 @@ +imports: + root: ../../__package__.yml +service: + auth: false + base-path: '' + endpoints: + compute_rag_index: + path: /v1/convai/knowledge-base/{documentation_id}/rag-index + method: POST + auth: false + docs: >- + In case the document is not RAG indexed, it triggers rag indexing task, + otherwise it just returns the current status. + source: + openapi: openapi.json + path-parameters: + documentation_id: + type: string + docs: >- + The id of a document from the knowledge base. This is returned on + document addition. + display-name: Compute Rag Index. + request: + name: RagIndexRequestModel + body: + properties: + model: + type: root.EmbeddingModelEnum + content-type: application/json + response: + docs: Successful Response + type: root.RagIndexResponseModel + status-code: 200 + errors: + - root.UnprocessableEntityError + examples: + - path-parameters: + documentation_id: 21m00Tcm4TlvDq8ikWAM + request: + model: e5_mistral_7b_instruct + response: + body: + status: created + progress_percentage: 1.1 + audiences: + - convai + source: + openapi: openapi.json diff --git a/.mock/definition/conversationalAi/sipTrunk.yml b/.mock/definition/conversationalAi/sipTrunk.yml new file mode 100644 index 00000000..a9249e03 --- /dev/null +++ b/.mock/definition/conversationalAi/sipTrunk.yml @@ -0,0 +1,44 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + outbound_call: + path: /v1/convai/sip-trunk/outbound-call + method: POST + auth: false + docs: Handle an outbound call via SIP trunk + source: + openapi: openapi.json + display-name: Handle An Outbound Call Via Sip Trunk + request: + name: BodyHandleAnOutboundCallViaSipTrunkV1ConvaiSipTrunkOutboundCallPost + body: + properties: + agent_id: string + agent_phone_number_id: string + to_number: string + conversation_initiation_client_data: + type: optional + content-type: application/json + response: + docs: Successful Response + type: root.SipTrunkOutboundCallResponse + status-code: 200 + errors: + - root.UnprocessableEntityError + examples: + - request: + agent_id: agent_id + agent_phone_number_id: agent_phone_number_id + to_number: to_number + response: + body: + success: true + message: message + sip_call_id: sip_call_id + audiences: + - convai + source: + openapi: openapi.json diff --git a/.mock/definition/dubbing.yml b/.mock/definition/dubbing.yml index 6b731bc4..9cf1fbc2 100644 --- a/.mock/definition/dubbing.yml +++ b/.mock/definition/dubbing.yml @@ -70,6 +70,8 @@ service: is_audio: true url: url speaker_name: speaker_name + voices: + key: value segments: - segments speaker_segments: @@ -82,6 +84,7 @@ service: key: start_time: 1.1 end_time: 1.1 + audio_stale: true renders: key: id: id @@ -132,50 +135,6 @@ service: response: body: version: 1 - create_segment_for_speaker: - path: /v1/dubbing/resource/{dubbing_id}/speaker/{speaker_id}/segment - method: POST - auth: false - docs: >- - Creates a new segment in dubbing resource with a start and end time for - the speaker in every available language. Does not automatically generate - transcripts/translations/audio. - source: - openapi: openapi.json - path-parameters: - dubbing_id: - type: string - docs: ID of the dubbing project. - speaker_id: - type: string - docs: ID of the speaker. - display-name: Add speaker segment to dubbing resource - request: - name: SegmentCreatePayload - body: - properties: - start_time: double - end_time: double - text: - type: optional - content-type: application/json - response: - docs: Successful Response - type: root.SegmentCreateResponse - status-code: 201 - errors: - - root.UnprocessableEntityError - examples: - - path-parameters: - dubbing_id: dubbing_id - speaker_id: speaker_id - request: - start_time: 1.1 - end_time: 1.1 - response: - body: - version: 1 - new_segment: new_segment update_segment_language: path: /v1/dubbing/resource/{dubbing_id}/segment/{segment_id}/{language} method: PATCH diff --git a/.mock/definition/dubbing/speaker.yml b/.mock/definition/dubbing/speaker.yml new file mode 100644 index 00000000..45d5acfb --- /dev/null +++ b/.mock/definition/dubbing/speaker.yml @@ -0,0 +1,91 @@ +imports: + root: ../__package__.yml +service: + auth: false + base-path: '' + endpoints: + update: + path: /v1/dubbing/resource/{dubbing_id}/speaker/{speaker_id} + method: PATCH + auth: false + docs: >- + Amend the metadata associated with a speaker, such as their voice. Both + voice cloning and using voices from the ElevenLabs library are + supported. + source: + openapi: openapi.json + path-parameters: + dubbing_id: + type: string + docs: ID of the dubbing project. + speaker_id: + type: string + docs: ID of the speaker. + display-name: Update Metadata For A Speaker + request: + name: >- + BodyUpdateMetadataForASpeakerV1DubbingResourceDubbingIdSpeakerSpeakerIdPatch + body: + properties: + voice_id: + type: optional + docs: >- + Either the identifier of a voice from the ElevenLabs voice + library, or one of ['track-clone', 'clip-clone']. + languages: + type: optional> + docs: >- + Languages to apply these changes to. If empty, will apply to all + languages. + content-type: application/json + response: + docs: Successful Response + type: root.SpeakerUpdatedResponse + status-code: 200 + errors: + - root.UnprocessableEntityError + examples: + - path-parameters: + dubbing_id: dubbing_id + speaker_id: speaker_id + request: {} + response: + body: + version: 1 + similar_voices: + path: /v1/dubbing/resource/{dubbing_id}/speaker/{speaker_id}/similar-voices + method: GET + auth: false + docs: >- + Fetch the top 10 similar voices to a speaker, including the voice IDs, + names, descriptions, and, where possible, a sample audio recording. + source: + openapi: openapi.json + path-parameters: + dubbing_id: + type: string + docs: ID of the dubbing project. + speaker_id: + type: string + docs: ID of the speaker. + display-name: Search The Elevenlabs Library For Voices Similar To A Speaker. + response: + docs: Successful Response + type: root.SimilarVoicesForSpeakerResponse + status-code: 200 + errors: + - root.UnprocessableEntityError + examples: + - path-parameters: + dubbing_id: dubbing_id + speaker_id: speaker_id + response: + body: + voices: + - voice_id: voice_id + name: name + category: premade + description: description + preview_url: preview_url + source: + openapi: openapi.json diff --git a/.mock/definition/dubbing/speaker/segment.yml b/.mock/definition/dubbing/speaker/segment.yml new file mode 100644 index 00000000..c39a779b --- /dev/null +++ b/.mock/definition/dubbing/speaker/segment.yml @@ -0,0 +1,54 @@ +imports: + root: ../../__package__.yml +service: + auth: false + base-path: '' + endpoints: + create: + path: /v1/dubbing/resource/{dubbing_id}/speaker/{speaker_id}/segment + method: POST + auth: false + docs: >- + Creates a new segment in dubbing resource with a start and end time for + the speaker in every available language. Does not automatically generate + transcripts/translations/audio. + source: + openapi: openapi.json + path-parameters: + dubbing_id: + type: string + docs: ID of the dubbing project. + speaker_id: + type: string + docs: ID of the speaker. + display-name: Add speaker segment to dubbing resource + request: + name: SegmentCreatePayload + body: + properties: + start_time: double + end_time: double + text: + type: optional + translations: + type: optional>> + content-type: application/json + response: + docs: Successful Response + type: root.SegmentCreateResponse + status-code: 201 + errors: + - root.UnprocessableEntityError + examples: + - path-parameters: + dubbing_id: dubbing_id + speaker_id: speaker_id + request: + start_time: 1.1 + end_time: 1.1 + response: + body: + version: 1 + new_segment: new_segment + source: + openapi: openapi.json diff --git a/.mock/definition/speechToText.yml b/.mock/definition/speechToText.yml index e9f6af39..1b685bb2 100644 --- a/.mock/definition/speechToText.yml +++ b/.mock/definition/speechToText.yml @@ -142,6 +142,7 @@ service: end: 0.5 type: word speaker_id: speaker_1 + logprob: 1.1 characters: - text: text start: 0 @@ -151,6 +152,7 @@ service: end: 0.5 type: spacing speaker_id: speaker_1 + logprob: 1.1 characters: - text: text start: 0 @@ -160,6 +162,7 @@ service: end: 1.2 type: word speaker_id: speaker_1 + logprob: 1.1 characters: - text: text start: 0 diff --git a/.mock/definition/textToSpeech.yml b/.mock/definition/textToSpeech.yml index a192f722..62aa26bf 100644 --- a/.mock/definition/textToSpeech.yml +++ b/.mock/definition/textToSpeech.yml @@ -271,7 +271,7 @@ service: using GET /v1/models. The model needs to have support for text to speech, you can check this using the can_do_text_to_speech property. - default: eleven_monolingual_v1 + default: eleven_multilingual_v2 language_code: type: optional docs: >- @@ -450,7 +450,7 @@ service: using GET /v1/models. The model needs to have support for text to speech, you can check this using the can_do_text_to_speech property. - default: eleven_monolingual_v1 + default: eleven_multilingual_v2 language_code: type: optional docs: >- @@ -668,7 +668,7 @@ service: using GET /v1/models. The model needs to have support for text to speech, you can check this using the can_do_text_to_speech property. - default: eleven_monolingual_v1 + default: eleven_multilingual_v2 language_code: type: optional docs: >- @@ -849,7 +849,7 @@ service: using GET /v1/models. The model needs to have support for text to speech, you can check this using the can_do_text_to_speech property. - default: eleven_monolingual_v1 + default: eleven_multilingual_v2 language_code: type: optional docs: >- diff --git a/.mock/definition/usage.yml b/.mock/definition/usage.yml index 4c8e6f13..c70f1ae0 100644 --- a/.mock/definition/usage.yml +++ b/.mock/definition/usage.yml @@ -9,12 +9,12 @@ service: method: GET auth: false docs: >- - Returns the credit usage metrics for the current user or the entire - workspace they are part of. The response will return a time axis with - unix timestamps for each day and daily usage along that axis. The usage - will be broken down by the specified breakdown type. For example, - breakdown type "voice" will return the usage of each voice along the - time axis. + Returns the usage metrics for the current user or the entire workspace + they are part of. The response provides a time axis based on the + specified aggregation interval (default: day), with usage values for + each interval along that axis. Usage is broken down by the selected + breakdown type. For example, breakdown type "voice" will return the + usage of each voice for each interval along the time axis. source: openapi: openapi.json display-name: Get character usage metrics diff --git a/.mock/definition/v1TextToSpeechVoiceIdMultiStreamInput.yml b/.mock/definition/v1TextToSpeechVoiceIdMultiStreamInput.yml new file mode 100644 index 00000000..8a5b0958 --- /dev/null +++ b/.mock/definition/v1TextToSpeechVoiceIdMultiStreamInput.yml @@ -0,0 +1,287 @@ +types: + TextToSpeechOutputFormat: + enum: + - mp3_22050_32 + - mp3_44100_32 + - mp3_44100_64 + - mp3_44100_96 + - mp3_44100_128 + - mp3_44100_192 + - pcm_8000 + - pcm_16000 + - pcm_22050 + - pcm_24000 + - pcm_44100 + - ulaw_8000 + - alaw_8000 + - opus_48000_32 + - opus_48000_64 + - opus_48000_96 + - opus_48000_128 + - opus_48000_192 + docs: The output audio format + source: + openapi: asyncapi.yml + TextToSpeechApplyTextNormalization: + enum: + - auto + - 'on' + - 'off' + docs: >- + This parameter controls text normalization with three modes - 'auto', + 'on', and 'off'. When set to 'auto', the system will automatically decide + whether to apply text normalization (e.g., spelling out numbers). With + 'on', text normalization will always be applied, while with 'off', it will + be skipped. Cannot be turned on for 'eleven_turbo_v2_5' or + 'eleven_flash_v2_5' models. Defaults to 'auto'. + default: auto + source: + openapi: asyncapi.yml + sendMessageMulti: + discriminated: false + docs: Send messages to the multi-context WebSocket. + union: + - root.InitializeConnectionMulti + - root.InitialiseContext + - root.SendTextMulti + - root.FlushContext + - root.CloseContext + - root.CloseSocket + - root.KeepContextAlive + source: + openapi: asyncapi.yml + receiveMessageMulti: + discriminated: false + docs: Receive messages from the multi-context WebSocket. + union: + - root.AudioOutputMulti + - root.FinalOutputMulti + source: + openapi: asyncapi.yml +channel: + path: /v1/text-to-speech/{voice_id}/multi-stream-input + url: WSS + auth: false + docs: > + The Multi-Context Text-to-Speech WebSockets API allows for generating audio + from text input + + while managing multiple independent audio generation streams (contexts) over + a single WebSocket connection. + + This is useful for scenarios requiring concurrent or interleaved audio + generations, such as dynamic + + conversational AI applications. + + + Each context, identified by a context id, maintains its own state. You can + send text to specific + + contexts, flush them, or close them independently. A `close_socket` message + can be used to terminate + + the entire connection gracefully. + + + For more information on how to use this API for conversational agents see + the [conversational agents + guide](/docs/best-practices/conversational-agents). + path-parameters: + voice_id: + type: string + docs: The unique identifier for the voice to use in the TTS process. + query-parameters: + authorization: + type: optional + docs: Your authorization bearer token. + model_id: + type: optional + docs: The model ID to use. + language_code: + type: optional + docs: The ISO 639-1 language code (for specific models). + enable_logging: + type: optional + default: true + docs: Whether to enable logging of the request. + enable_ssml_parsing: + type: optional + default: false + docs: Whether to enable SSML parsing. + output_format: + type: optional + docs: The output audio format + inactivity_timeout: + type: optional + default: 20 + docs: >- + Timeout for inactivity before a context is closed (seconds), can be up + to 180 seconds. + sync_alignment: + type: optional + default: false + docs: Whether to include timing data with every audio chunk. + auto_mode: + type: optional + default: false + docs: >- + Reduces latency by disabling chunk schedule and buffers. Recommended for + full sentences/phrases. + apply_text_normalization: + type: optional + default: auto + docs: >- + This parameter controls text normalization with three modes - 'auto', + 'on', and 'off'. When set to 'auto', the system will automatically + decide whether to apply text normalization (e.g., spelling out numbers). + With 'on', text normalization will always be applied, while with 'off', + it will be skipped. Cannot be turned on for 'eleven_turbo_v2_5' or + 'eleven_flash_v2_5' models. Defaults to 'auto'. + seed: + type: optional + docs: >- + If specified, system will best-effort sample deterministically. Integer + between 0 and 4294967295. + validation: + min: 0 + messages: + publish: + origin: client + body: + type: sendMessageMulti + docs: Send messages to the multi-context WebSocket. + subscribe: + origin: server + body: + type: receiveMessageMulti + docs: Receive messages from the multi-context WebSocket. + examples: + - messages: + - type: publish + body: + text: ' ' + voice_settings: + stability: 0.5 + similarity_boost: 0.8 + context_id: conv_1 + - type: publish + body: + text: 'Hello from conversation one. ' + context_id: conv_1 + - type: publish + body: + context_id: conv_1 + text: 'This is added to the buffer of text to flush. ' + flush: true + - type: subscribe + body: + audio: Y3VyaW91cyBtaW5kcyB0aGluayBhbGlrZSA6KQ== + normalizedAlignment: + charStartTimesMs: + - 0 + - 3 + - 7 + - 9 + - 11 + - 12 + - 13 + - 15 + - 17 + - 19 + - 21 + charsDurationsMs: + - 3 + - 4 + - 2 + - 2 + - 1 + - 1 + - 2 + - 2 + - 2 + - 2 + - 3 + chars: + - H + - e + - l + - l + - o + - ' ' + - w + - o + - r + - l + - d + alignment: + charStartTimesMs: + - 0 + - 3 + - 7 + - 9 + - 11 + - 12 + - 13 + - 15 + - 17 + - 19 + - 21 + charsDurationsMs: + - 3 + - 4 + - 2 + - 2 + - 1 + - 1 + - 2 + - 2 + - 2 + - 2 + - 3 + chars: + - H + - e + - l + - l + - o + - ' ' + - w + - o + - r + - l + - d + - type: publish + body: + text: 'Hi this is a new context with different settings! ' + voice_settings: + stability: 0.2 + similarity_boost: 0.9 + context_id: interruption_context + - type: publish + body: + context_id: conv_1 + close_context: true + - type: publish + body: + context_id: interruption_context + flush: true + - type: subscribe + body: + audio: Y3VyaW91cyBtaW5kcyB0aGluayBhbGlrZSA6KQ== + - type: subscribe + body: + isFinal: true + contextId: interruption_context + - type: publish + body: + text: '' + context_id: interruption_context + - type: publish + body: + close_socket: true + docs: Demonstrates initializing two contexts, sending text, and managing them. + query-parameters: + seed: 12345 +imports: + root: __package__.yml diff --git a/.mock/definition/v1TextToSpeechVoiceIdStreamInput.yml b/.mock/definition/v1TextToSpeechVoiceIdStreamInput.yml index b6886746..1ca43b2d 100644 --- a/.mock/definition/v1TextToSpeechVoiceIdStreamInput.yml +++ b/.mock/definition/v1TextToSpeechVoiceIdStreamInput.yml @@ -1,75 +1,3 @@ -types: - TextToSpeechOptimizeStreamingLatency: - enum: - - value: '0' - name: Zero - - value: '1' - name: One - - value: '2' - name: Two - - value: '3' - name: Three - - value: '4' - name: Four - docs: Latency optimization level (deprecated) - default: '0' - source: - openapi: asyncapi.yml - TextToSpeechOutputFormat: - enum: - - mp3_22050_32 - - mp3_44100_32 - - mp3_44100_64 - - mp3_44100_96 - - mp3_44100_128 - - mp3_44100_192 - - pcm_8000 - - pcm_16000 - - pcm_22050 - - pcm_24000 - - pcm_44100 - - ulaw_8000 - - alaw_8000 - - opus_48000_32 - - opus_48000_64 - - opus_48000_96 - - opus_48000_128 - - opus_48000_192 - docs: The output audio format - source: - openapi: asyncapi.yml - TextToSpeechApplyTextNormalization: - enum: - - auto - - 'on' - - 'off' - docs: >- - This parameter controls text normalization with three modes - 'auto', - 'on', and 'off'. When set to 'auto', the system will automatically decide - whether to apply text normalization (e.g., spelling out numbers). With - 'on', text normalization will always be applied, while with 'off', it will - be skipped. Cannot be turned on for 'eleven_turbo_v2_5' or - 'eleven_flash_v2_5' models. Defaults to 'auto'. - default: auto - source: - openapi: asyncapi.yml - sendMessage: - discriminated: false - docs: Send messages to the WebSocket - union: - - root.InitializeConnection - - root.SendText - - root.CloseConnection - source: - openapi: asyncapi.yml - receiveMessage: - discriminated: false - docs: Receive messages from the WebSocket - union: - - root.AudioOutput - - root.FinalOutput - source: - openapi: asyncapi.yml channel: path: /v1/text-to-speech/{voice_id}/stream-input url: WSS @@ -96,63 +24,6 @@ channel: voice_id: type: string docs: The unique identifier for the voice to use in the TTS process. - query-parameters: - model_id: - type: optional - docs: The model ID to use - language_code: - type: optional - docs: The ISO 639-1 language code (for Turbo v2.5 and Flash v2.5 models only) - enable_logging: - type: optional - docs: Whether to enable logging of the request - enable_ssml_parsing: - type: optional - default: false - docs: Whether to enable SSML parsing - optimize_streaming_latency: - type: optional - default: '0' - docs: Latency optimization level (deprecated) - availability: deprecated - output_format: - type: optional - docs: The output audio format - inactivity_timeout: - type: optional - default: 20 - docs: Timeout for inactivity before connection is closed - sync_alignment: - type: optional - default: false - docs: Whether to include timing data with every audio chunk - auto_mode: - type: optional - default: false - docs: >- - This parameter focuses on reducing the latency by disabling the chunk - schedule and all buffers. It is only recommended when sending full - sentences or phrases, sending partial phrases will result in highly - reduced quality. By default it's set to false. - apply_text_normalization: - type: optional - default: auto - docs: >- - This parameter controls text normalization with three modes - 'auto', - 'on', and 'off'. When set to 'auto', the system will automatically - decide whether to apply text normalization (e.g., spelling out numbers). - With 'on', text normalization will always be applied, while with 'off', - it will be skipped. Cannot be turned on for 'eleven_turbo_v2_5' or - 'eleven_flash_v2_5' models. Defaults to 'auto'. - seed: - type: optional - docs: >- - If specified, our system will make a best effort to sample - deterministically, such that repeated requests with the same seed and - parameters should return the same result. Determinism is not guaranteed. - Must be an integer between 0 and 4294967295. - validation: - min: 0 messages: publish: origin: client @@ -184,7 +55,7 @@ channel: body: audio: Y3VyaW91cyBtaW5kcyB0aGluayBhbGlrZSA6KQ== normalizedAlignment: - char_start_times_ms: + charStartTimesMs: - 0 - 3 - 7 @@ -196,7 +67,7 @@ channel: - 17 - 19 - 21 - chars_durations_ms: + charsDurationsMs: - 3 - 4 - 2 @@ -221,7 +92,7 @@ channel: - l - d alignment: - char_start_times_ms: + charStartTimesMs: - 0 - 3 - 7 @@ -233,7 +104,7 @@ channel: - 17 - 19 - 21 - chars_durations_ms: + charsDurationsMs: - 3 - 4 - 2 @@ -257,7 +128,23 @@ channel: - r - l - d - query-parameters: - seed: 12345 imports: root: __package__.yml +types: + sendMessage: + discriminated: false + docs: Send messages to the WebSocket + union: + - root.InitializeConnection + - root.SendText + - root.CloseConnection + source: + openapi: asyncapi.yml + receiveMessage: + discriminated: false + docs: Receive messages from the WebSocket + union: + - root.AudioOutput + - root.FinalOutput + source: + openapi: asyncapi.yml diff --git a/.mock/definition/voices.yml b/.mock/definition/voices.yml index 166ea8d5..410e7844 100644 --- a/.mock/definition/voices.yml +++ b/.mock/definition/voices.yml @@ -885,6 +885,9 @@ service: docs: >- Filter voices with a minimum notice period of the given number of days. + include_custom_rates: + type: optional + docs: Include/exclude voices with custom rates reader_app_enabled: type: optional default: false @@ -1029,34 +1032,6 @@ service: is_added_by_user: true has_more: false last_sort_id: last_sort_id - get_a_profile_page: - path: /profile/{handle} - method: GET - auth: false - docs: Gets a profile page based on a handle - source: - openapi: openapi.json - path-parameters: - handle: - type: string - docs: Handle for a VA's profile page - display-name: Get a profile page - response: - docs: Successful Response - type: root.ProfilePageResponseModel - status-code: 200 - errors: - - root.UnprocessableEntityError - examples: - - path-parameters: - handle: talexgeorge - response: - body: - handle: handle - public_user_id: public_user_id - name: name - bio: bio - profile_picture: profile_picture source: openapi: openapi.json display-name: Voices diff --git a/.mock/fern.config.json b/.mock/fern.config.json index 26c08edf..1fdb3034 100644 --- a/.mock/fern.config.json +++ b/.mock/fern.config.json @@ -1,4 +1,4 @@ { "organization" : "elevenlabs", - "version" : "0.59.3" + "version" : "0.60.28" } \ No newline at end of file diff --git a/.mock/openapi.json b/.mock/openapi.json index 680ec40e..f33c42a9 100644 --- a/.mock/openapi.json +++ b/.mock/openapi.json @@ -6241,7 +6241,8 @@ "dubbing", "dubbing", "resource", - "segment" + "segment", + "enterprise" ], "x-fern-sdk-group-name": "dubbing", "x-fern-sdk-method-name": "get_dubbing_resource" @@ -6319,7 +6320,8 @@ "dubbing", "dubbing", "resource", - "segment" + "segment", + "enterprise" ], "x-fern-sdk-group-name": "dubbing", "x-fern-sdk-method-name": "add_language_to_resource" @@ -6409,10 +6411,15 @@ "dubbing", "dubbing", "resource", + "segment", + "enterprise" + ], + "x-fern-sdk-group-name": [ + "dubbing", + "speaker", "segment" ], - "x-fern-sdk-group-name": "dubbing", - "x-fern-sdk-method-name": "create_segment_for_speaker" + "x-fern-sdk-method-name": "create" } }, "/v1/dubbing/resource/{dubbing_id}/segment/{segment_id}/{language}": { @@ -6510,7 +6517,8 @@ "dubbing", "dubbing", "resource", - "segment" + "segment", + "enterprise" ], "x-fern-sdk-group-name": "dubbing", "x-fern-sdk-method-name": "update_segment_language" @@ -6589,7 +6597,8 @@ "dubbing", "dubbing", "resource", - "segment" + "segment", + "enterprise" ], "x-fern-sdk-group-name": "dubbing", "x-fern-sdk-method-name": "delete_segment" @@ -6667,7 +6676,8 @@ "dubbing", "dubbing", "resource", - "segment" + "segment", + "enterprise" ], "x-fern-sdk-group-name": "dubbing", "x-fern-sdk-method-name": "transcribe_segments" @@ -6745,7 +6755,8 @@ "dubbing", "dubbing", "resource", - "segment" + "segment", + "enterprise" ], "x-fern-sdk-group-name": "dubbing", "x-fern-sdk-method-name": "translate_segments" @@ -6823,12 +6834,188 @@ "dubbing", "dubbing", "resource", - "segment" + "segment", + "enterprise" ], "x-fern-sdk-group-name": "dubbing", "x-fern-sdk-method-name": "dub_segments" } }, + "/v1/dubbing/resource/{dubbing_id}/speaker/{speaker_id}": { + "patch": { + "operationId": "Update_metadata_for_a_speaker_v1_dubbing_resource__dubbing_id__speaker__speaker_id__patch", + "summary": "Update Metadata For A Speaker", + "description": "Amend the metadata associated with a speaker, such as their voice. Both voice cloning and using voices from the ElevenLabs library are supported.", + "parameters": [ + { + "name": "dubbing_id", + "in": "path", + "description": "ID of the dubbing project.", + "required": true, + "schema": { + "description": "ID of the dubbing project.", + "type": "string", + "title": "Dubbing Id" + } + }, + { + "name": "speaker_id", + "in": "path", + "description": "ID of the speaker.", + "required": true, + "schema": { + "description": "ID of the speaker.", + "type": "string", + "title": "Speaker Id" + } + }, + { + "name": "xi-api-key", + "in": "header", + "description": "Your API key. This is required by most endpoints to access our API programatically. You can view your xi-api-key using the 'Profile' tab on the website.", + "required": false, + "schema": { + "description": "Your API key. This is required by most endpoints to access our API programatically. You can view your xi-api-key using the 'Profile' tab on the website.", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Xi-Api-Key" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body_Update_metadata_for_a_speaker_v1_dubbing_resource__dubbing_id__speaker__speaker_id__patch" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SpeakerUpdatedResponse" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + }, + "tags": [ + "dubbing", + "dubbing", + "resource", + "segment", + "enterprise" + ], + "x-fern-sdk-group-name": [ + "dubbing", + "speaker" + ], + "x-fern-sdk-method-name": "update" + } + }, + "/v1/dubbing/resource/{dubbing_id}/speaker/{speaker_id}/similar-voices": { + "get": { + "operationId": "Search_the_ElevenLabs_library_for_voices_similar_to_a_speaker__v1_dubbing_resource__dubbing_id__speaker__speaker_id__similar_voices_get", + "summary": "Search The Elevenlabs Library For Voices Similar To A Speaker.", + "description": "Fetch the top 10 similar voices to a speaker, including the voice IDs, names, descriptions, and, where possible, a sample audio recording.", + "parameters": [ + { + "name": "dubbing_id", + "in": "path", + "description": "ID of the dubbing project.", + "required": true, + "schema": { + "description": "ID of the dubbing project.", + "type": "string", + "title": "Dubbing Id" + } + }, + { + "name": "speaker_id", + "in": "path", + "description": "ID of the speaker.", + "required": true, + "schema": { + "description": "ID of the speaker.", + "type": "string", + "title": "Speaker Id" + } + }, + { + "name": "xi-api-key", + "in": "header", + "description": "Your API key. This is required by most endpoints to access our API programatically. You can view your xi-api-key using the 'Profile' tab on the website.", + "required": false, + "schema": { + "description": "Your API key. This is required by most endpoints to access our API programatically. You can view your xi-api-key using the 'Profile' tab on the website.", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Xi-Api-Key" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SimilarVoicesForSpeakerResponse" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + }, + "tags": [ + "dubbing", + "dubbing", + "resource", + "segment", + "enterprise" + ], + "x-fern-sdk-group-name": [ + "dubbing", + "speaker" + ], + "x-fern-sdk-method-name": "similar_voices" + } + }, "/v1/dubbing/resource/{dubbing_id}/render/{language}": { "post": { "operationId": "Render_audio_or_video_for_the_given_language_v1_dubbing_resource__dubbing_id__render__language__post", @@ -6912,7 +7099,8 @@ "dubbing", "dubbing", "resource", - "segment" + "segment", + "enterprise" ], "x-fern-sdk-group-name": "dubbing", "x-fern-sdk-method-name": "render_dub" @@ -7883,6 +8071,27 @@ "title": "Min Notice Period Days" } }, + { + "name": "include_custom_rates", + "in": "query", + "description": "Include/exclude voices with custom rates", + "required": false, + "schema": { + "description": "Include/exclude voices with custom rates", + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "examples": [ + true + ], + "title": "Include Custom Rates" + } + }, { "name": "reader_app_enabled", "in": "query", @@ -8063,9 +8272,9 @@ }, "/v1/usage/character-stats": { "get": { - "operationId": "Get_character_usage_metrics_v1_usage_character_stats_get", - "summary": "Get Character Usage Metrics", - "description": "Returns the credit usage metrics for the current user or the entire workspace they are part of. The response will return a time axis with unix timestamps for each day and daily usage along that axis. The usage will be broken down by the specified breakdown type. For example, breakdown type \"voice\" will return the usage of each voice along the time axis.", + "operationId": "Get_characters_usage_metrics_v1_usage_character_stats_get", + "summary": "Get Characters Usage Metrics", + "description": "Returns the usage metrics for the current user or the entire workspace they are part of. The response provides a time axis based on the specified aggregation interval (default: day), with usage values for each interval along that axis. Usage is broken down by the selected breakdown type. For example, breakdown type \"voice\" will return the usage of each voice for each interval along the time axis.", "parameters": [ { "name": "start_unix", @@ -9460,56 +9669,6 @@ ] } }, - "/profile/{handle}": { - "get": { - "operationId": "Get_a_profile_page_profile__handle__get", - "summary": "Get A Profile Page", - "description": "Gets a profile page based on a handle", - "parameters": [ - { - "name": "handle", - "in": "path", - "description": "Handle for a VA's profile page", - "required": true, - "schema": { - "description": "Handle for a VA's profile page", - "type": "string", - "examples": [ - "talexgeorge" - ], - "title": "Handle" - } - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProfilePageResponseModel" - } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - }, - "tags": [ - "voices" - ], - "x-fern-sdk-group-name": "profile", - "x-fern-sdk-method-name": "get" - } - }, "/v1/speech-to-text": { "post": { "operationId": "Speech_to_Text_v1_speech_to_text_post", @@ -9650,7 +9809,7 @@ "x-fern-sdk-method-name": "create" } }, - "/v1/convai/conversation/get_signed_url": { + "/v1/convai/conversation/get-signed-url": { "get": { "operationId": "Get_Signed_Url_v1_convai_conversation_get_signed_url_get", "summary": "Get Signed Url", @@ -9718,12 +9877,26 @@ "x-fern-sdk-method-name": "get_signed_url" } }, - "/v1/convai/twilio/outbound_call": { - "post": { - "operationId": "Handle_an_outbound_call_via_Twilio_v1_convai_twilio_outbound_call_post", - "summary": "Handle An Outbound Call Via Twilio", - "description": "Handle an outbound call via Twilio", + "/v1/convai/conversation/get_signed_url": { + "get": { + "operationId": "get_signed_url_deprecated", + "summary": "Get Signed Url", + "description": "Get a signed url to start a conversation with an agent with an agent that requires authorization", "parameters": [ + { + "name": "agent_id", + "in": "query", + "description": "The id of the agent you're taking the action on.", + "required": true, + "schema": { + "description": "The id of the agent you're taking the action on.", + "type": "string", + "examples": [ + "21m00Tcm4TlvDq8ikWAM" + ], + "title": "Agent Id" + } + }, { "name": "xi-api-key", "in": "header", @@ -9743,13 +9916,67 @@ } } ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Body_Handle_an_outbound_call_via_Twilio_v1_convai_twilio_outbound_call_post" - } + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConversationSignedUrlResponseModel" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + }, + "deprecated": true, + "tags": [ + "Conversational AI" + ], + "x-skip-spec": true + } + }, + "/v1/convai/twilio/outbound-call": { + "post": { + "operationId": "Handle_an_outbound_call_via_Twilio_v1_convai_twilio_outbound_call_post", + "summary": "Handle An Outbound Call Via Twilio", + "description": "Handle an outbound call via Twilio", + "parameters": [ + { + "name": "xi-api-key", + "in": "header", + "description": "Your API key. This is required by most endpoints to access our API programatically. You can view your xi-api-key using the 'Profile' tab on the website.", + "required": false, + "schema": { + "description": "Your API key. This is required by most endpoints to access our API programatically. You can view your xi-api-key using the 'Profile' tab on the website.", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Xi-Api-Key" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body_Handle_an_outbound_call_via_Twilio_v1_convai_twilio_outbound_call_post" + } } } }, @@ -10078,10 +10305,10 @@ { "name": "conversation_signature", "in": "query", - "description": "An expiring token that enables a conversation to start. These can be generated for an agent using the /v1/convai/conversation/get_signed_url endpoint", + "description": "An expiring token that enables a websocket conversation to start. These can be generated for an agent using the /v1/convai/conversation/get-signed-url endpoint", "required": false, "schema": { - "description": "An expiring token that enables a conversation to start. These can be generated for an agent using the /v1/convai/conversation/get_signed_url endpoint", + "description": "An expiring token that enables a websocket conversation to start. These can be generated for an agent using the /v1/convai/conversation/get-signed-url endpoint", "anyOf": [ { "type": "string" @@ -10393,6 +10620,163 @@ "x-fern-sdk-method-name": "get_agents" } }, + "/v1/convai/agents/{agent_id}/simulate-conversation": { + "post": { + "operationId": "Simulates_a_conversation_v1_convai_agents__agent_id__simulate_conversation_post", + "summary": "Simulates A Conversation", + "description": "Run a conversation between the agent and a simulated user.", + "parameters": [ + { + "name": "agent_id", + "in": "path", + "description": "The id of an agent. This is returned on agent creation.", + "required": true, + "schema": { + "description": "The id of an agent. This is returned on agent creation.", + "type": "string", + "embed": true, + "examples": [ + "21m00Tcm4TlvDq8ikWAM" + ], + "title": "Agent Id" + } + }, + { + "name": "xi-api-key", + "in": "header", + "description": "Your API key. This is required by most endpoints to access our API programatically. You can view your xi-api-key using the 'Profile' tab on the website.", + "required": false, + "schema": { + "description": "Your API key. This is required by most endpoints to access our API programatically. You can view your xi-api-key using the 'Profile' tab on the website.", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Xi-Api-Key" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body_Simulates_a_conversation_v1_convai_agents__agent_id__simulate_conversation_post" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AgentSimulatedChatTestResponseModel" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + }, + "tags": [ + "Conversational AI" + ], + "x-fern-sdk-group-name": [ + "conversational_ai", + "agents" + ], + "x-fern-sdk-method-name": "simulate_conversation" + } + }, + "/v1/convai/agents/{agent_id}/simulate-conversation/stream": { + "post": { + "operationId": "Simulates_a_conversation__Stream__v1_convai_agents__agent_id__simulate_conversation_stream_post", + "summary": "Simulates A Conversation (Stream)", + "description": "Run a conversation between the agent and a simulated user and stream back the response. Response is streamed back as partial lists of messages that should be concatenated and once the conversation has complete a single final message with the conversation analysis will be sent.", + "parameters": [ + { + "name": "agent_id", + "in": "path", + "description": "The id of an agent. This is returned on agent creation.", + "required": true, + "schema": { + "description": "The id of an agent. This is returned on agent creation.", + "type": "string", + "embed": true, + "examples": [ + "21m00Tcm4TlvDq8ikWAM" + ], + "title": "Agent Id" + } + }, + { + "name": "xi-api-key", + "in": "header", + "description": "Your API key. This is required by most endpoints to access our API programatically. You can view your xi-api-key using the 'Profile' tab on the website.", + "required": false, + "schema": { + "description": "Your API key. This is required by most endpoints to access our API programatically. You can view your xi-api-key using the 'Profile' tab on the website.", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Xi-Api-Key" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body_Simulates_a_conversation__Stream__v1_convai_agents__agent_id__simulate_conversation_stream_post" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + }, + "tags": [ + "Conversational AI" + ], + "x-fern-sdk-group-name": [ + "conversational_ai", + "agents" + ], + "x-fern-sdk-method-name": "simulate_conversation_stream" + } + }, "/v1/convai/conversations": { "get": { "operationId": "Get_Conversations_v1_convai_conversations_get", @@ -10935,7 +11319,22 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetPhoneNumberResponseModel" + "discriminator": { + "propertyName": "provider", + "mapping": { + "twilio": "#/components/schemas/GetPhoneNumberTwilioResponseModel", + "sip_trunk": "#/components/schemas/GetPhoneNumberSIPTrunkResponseModel" + } + }, + "oneOf": [ + { + "$ref": "#/components/schemas/GetPhoneNumberTwilioResponseModel" + }, + { + "$ref": "#/components/schemas/GetPhoneNumberSIPTrunkResponseModel" + } + ], + "title": "Response Get Phone Number V1 Convai Phone Numbers Phone Number Id Get" } } } @@ -11078,7 +11477,22 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetPhoneNumberResponseModel" + "discriminator": { + "propertyName": "provider", + "mapping": { + "twilio": "#/components/schemas/GetPhoneNumberTwilioResponseModel", + "sip_trunk": "#/components/schemas/GetPhoneNumberSIPTrunkResponseModel" + } + }, + "oneOf": [ + { + "$ref": "#/components/schemas/GetPhoneNumberTwilioResponseModel" + }, + { + "$ref": "#/components/schemas/GetPhoneNumberSIPTrunkResponseModel" + } + ], + "title": "Response Update Phone Number V1 Convai Phone Numbers Phone Number Id Patch" } } } @@ -11134,7 +11548,21 @@ "schema": { "type": "array", "items": { - "$ref": "#/components/schemas/GetPhoneNumberResponseModel" + "oneOf": [ + { + "$ref": "#/components/schemas/GetPhoneNumberTwilioResponseModel" + }, + { + "$ref": "#/components/schemas/GetPhoneNumberSIPTrunkResponseModel" + } + ], + "discriminator": { + "propertyName": "provider", + "mapping": { + "twilio": "#/components/schemas/GetPhoneNumberTwilioResponseModel", + "sip_trunk": "#/components/schemas/GetPhoneNumberSIPTrunkResponseModel" + } + } }, "title": "Response List Phone Numbers V1 Convai Phone Numbers Get" } @@ -11688,11 +12116,11 @@ "x-fern-sdk-method-name": "create_knowledge_base_text_document" } }, - "/v1/convai/knowledge-base/{documentation_id}/rag-index": { - "post": { - "operationId": "Compute_RAG_index__v1_convai_knowledge_base__documentation_id__rag_index_post", - "summary": "Compute Rag Index.", - "description": "In case the document is not RAG indexed, it triggers rag indexing task, otherwise it just returns the current status.", + "/v1/convai/knowledge-base/{documentation_id}": { + "patch": { + "operationId": "Update_document_v1_convai_knowledge_base__documentation_id__patch", + "summary": "Update Document", + "description": "Update the name of a document", "parameters": [ { "name": "documentation_id", @@ -11733,8 +12161,7 @@ "content": { "application/json": { "schema": { - "description": "Payload for RAG index status endpoint.", - "$ref": "#/components/schemas/RAGIndexRequestModel" + "$ref": "#/components/schemas/Body_Update_document_v1_convai_knowledge_base__documentation_id__patch" } } } @@ -11745,7 +12172,26 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RAGIndexResponseModel" + "discriminator": { + "propertyName": "type", + "mapping": { + "url": "#/components/schemas/GetKnowledgeBaseURLResponseModel", + "file": "#/components/schemas/GetKnowledgeBaseFileResponseModel", + "text": "#/components/schemas/GetKnowledgeBaseTextResponseModel" + } + }, + "oneOf": [ + { + "$ref": "#/components/schemas/GetKnowledgeBaseURLResponseModel" + }, + { + "$ref": "#/components/schemas/GetKnowledgeBaseFileResponseModel" + }, + { + "$ref": "#/components/schemas/GetKnowledgeBaseTextResponseModel" + } + ], + "title": "Response Update Document V1 Convai Knowledge Base Documentation Id Patch" } } } @@ -11765,10 +12211,8 @@ "Conversational AI" ], "x-fern-sdk-group-name": "conversational_ai", - "x-fern-sdk-method-name": "rag_index_status" - } - }, - "/v1/convai/knowledge-base/{documentation_id}": { + "x-fern-sdk-method-name": "update_knowledge_base_document" + }, "get": { "operationId": "Get_documentation_from_knowledge_base_v1_convai_knowledge_base__documentation_id__get", "summary": "Get Documentation From Knowledge Base", @@ -11921,9 +12365,93 @@ "x-fern-sdk-method-name": "delete_knowledge_base_document" } }, - "/v1/convai/agents/{agent_id}/knowledge-base/{documentation_id}": { - "get": { - "operationId": "Get_documentation_from_knowledge_base_v1_convai_agents__agent_id__knowledge_base__documentation_id__get", + "/v1/convai/knowledge-base/{documentation_id}/rag-index": { + "post": { + "operationId": "Compute_RAG_index__v1_convai_knowledge_base__documentation_id__rag_index_post", + "summary": "Compute Rag Index.", + "description": "In case the document is not RAG indexed, it triggers rag indexing task, otherwise it just returns the current status.", + "parameters": [ + { + "name": "documentation_id", + "in": "path", + "description": "The id of a document from the knowledge base. This is returned on document addition.", + "required": true, + "schema": { + "description": "The id of a document from the knowledge base. This is returned on document addition.", + "type": "string", + "embed": true, + "examples": [ + "21m00Tcm4TlvDq8ikWAM" + ], + "title": "Documentation Id" + } + }, + { + "name": "xi-api-key", + "in": "header", + "description": "Your API key. This is required by most endpoints to access our API programatically. You can view your xi-api-key using the 'Profile' tab on the website.", + "required": false, + "schema": { + "description": "Your API key. This is required by most endpoints to access our API programatically. You can view your xi-api-key using the 'Profile' tab on the website.", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Xi-Api-Key" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "description": "Payload for RAG index status endpoint.", + "$ref": "#/components/schemas/RAGIndexRequestModel" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RAGIndexResponseModel" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + }, + "tags": [ + "Conversational AI" + ], + "x-fern-sdk-group-name": [ + "conversational_ai", + "knowledge_base", + "document" + ], + "x-fern-sdk-method-name": "compute_rag_index" + } + }, + "/v1/convai/agents/{agent_id}/knowledge-base/{documentation_id}": { + "get": { + "operationId": "Get_documentation_from_knowledge_base_v1_convai_agents__agent_id__knowledge_base__documentation_id__get", "summary": "Get Documentation From Knowledge Base", "description": "Get details about a specific documentation making up the agent's knowledge base", "parameters": [ @@ -12664,6 +13192,136 @@ "x-fern-sdk-method-name": "delete_secret" } }, + "/v1/convai/batch-calling/{batch_id}": { + "get": { + "operationId": "Get_a_batch_call_by_ID__v1_convai_batch_calling__batch_id__get", + "summary": "Get A Batch Call By Id.", + "description": "Get detailed information about a batch call including all recipients.", + "parameters": [ + { + "name": "batch_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Batch Id" + } + }, + { + "name": "xi-api-key", + "in": "header", + "description": "Your API key. This is required by most endpoints to access our API programatically. You can view your xi-api-key using the 'Profile' tab on the website.", + "required": false, + "schema": { + "description": "Your API key. This is required by most endpoints to access our API programatically. You can view your xi-api-key using the 'Profile' tab on the website.", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Xi-Api-Key" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BatchCallDetailedResponse" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + }, + "tags": [ + "Conversational AI" + ], + "x-fern-sdk-group-name": "conversational_ai", + "x-fern-sdk-method-name": "get_batch_call" + } + }, + "/v1/convai/sip-trunk/outbound-call": { + "post": { + "operationId": "Handle_an_outbound_call_via_SIP_trunk_v1_convai_sip_trunk_outbound_call_post", + "summary": "Handle An Outbound Call Via Sip Trunk", + "description": "Handle an outbound call via SIP trunk", + "parameters": [ + { + "name": "xi-api-key", + "in": "header", + "description": "Your API key. This is required by most endpoints to access our API programatically. You can view your xi-api-key using the 'Profile' tab on the website.", + "required": false, + "schema": { + "description": "Your API key. This is required by most endpoints to access our API programatically. You can view your xi-api-key using the 'Profile' tab on the website.", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Xi-Api-Key" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body_Handle_an_outbound_call_via_SIP_trunk_v1_convai_sip_trunk_outbound_call_post" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SIPTrunkOutboundCallResponse" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + }, + "tags": [ + "Conversational AI" + ], + "x-fern-sdk-group-name": [ + "conversational_ai", + "sip_trunk" + ], + "x-fern-sdk-method-name": "outbound_call" + } + }, "/v1/voices/pvc": { "post": { "operationId": "Create_PVC_voice_v1_voices_pvc_post", @@ -14288,6 +14946,35 @@ }, "title": "AgentConfigAPIModel" }, + "AgentConfigDBModel": { + "type": "object", + "properties": { + "first_message": { + "description": "If non-empty, the first message the agent will say. If empty, the agent waits for the user to start the discussion.", + "type": "string", + "default": "", + "title": "First Message" + }, + "language": { + "description": "Language of the agent - used for ASR and TTS", + "type": "string", + "default": "en", + "title": "Language" + }, + "dynamic_variables": { + "description": "Configuration for dynamic variables", + "$ref": "#/components/schemas/DynamicVariablesConfig" + }, + "prompt": { + "$ref": "#/components/schemas/PromptAgentDBModel" + } + }, + "example": { + "first_message": "Hello, how can I help you today?", + "language": "en" + }, + "title": "AgentConfigDBModel" + }, "AgentConfigOverride": { "type": "object", "properties": { @@ -14463,6 +15150,26 @@ }, "title": "AgentPlatformSettingsResponseModel" }, + "AgentSimulatedChatTestResponseModel": { + "type": "object", + "properties": { + "simulated_conversation": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ConversationHistoryTranscriptCommonModel-Output" + }, + "title": "Simulated Conversation" + }, + "analysis": { + "$ref": "#/components/schemas/ConversationHistoryAnalysisCommonModel" + } + }, + "required": [ + "simulated_conversation", + "analysis" + ], + "title": "AgentSimulatedChatTestResponseModel" + }, "AgentSummaryResponseModel": { "type": "object", "properties": { @@ -14476,13 +15183,13 @@ "type": "string", "title": "Name" }, - "categories": { - "description": "The categories of the agent", + "tags": { + "description": "Agent tags used to categorize the agent", "type": "array", "items": { "type": "string" }, - "title": "Categories" + "title": "Tags" }, "created_at_unix_secs": { "description": "The creation time of the agent in unix seconds", @@ -14496,18 +15203,18 @@ }, "example": { "agent_id": "J3Pbu5gP6NNKBscdCdwB", - "categories": [ + "created_at_unix_secs": 1716153600, + "name": "My Agent", + "tags": [ "Customer Support", "Technical Help", "Eleven" - ], - "created_at_unix_secs": 1716153600, - "name": "My Agent" + ] }, "required": [ "agent_id", "name", - "categories", + "tags", "created_at_unix_secs", "access_info" ], @@ -14594,6 +15301,11 @@ "const": "array", "title": "Type" }, + "description": { + "type": "string", + "default": "", + "title": "Description" + }, "items": { "oneOf": [ { @@ -14607,11 +15319,6 @@ } ], "title": "Items" - }, - "description": { - "type": "string", - "default": "", - "title": "Description" } }, "additionalProperties": false, @@ -14629,6 +15336,11 @@ "const": "array", "title": "Type" }, + "description": { + "type": "string", + "default": "", + "title": "Description" + }, "items": { "oneOf": [ { @@ -14642,11 +15354,6 @@ } ], "title": "Items" - }, - "description": { - "type": "string", - "default": "", - "title": "Description" } }, "additionalProperties": false, @@ -14953,7 +15660,9 @@ "public", "authorization_header", "signed_url", - "shareable_link" + "shareable_link", + "livekit_token", + "livekit_token_website" ], "title": "AuthorizationMethod" }, @@ -14965,6 +15674,99 @@ ], "title": "BanReasonType" }, + "BatchCallDetailedResponse": { + "description": "Detailed response model for a batch call including all recipients.", + "type": "object", + "properties": { + "id": { + "type": "string", + "title": "Id" + }, + "phone_number_id": { + "type": "string", + "title": "Phone Number Id" + }, + "name": { + "type": "string", + "title": "Name" + }, + "agent_id": { + "type": "string", + "title": "Agent Id" + }, + "created_at_unix": { + "type": "integer", + "title": "Created At Unix" + }, + "scheduled_time_unix": { + "type": "integer", + "title": "Scheduled Time Unix" + }, + "total_calls_dispatched": { + "type": "integer", + "title": "Total Calls Dispatched" + }, + "total_calls_scheduled": { + "type": "integer", + "title": "Total Calls Scheduled" + }, + "last_updated_at_unix": { + "type": "integer", + "title": "Last Updated At Unix" + }, + "status": { + "$ref": "#/components/schemas/BatchCallStatus" + }, + "agent_name": { + "type": "string", + "title": "Agent Name" + }, + "recipients": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OutboundCallRecipientResponseModel" + }, + "title": "Recipients" + } + }, + "required": [ + "id", + "phone_number_id", + "name", + "agent_id", + "created_at_unix", + "scheduled_time_unix", + "total_calls_dispatched", + "total_calls_scheduled", + "last_updated_at_unix", + "status", + "agent_name", + "recipients" + ], + "title": "BatchCallDetailedResponse" + }, + "BatchCallRecipientStatus": { + "type": "string", + "enum": [ + "pending", + "in_progress", + "completed", + "failed", + "cancelled" + ], + "title": "BatchCallRecipientStatus" + }, + "BatchCallStatus": { + "type": "string", + "enum": [ + "pending", + "in_progress", + "completed", + "failed", + "cancelled" + ], + "title": "BatchCallStatus" + }, "Body_Add_a_language_to_the_resource_v1_dubbing_resource__dubbing_id__language_post": { "type": "object", "properties": { @@ -15611,7 +16413,8 @@ "description": "A custom, human-readable name for the document.", "anyOf": [ { - "type": "string" + "type": "string", + "minLength": 1 }, { "type": "null" @@ -15640,7 +16443,8 @@ "description": "A custom, human-readable name for the document.", "anyOf": [ { - "type": "string" + "type": "string", + "minLength": 1 }, { "type": "null" @@ -15669,7 +16473,8 @@ "description": "A custom, human-readable name for the document.", "anyOf": [ { - "type": "string" + "type": "string", + "minLength": 1 }, { "type": "null" @@ -15860,8 +16665,8 @@ "optional": true, "title": "Name" }, - "categories": { - "description": "Categories to help classify and filter the agent", + "tags": { + "description": "Tags to help classify and filter the agent", "anyOf": [ { "items": { @@ -15881,7 +16686,7 @@ ] ], "optional": true, - "title": "Categories" + "title": "Tags" } }, "required": [ @@ -16355,7 +17160,8 @@ "description": "A custom, human-readable name for the document.", "anyOf": [ { - "type": "string" + "type": "string", + "minLength": 1 }, { "type": "null" @@ -16558,7 +17364,8 @@ "description": "A custom, human-readable name for the document.", "anyOf": [ { - "type": "string" + "type": "string", + "minLength": 1 }, { "type": "null" @@ -16925,7 +17732,8 @@ "description": "A custom, human-readable name for the document.", "anyOf": [ { - "type": "string" + "type": "string", + "minLength": 1 }, { "type": "null" @@ -17047,7 +17855,7 @@ "title": "Model Id" }, "file": { - "description": "Either txt or HTML input file containing the article content. HTML should be formatted as follows '<html><body><div><p>Your content</p><h5>More of your content</h5><p>Some more of your content</p></div></body></html>'", + "description": "Either txt or HTML input file containing the article content. HTML should be formatted as follows '<html><body><div><p>Your content</p><h3>More of your content</h3><p>Some more of your content</p></div></body></html>'", "type": "string", "format": "binary", "title": "File" @@ -17735,6 +18543,39 @@ }, "title": "Body_Get_similar_library_voices_v1_similar_voices_post" }, + "Body_Handle_an_outbound_call_via_SIP_trunk_v1_convai_sip_trunk_outbound_call_post": { + "type": "object", + "properties": { + "agent_id": { + "type": "string", + "title": "Agent Id" + }, + "agent_phone_number_id": { + "type": "string", + "title": "Agent Phone Number Id" + }, + "to_number": { + "type": "string", + "title": "To Number" + }, + "conversation_initiation_client_data": { + "anyOf": [ + { + "$ref": "#/components/schemas/ConversationInitiationClientDataRequest-Input" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "agent_id", + "agent_phone_number_id", + "to_number" + ], + "title": "Body_Handle_an_outbound_call_via_SIP_trunk_v1_convai_sip_trunk_outbound_call_post" + }, "Body_Handle_an_outbound_call_via_Twilio_v1_convai_twilio_outbound_call_post": { "type": "object", "properties": { @@ -17923,8 +18764,8 @@ "optional": true, "title": "Name" }, - "categories": { - "description": "Categories to help classify and filter the agent", + "tags": { + "description": "Tags to help classify and filter the agent", "anyOf": [ { "items": { @@ -17944,7 +18785,7 @@ ] ], "optional": true, - "title": "Categories" + "title": "Tags" } }, "title": "Body_Patches_an_Agent_settings_v1_convai_agents__agent_id__patch" @@ -18139,6 +18980,62 @@ ], "title": "Body_Share_workspace_resource_v1_workspace_resources__resource_id__share_post" }, + "Body_Simulates_a_conversation__Stream__v1_convai_agents__agent_id__simulate_conversation_stream_post": { + "type": "object", + "properties": { + "simulation_specification": { + "description": "A specification detailing how the conversation should be simulated", + "$ref": "#/components/schemas/ConversationSimulationSpecification" + }, + "extra_evaluation_criteria": { + "description": "A list of evaluation criteria to test", + "anyOf": [ + { + "items": { + "$ref": "#/components/schemas/PromptEvaluationCriteria" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Extra Evaluation Criteria" + } + }, + "required": [ + "simulation_specification" + ], + "title": "Body_Simulates_a_conversation__Stream__v1_convai_agents__agent_id__simulate_conversation_stream_post" + }, + "Body_Simulates_a_conversation_v1_convai_agents__agent_id__simulate_conversation_post": { + "type": "object", + "properties": { + "simulation_specification": { + "description": "A specification detailing how the conversation should be simulated", + "$ref": "#/components/schemas/ConversationSimulationSpecification" + }, + "extra_evaluation_criteria": { + "description": "A list of evaluation criteria to test", + "anyOf": [ + { + "items": { + "$ref": "#/components/schemas/PromptEvaluationCriteria" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Extra Evaluation Criteria" + } + }, + "required": [ + "simulation_specification" + ], + "title": "Body_Simulates_a_conversation_v1_convai_agents__agent_id__simulate_conversation_post" + }, "Body_Sound_Generation_v1_sound_generation_post": { "type": "object", "properties": { @@ -18523,7 +19420,7 @@ "model_id": { "description": "Identifier of the model that will be used, you can query them using GET /v1/models. The model needs to have support for text to speech, you can check this using the can_do_text_to_speech property.", "type": "string", - "default": "eleven_monolingual_v1", + "default": "eleven_multilingual_v2", "title": "Model Id" }, "language_code": { @@ -18554,7 +19451,7 @@ "anyOf": [ { "items": { - "$ref": "#/components/schemas/PronunciationDictionaryVersionLocatorDBModel" + "$ref": "#/components/schemas/PronunciationDictionaryVersionLocatorRequestModel" }, "type": "array" }, @@ -18714,7 +19611,7 @@ "model_id": { "description": "Identifier of the model that will be used, you can query them using GET /v1/models. The model needs to have support for text to speech, you can check this using the can_do_text_to_speech property.", "type": "string", - "default": "eleven_monolingual_v1", + "default": "eleven_multilingual_v2", "title": "Model Id" }, "language_code": { @@ -18745,7 +19642,7 @@ "anyOf": [ { "items": { - "$ref": "#/components/schemas/PronunciationDictionaryVersionLocatorDBModel" + "$ref": "#/components/schemas/PronunciationDictionaryVersionLocatorRequestModel" }, "type": "array" }, @@ -18905,7 +19802,7 @@ "model_id": { "description": "Identifier of the model that will be used, you can query them using GET /v1/models. The model needs to have support for text to speech, you can check this using the can_do_text_to_speech property.", "type": "string", - "default": "eleven_monolingual_v1", + "default": "eleven_multilingual_v2", "title": "Model Id" }, "language_code": { @@ -18936,7 +19833,7 @@ "anyOf": [ { "items": { - "$ref": "#/components/schemas/PronunciationDictionaryVersionLocatorDBModel" + "$ref": "#/components/schemas/PronunciationDictionaryVersionLocatorRequestModel" }, "type": "array" }, @@ -19096,7 +19993,7 @@ "model_id": { "description": "Identifier of the model that will be used, you can query them using GET /v1/models. The model needs to have support for text to speech, you can check this using the can_do_text_to_speech property.", "type": "string", - "default": "eleven_monolingual_v1", + "default": "eleven_multilingual_v2", "title": "Model Id" }, "language_code": { @@ -19126,7 +20023,7 @@ "description": "A list of pronunciation dictionary locators (id, version_id) to be applied to the text. They will be applied in order. You may have up to 3 locators per request", "type": "array", "items": { - "$ref": "#/components/schemas/PronunciationDictionaryVersionLocatorDBModel" + "$ref": "#/components/schemas/PronunciationDictionaryVersionLocatorRequestModel" }, "examples": [ [ @@ -19630,6 +20527,21 @@ }, "title": "Body_Update_chapter_v1_studio_projects__project_id__chapters__chapter_id__post" }, + "Body_Update_document_v1_convai_knowledge_base__documentation_id__patch": { + "type": "object", + "properties": { + "name": { + "description": "A custom, human-readable name for the document.", + "type": "string", + "minLength": 1, + "title": "Name" + } + }, + "required": [ + "name" + ], + "title": "Body_Update_document_v1_convai_knowledge_base__documentation_id__patch" + }, "Body_Update_member_v1_workspace_members_post": { "type": "object", "properties": { @@ -19672,6 +20584,39 @@ ], "title": "Body_Update_member_v1_workspace_members_post" }, + "Body_Update_metadata_for_a_speaker_v1_dubbing_resource__dubbing_id__speaker__speaker_id__patch": { + "type": "object", + "properties": { + "voice_id": { + "description": "Either the identifier of a voice from the ElevenLabs voice library, or one of ['track-clone', 'clip-clone'].", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Voice Id" + }, + "languages": { + "description": "Languages to apply these changes to. If empty, will apply to all languages.", + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Languages" + } + }, + "title": "Body_Update_metadata_for_a_speaker_v1_dubbing_resource__dubbing_id__speaker__speaker_id__patch" + }, "Body_Verify_PVC_voice_captcha_v1_voices_pvc__voice_id__captcha_post": { "type": "object", "properties": { @@ -20310,13 +21255,6 @@ "default": "", "title": "Id" }, - "type": { - "description": "The type of tool", - "type": "string", - "default": "client", - "const": "client", - "title": "Type" - }, "name": { "type": "string", "minLength": 0, @@ -20328,6 +21266,21 @@ "minLength": 0, "title": "Description" }, + "response_timeout_secs": { + "description": "The maximum time in seconds to wait for the tool call to complete. Must be between 1 and 30 seconds (inclusive).", + "type": "integer", + "default": 20, + "maximum": 30, + "minimum": 1, + "title": "Response Timeout Secs" + }, + "type": { + "description": "The type of tool", + "type": "string", + "default": "client", + "const": "client", + "title": "Type" + }, "parameters": { "description": "Schema for any parameters to pass to the client", "anyOf": [ @@ -20345,20 +21298,6 @@ "default": false, "title": "Expects Response" }, - "response_timeout_secs": { - "description": "The maximum time in seconds to wait for a response from the client. Should only be set if expects_response is true", - "anyOf": [ - { - "type": "integer", - "maximum": 30, - "minimum": 1 - }, - { - "type": "null" - } - ], - "title": "Response Timeout Secs" - }, "dynamic_variables": { "description": "Configuration for dynamic variables", "$ref": "#/components/schemas/DynamicVariablesConfig" @@ -20383,13 +21322,6 @@ "default": "", "title": "Id" }, - "type": { - "description": "The type of tool", - "type": "string", - "default": "client", - "const": "client", - "title": "Type" - }, "name": { "type": "string", "minLength": 0, @@ -20401,6 +21333,21 @@ "minLength": 0, "title": "Description" }, + "response_timeout_secs": { + "description": "The maximum time in seconds to wait for the tool call to complete. Must be between 1 and 30 seconds (inclusive).", + "type": "integer", + "default": 20, + "maximum": 30, + "minimum": 1, + "title": "Response Timeout Secs" + }, + "type": { + "description": "The type of tool", + "type": "string", + "default": "client", + "const": "client", + "title": "Type" + }, "parameters": { "description": "Schema for any parameters to pass to the client", "anyOf": [ @@ -20418,20 +21365,6 @@ "default": false, "title": "Expects Response" }, - "response_timeout_secs": { - "description": "The maximum time in seconds to wait for a response from the client. Should only be set if expects_response is true", - "anyOf": [ - { - "type": "integer", - "maximum": 30, - "minimum": 1 - }, - { - "type": "null" - } - ], - "title": "Response Timeout Secs" - }, "dynamic_variables": { "description": "Configuration for dynamic variables", "$ref": "#/components/schemas/DynamicVariablesConfig" @@ -20811,16 +21744,34 @@ ], "title": "ConversationHistoryAnalysisCommonModel" }, - "ConversationHistoryErrorCommonModel": { + "ConversationHistoryBatchCallModel": { "type": "object", "properties": { - "code": { - "type": "integer", - "title": "Code" + "batch_call_id": { + "type": "string", + "title": "Batch Call Id" }, - "reason": { - "anyOf": [ - { + "batch_call_recipient_id": { + "type": "string", + "title": "Batch Call Recipient Id" + } + }, + "required": [ + "batch_call_id", + "batch_call_recipient_id" + ], + "title": "ConversationHistoryBatchCallModel" + }, + "ConversationHistoryErrorCommonModel": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "title": "Code" + }, + "reason": { + "anyOf": [ + { "type": "string" }, { @@ -20935,11 +21886,15 @@ "oneOf": [ { "$ref": "#/components/schemas/ConversationHistoryTwilioPhoneCallModel" + }, + { + "$ref": "#/components/schemas/ConversationHistorySIPTrunkingPhoneCallModel" } ], "discriminator": { "propertyName": "type", "mapping": { + "sip_trunking": "#/components/schemas/ConversationHistorySIPTrunkingPhoneCallModel", "twilio": "#/components/schemas/ConversationHistoryTwilioPhoneCallModel" } } @@ -20950,6 +21905,16 @@ ], "title": "Phone Call" }, + "batch_call": { + "anyOf": [ + { + "$ref": "#/components/schemas/ConversationHistoryBatchCallModel" + }, + { + "type": "null" + } + ] + }, "termination_reason": { "type": "string", "default": "", @@ -21011,7 +21976,50 @@ ], "title": "ConversationHistoryRagUsageCommonModel" }, - "ConversationHistoryTranscriptCommonModel": { + "ConversationHistorySIPTrunkingPhoneCallModel": { + "type": "object", + "properties": { + "direction": { + "type": "string", + "enum": [ + "inbound", + "outbound" + ], + "title": "Direction" + }, + "phone_number_id": { + "type": "string", + "title": "Phone Number Id" + }, + "agent_number": { + "type": "string", + "title": "Agent Number" + }, + "external_number": { + "type": "string", + "title": "External Number" + }, + "type": { + "type": "string", + "const": "sip_trunking", + "title": "Type" + }, + "call_sid": { + "type": "string", + "title": "Call Sid" + } + }, + "required": [ + "direction", + "phone_number_id", + "agent_number", + "external_number", + "type", + "call_sid" + ], + "title": "ConversationHistorySIPTrunkingPhoneCallModel" + }, + "ConversationHistoryTranscriptCommonModel-Input": { "type": "object", "properties": { "role": { @@ -21095,7 +22103,105 @@ "llm_usage": { "anyOf": [ { - "$ref": "#/components/schemas/LLMUsage" + "$ref": "#/components/schemas/LLMUsage-Input" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "role", + "time_in_call_secs" + ], + "title": "ConversationHistoryTranscriptCommonModel" + }, + "ConversationHistoryTranscriptCommonModel-Output": { + "type": "object", + "properties": { + "role": { + "type": "string", + "enum": [ + "user", + "agent" + ], + "title": "Role" + }, + "message": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Message" + }, + "tool_calls": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ConversationHistoryTranscriptToolCallCommonModel" + }, + "title": "Tool Calls" + }, + "tool_results": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ConversationHistoryTranscriptToolResultCommonModel" + }, + "title": "Tool Results" + }, + "feedback": { + "anyOf": [ + { + "$ref": "#/components/schemas/UserFeedback" + }, + { + "type": "null" + } + ] + }, + "llm_override": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Llm Override" + }, + "time_in_call_secs": { + "type": "integer", + "title": "Time In Call Secs" + }, + "conversation_turn_metrics": { + "anyOf": [ + { + "$ref": "#/components/schemas/ConversationTurnMetrics" + }, + { + "type": "null" + } + ] + }, + "rag_retrieval_info": { + "anyOf": [ + { + "$ref": "#/components/schemas/RagRetrievalInfo" + }, + { + "type": "null" + } + ] + }, + "llm_usage": { + "anyOf": [ + { + "$ref": "#/components/schemas/LLMUsage-Output" }, { "type": "null" @@ -21397,6 +22503,42 @@ }, "title": "ConversationInitiationClientDataConfig" }, + "ConversationInitiationClientDataInternal": { + "type": "object", + "properties": { + "conversation_config_override": { + "$ref": "#/components/schemas/ConversationConfigClientOverride-Output" + }, + "custom_llm_extra_body": { + "type": "object", + "title": "Custom Llm Extra Body" + }, + "dynamic_variables": { + "type": "object", + "additionalProperties": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "integer" + }, + { + "type": "boolean" + }, + { + "type": "null" + } + ] + }, + "title": "Dynamic Variables" + } + }, + "title": "ConversationInitiationClientDataInternal" + }, "ConversationInitiationClientDataRequest-Input": { "type": "object", "properties": { @@ -21518,6 +22660,34 @@ ], "title": "ConversationSignedUrlResponseModel" }, + "ConversationSimulationSpecification": { + "description": "A specification that will be used to simulate a conversation between an agent and an AI user.", + "type": "object", + "properties": { + "simulated_user_config": { + "$ref": "#/components/schemas/AgentConfigDBModel" + }, + "tool_mock_config": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/ToolMockConfig" + }, + "title": "Tool Mock Config" + }, + "partial_conversation_history": { + "description": "A partial conversation history to start the simulation from. If empty, simulation starts fresh.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ConversationHistoryTranscriptCommonModel-Input" + }, + "title": "Partial Conversation History" + } + }, + "required": [ + "simulated_user_config" + ], + "title": "ConversationSimulationSpecification" + }, "ConversationSummaryResponseModel": { "type": "object", "properties": { @@ -21800,20 +22970,52 @@ "type": "string", "title": "Phone Number" }, - "provider": { - "default": "sip_trunk", - "$ref": "#/components/schemas/TelephonyProvider" - }, "label": { "description": "Label for the phone number", "type": "string", "title": "Label" }, + "provider": { + "type": "string", + "default": "sip_trunk", + "const": "sip_trunk", + "title": "Provider" + }, "termination_uri": { "description": "SIP trunk termination URI", "type": "string", "title": "Termination Uri" }, + "address": { + "description": "Hostname or IP the SIP INVITE is sent to.", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Address" + }, + "transport": { + "description": "Protocol to use for SIP transport (signalling layer).", + "default": "auto", + "$ref": "#/components/schemas/SIPTrunkTransportEnum" + }, + "media_encryption": { + "description": "Whether or not to encrypt media (data layer).", + "default": "allowed", + "$ref": "#/components/schemas/SIPMediaEncryptionEnum" + }, + "headers": { + "description": "SIP X-* headers for INVITE request. These headers are sent as-is and may help identify this call.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "title": "Headers" + }, "credentials": { "description": "Optional digest authentication credentials (username/password). If not provided, ACL authentication is assumed.", "anyOf": [ @@ -21841,15 +23043,17 @@ "type": "string", "title": "Phone Number" }, - "provider": { - "default": "twilio", - "$ref": "#/components/schemas/TelephonyProvider" - }, "label": { "description": "Label for the phone number", "type": "string", "title": "Label" }, + "provider": { + "type": "string", + "default": "twilio", + "const": "twilio", + "title": "Provider" + }, "sid": { "description": "Twilio Account SID", "type": "string", @@ -21949,6 +23153,30 @@ ], "title": "DashboardCriteriaChartModel" }, + "DashboardDataCollectionChartModel": { + "type": "object", + "properties": { + "name": { + "type": "string", + "title": "Name" + }, + "type": { + "type": "string", + "default": "data_collection", + "const": "data_collection", + "title": "Type" + }, + "data_collection_id": { + "type": "string", + "title": "Data Collection Id" + } + }, + "required": [ + "name", + "data_collection_id" + ], + "title": "DashboardDataCollectionChartModel" + }, "DataCollectionResultCommonModel": { "type": "object", "properties": { @@ -22452,6 +23680,10 @@ ], "title": "Text" }, + "audio_stale": { + "type": "boolean", + "title": "Audio Stale" + }, "media_ref": { "anyOf": [ { @@ -22467,6 +23699,7 @@ "start_time", "end_time", "text", + "audio_stale", "media_ref" ], "title": "DubbedSegment" @@ -23490,7 +24723,21 @@ "description": "The phone numbers of the agent", "type": "array", "items": { - "$ref": "#/components/schemas/GetPhoneNumberResponseModel" + "oneOf": [ + { + "$ref": "#/components/schemas/GetPhoneNumberTwilioResponseModel" + }, + { + "$ref": "#/components/schemas/GetPhoneNumberSIPTrunkResponseModel" + } + ], + "discriminator": { + "propertyName": "provider", + "mapping": { + "sip_trunk": "#/components/schemas/GetPhoneNumberSIPTrunkResponseModel", + "twilio": "#/components/schemas/GetPhoneNumberTwilioResponseModel" + } + } }, "title": "Phone Numbers" }, @@ -23505,13 +24752,13 @@ } ] }, - "categories": { - "description": "The categories of the agent", + "tags": { + "description": "Agent tags used to categorize the agent", "type": "array", "items": { "type": "string" }, - "title": "Categories" + "title": "Tags" } }, "example": { @@ -23646,13 +24893,17 @@ }, { "$ref": "#/components/schemas/DashboardCriteriaChartModel" + }, + { + "$ref": "#/components/schemas/DashboardDataCollectionChartModel" } ], "discriminator": { "propertyName": "type", "mapping": { "call_success": "#/components/schemas/DashboardCallSuccessChartModel", - "criteria": "#/components/schemas/DashboardCriteriaChartModel" + "criteria": "#/components/schemas/DashboardCriteriaChartModel", + "data_collection": "#/components/schemas/DashboardDataCollectionChartModel" } } }, @@ -23677,6 +24928,13 @@ }, "webhooks": { "$ref": "#/components/schemas/ConvAIWebhooks" + }, + "rag_retention_period_days": { + "type": "integer", + "default": 10, + "exclusiveMinimum": 0, + "maximum": 30, + "title": "Rag Retention Period Days" } }, "title": "GetConvAISettingsResponseModel" @@ -23705,7 +24963,7 @@ "transcript": { "type": "array", "items": { - "$ref": "#/components/schemas/ConversationHistoryTranscriptCommonModel" + "$ref": "#/components/schemas/ConversationHistoryTranscriptCommonModel-Output" }, "title": "Transcript" }, @@ -24251,7 +25509,7 @@ ], "title": "GetLibraryVoicesResponseModel" }, - "GetPhoneNumberResponseModel": { + "GetPhoneNumberSIPTrunkResponseModel": { "type": "object", "properties": { "phone_number": { @@ -24259,9 +25517,62 @@ "type": "string", "title": "Phone Number" }, + "label": { + "description": "Label for the phone number", + "type": "string", + "title": "Label" + }, + "phone_number_id": { + "description": "The ID of the phone number", + "type": "string", + "title": "Phone Number Id" + }, + "assigned_agent": { + "description": "The agent that is assigned to the phone number", + "anyOf": [ + { + "$ref": "#/components/schemas/PhoneNumberAgentInfo" + }, + { + "type": "null" + } + ] + }, "provider": { "description": "Phone provider", - "$ref": "#/components/schemas/TelephonyProvider" + "type": "string", + "default": "sip_trunk", + "const": "sip_trunk", + "title": "Provider" + }, + "provider_config": { + "anyOf": [ + { + "$ref": "#/components/schemas/SIPTrunkConfigResponseModel" + }, + { + "type": "null" + } + ] + } + }, + "example": { + "phone_number_id": "X3Pbu5gP6NNKBscdCdwB" + }, + "required": [ + "phone_number", + "label", + "phone_number_id" + ], + "title": "GetPhoneNumberSIPTrunkResponseModel" + }, + "GetPhoneNumberTwilioResponseModel": { + "type": "object", + "properties": { + "phone_number": { + "description": "Phone number", + "type": "string", + "title": "Phone Number" }, "label": { "description": "Label for the phone number", @@ -24283,6 +25594,13 @@ "type": "null" } ] + }, + "provider": { + "description": "Phone provider", + "type": "string", + "default": "twilio", + "const": "twilio", + "title": "Provider" } }, "example": { @@ -24290,11 +25608,10 @@ }, "required": [ "phone_number", - "provider", "label", "phone_number_id" ], - "title": "GetPhoneNumberResponseModel" + "title": "GetPhoneNumberTwilioResponseModel" }, "GetProjectsResponseModel": { "type": "object", @@ -25053,10 +26370,10 @@ "type": "object", "properties": { "irreversible_generation": { - "$ref": "#/components/schemas/LLMUsage" + "$ref": "#/components/schemas/LLMUsage-Output" }, "initiated_generation": { - "$ref": "#/components/schemas/LLMUsage" + "$ref": "#/components/schemas/LLMUsage-Output" } }, "title": "LLMCategoryUsage" @@ -25095,7 +26412,23 @@ }, "title": "LLMTokensCategoryUsage" }, - "LLMUsage": { + "LLMUsage-Input": { + "type": "object", + "properties": { + "model_usage": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/LLMInputOutputTokensUsage" + }, + "propertyNames": { + "$ref": "#/components/schemas/LLM" + }, + "title": "Model Usage" + } + }, + "title": "LLMUsage" + }, + "LLMUsage-Output": { "type": "object", "properties": { "model_usage": { @@ -25581,6 +26914,132 @@ ], "title": "LiteralJsonSchemaProperty" }, + "MCPToolConfig-Input": { + "description": "A MCP tool is a tool that is used to call a MCP server", + "type": "object", + "properties": { + "id": { + "type": "string", + "default": "", + "title": "Id" + }, + "name": { + "type": "string", + "minLength": 0, + "pattern": "^[a-zA-Z0-9_-]{1,64}$", + "title": "Name" + }, + "description": { + "type": "string", + "minLength": 0, + "title": "Description" + }, + "response_timeout_secs": { + "description": "The maximum time in seconds to wait for the tool call to complete.", + "type": "integer", + "default": 20, + "title": "Response Timeout Secs" + }, + "type": { + "description": "The type of tool", + "type": "string", + "default": "mcp", + "const": "mcp", + "title": "Type" + }, + "parameters": { + "description": "Schema for any parameters the LLM needs to provide to the MCP tool.", + "anyOf": [ + { + "$ref": "#/components/schemas/ObjectJsonSchemaProperty-Input" + }, + { + "type": "null" + } + ] + }, + "mcp_tool_name": { + "description": "The name of the MCP tool to call", + "type": "string", + "title": "Mcp Tool Name" + }, + "mcp_server_id": { + "description": "The id of the MCP server to call", + "type": "string", + "title": "Mcp Server Id" + } + }, + "required": [ + "name", + "description", + "mcp_tool_name", + "mcp_server_id" + ], + "title": "MCPToolConfig" + }, + "MCPToolConfig-Output": { + "description": "A MCP tool is a tool that is used to call a MCP server", + "type": "object", + "properties": { + "id": { + "type": "string", + "default": "", + "title": "Id" + }, + "name": { + "type": "string", + "minLength": 0, + "pattern": "^[a-zA-Z0-9_-]{1,64}$", + "title": "Name" + }, + "description": { + "type": "string", + "minLength": 0, + "title": "Description" + }, + "response_timeout_secs": { + "description": "The maximum time in seconds to wait for the tool call to complete.", + "type": "integer", + "default": 20, + "title": "Response Timeout Secs" + }, + "type": { + "description": "The type of tool", + "type": "string", + "default": "mcp", + "const": "mcp", + "title": "Type" + }, + "parameters": { + "description": "Schema for any parameters the LLM needs to provide to the MCP tool.", + "anyOf": [ + { + "$ref": "#/components/schemas/ObjectJsonSchemaProperty-Output" + }, + { + "type": "null" + } + ] + }, + "mcp_tool_name": { + "description": "The name of the MCP tool to call", + "type": "string", + "title": "Mcp Tool Name" + }, + "mcp_server_id": { + "description": "The id of the MCP server to call", + "type": "string", + "title": "Mcp Server Id" + } + }, + "required": [ + "name", + "description", + "mcp_tool_name", + "mcp_server_id" + ], + "title": "MCPToolConfig" + }, "ManualVerificationFileResponseModel": { "type": "object", "properties": { @@ -25953,6 +27412,18 @@ "const": "object", "title": "Type" }, + "required": { + "type": "array", + "items": { + "type": "string" + }, + "title": "Required" + }, + "description": { + "type": "string", + "default": "", + "title": "Description" + }, "properties": { "type": "object", "additionalProperties": { @@ -25969,18 +27440,6 @@ ] }, "title": "Properties" - }, - "required": { - "type": "array", - "items": { - "type": "string" - }, - "title": "Required" - }, - "description": { - "type": "string", - "default": "", - "title": "Description" } }, "additionalProperties": false, @@ -25995,6 +27454,18 @@ "const": "object", "title": "Type" }, + "required": { + "type": "array", + "items": { + "type": "string" + }, + "title": "Required" + }, + "description": { + "type": "string", + "default": "", + "title": "Description" + }, "properties": { "type": "object", "additionalProperties": { @@ -26011,18 +27482,6 @@ ] }, "title": "Properties" - }, - "required": { - "type": "array", - "items": { - "type": "string" - }, - "title": "Required" - }, - "description": { - "type": "string", - "default": "", - "title": "Description" } }, "additionalProperties": false, @@ -26044,19 +27503,73 @@ "default": "#2792dc", "title": "Color 1" }, - "color_2": { - "description": "The second color of the avatar", - "type": "string", - "default": "#9ce6e6", - "title": "Color 2" + "color_2": { + "description": "The second color of the avatar", + "type": "string", + "default": "#9ce6e6", + "title": "Color 2" + } + }, + "example": { + "color_1": "#2792dc", + "color_2": "#9ce6e6", + "type": "orb" + }, + "title": "OrbAvatar" + }, + "OutboundCallRecipientResponseModel": { + "type": "object", + "properties": { + "id": { + "type": "string", + "title": "Id" + }, + "phone_number": { + "type": "string", + "title": "Phone Number" + }, + "status": { + "$ref": "#/components/schemas/BatchCallRecipientStatus" + }, + "created_at_unix": { + "type": "integer", + "title": "Created At Unix" + }, + "updated_at_unix": { + "type": "integer", + "title": "Updated At Unix" + }, + "conversation_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Conversation Id" + }, + "conversation_initiation_client_data": { + "anyOf": [ + { + "$ref": "#/components/schemas/ConversationInitiationClientDataInternal" + }, + { + "type": "null" + } + ] } }, - "example": { - "color_1": "#2792dc", - "color_2": "#9ce6e6", - "type": "orb" - }, - "title": "OrbAvatar" + "required": [ + "id", + "phone_number", + "status", + "created_at_unix", + "updated_at_unix", + "conversation_id" + ], + "title": "OutboundCallRecipientResponseModel" }, "PatchConvAIDashboardSettingsRequest": { "type": "object", @@ -26070,13 +27583,17 @@ }, { "$ref": "#/components/schemas/DashboardCriteriaChartModel" + }, + { + "$ref": "#/components/schemas/DashboardDataCollectionChartModel" } ], "discriminator": { "propertyName": "type", "mapping": { "call_success": "#/components/schemas/DashboardCallSuccessChartModel", - "criteria": "#/components/schemas/DashboardCriteriaChartModel" + "criteria": "#/components/schemas/DashboardCriteriaChartModel", + "data_collection": "#/components/schemas/DashboardDataCollectionChartModel" } } }, @@ -26101,6 +27618,13 @@ }, "webhooks": { "$ref": "#/components/schemas/ConvAIWebhooks" + }, + "rag_retention_period_days": { + "type": "integer", + "default": 10, + "exclusiveMinimum": 0, + "maximum": 30, + "title": "Rag Retention Period Days" } }, "title": "PatchConvAISettingsRequest" @@ -26465,6 +27989,12 @@ "type": "boolean", "default": false, "title": "Apply To Existing Conversations" + }, + "zero_retention_mode": { + "description": "Whether to enable zero retention mode - no PII data is stored", + "type": "boolean", + "default": false, + "title": "Zero Retention Mode" } }, "example": { @@ -26472,78 +28002,11 @@ "delete_audio": false, "delete_transcript_and_pii": false, "record_voice": true, - "retention_days": -1 + "retention_days": -1, + "zero_retention_mode": false }, "title": "PrivacyConfig" }, - "ProfilePageResponseModel": { - "type": "object", - "properties": { - "handle": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Handle" - }, - "public_user_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Public User Id" - }, - "name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Name" - }, - "bio": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Bio" - }, - "profile_picture": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Profile Picture" - } - }, - "required": [ - "handle", - "public_user_id", - "name", - "bio", - "profile_picture" - ], - "title": "ProfilePageResponseModel" - }, "ProjectCreationMetaResponseModel": { "type": "object", "properties": { @@ -27520,6 +28983,9 @@ }, { "$ref": "#/components/schemas/SystemToolConfig-Input" + }, + { + "$ref": "#/components/schemas/MCPToolConfig-Input" } ], "description": "The type of tool", @@ -27527,6 +28993,7 @@ "propertyName": "type", "mapping": { "client": "#/components/schemas/ClientToolConfig-Input", + "mcp": "#/components/schemas/MCPToolConfig-Input", "system": "#/components/schemas/SystemToolConfig-Input", "webhook": "#/components/schemas/WebhookToolConfig-Input" } @@ -27542,6 +29009,15 @@ }, "title": "Tool Ids" }, + "mcp_server_ids": { + "description": "A list of MCP server ids to be used by the agent", + "type": "array", + "items": { + "type": "string" + }, + "maxItems": 10, + "title": "Mcp Server Ids" + }, "knowledge_base": { "description": "A list of knowledge bases to be used by the agent", "type": "array", @@ -27629,6 +29105,9 @@ }, { "$ref": "#/components/schemas/SystemToolConfig-Output" + }, + { + "$ref": "#/components/schemas/MCPToolConfig-Output" } ], "description": "The type of tool", @@ -27636,6 +29115,7 @@ "propertyName": "type", "mapping": { "client": "#/components/schemas/ClientToolConfig-Output", + "mcp": "#/components/schemas/MCPToolConfig-Output", "system": "#/components/schemas/SystemToolConfig-Output", "webhook": "#/components/schemas/WebhookToolConfig-Output" } @@ -27651,6 +29131,15 @@ }, "title": "Tool Ids" }, + "mcp_server_ids": { + "description": "A list of MCP server ids to be used by the agent", + "type": "array", + "items": { + "type": "string" + }, + "maxItems": 10, + "title": "Mcp Server Ids" + }, "knowledge_base": { "description": "A list of knowledge bases to be used by the agent", "type": "array", @@ -27699,6 +29188,135 @@ }, "title": "PromptAgent" }, + "PromptAgentDBModel": { + "type": "object", + "properties": { + "prompt": { + "description": "The prompt for the agent", + "type": "string", + "default": "", + "title": "Prompt" + }, + "llm": { + "description": "The LLM to query with the prompt and the chat history", + "default": "gemini-2.0-flash-001", + "$ref": "#/components/schemas/LLM" + }, + "temperature": { + "description": "The temperature for the LLM", + "type": "number", + "default": 0, + "title": "Temperature" + }, + "max_tokens": { + "description": "If greater than 0, maximum number of tokens the LLM can predict", + "type": "integer", + "default": -1, + "title": "Max Tokens" + }, + "tools": { + "description": "A list of tools that the agent can use over the course of the conversation", + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/WebhookToolConfig-Input" + }, + { + "$ref": "#/components/schemas/ClientToolConfig-Input" + }, + { + "$ref": "#/components/schemas/SystemToolConfig-Input" + }, + { + "$ref": "#/components/schemas/MCPToolConfig-Input" + } + ], + "description": "The type of tool", + "discriminator": { + "propertyName": "type", + "mapping": { + "client": "#/components/schemas/ClientToolConfig-Input", + "mcp": "#/components/schemas/MCPToolConfig-Input", + "system": "#/components/schemas/SystemToolConfig-Input", + "webhook": "#/components/schemas/WebhookToolConfig-Input" + } + } + }, + "title": "Tools" + }, + "tool_ids": { + "description": "A list of IDs of tools used by the agent", + "type": "array", + "items": { + "type": "string" + }, + "title": "Tool Ids" + }, + "mcp_server_ids": { + "description": "A list of MCP server ids to be used by the agent", + "type": "array", + "items": { + "type": "string" + }, + "maxItems": 10, + "title": "Mcp Server Ids" + }, + "knowledge_base": { + "description": "A list of knowledge bases to be used by the agent", + "type": "array", + "items": { + "$ref": "#/components/schemas/KnowledgeBaseLocator" + }, + "title": "Knowledge Base" + }, + "custom_llm": { + "description": "Definition for a custom LLM if LLM field is set to 'CUSTOM_LLM'", + "anyOf": [ + { + "$ref": "#/components/schemas/CustomLLM" + }, + { + "type": "null" + } + ] + }, + "ignore_default_personality": { + "description": "Whether to ignore the default personality", + "default": false, + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "title": "Ignore Default Personality" + }, + "rag": { + "description": "Configuration for RAG", + "$ref": "#/components/schemas/RagConfig" + }, + "knowledge_base_document_ids": { + "type": "array", + "items": { + "type": "string" + }, + "title": "Knowledge Base Document Ids" + } + }, + "example": { + "knowledge_base": [], + "llm": "gemini-2.0-flash-001", + "max_tokens": -1, + "prompt": "You are a helpful assistant that can answer questions about the topic of the conversation.", + "temperature": 0, + "tool_ids": [], + "tools": [] + }, + "title": "PromptAgentDBModel" + }, "PromptAgentOverride": { "type": "object", "properties": { @@ -27891,20 +29509,47 @@ "version_id": "5xM3yVvZQKV0EfqQpLr2" }, "required": [ - "id", - "version_id", - "version_rules_num" + "id", + "version_id", + "version_rules_num" + ], + "title": "PronunciationDictionaryRulesResponseModel" + }, + "PronunciationDictionaryVersionLocatorDBModel": { + "type": "object", + "properties": { + "pronunciation_dictionary_id": { + "type": "string", + "title": "Pronunciation Dictionary Id" + }, + "version_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Version Id" + } + }, + "required": [ + "pronunciation_dictionary_id", + "version_id" ], - "title": "PronunciationDictionaryRulesResponseModel" + "title": "PronunciationDictionaryVersionLocatorDBModel" }, - "PronunciationDictionaryVersionLocatorDBModel": { + "PronunciationDictionaryVersionLocatorRequestModel": { "type": "object", "properties": { "pronunciation_dictionary_id": { + "description": "The ID of the pronunciation dictionary.", "type": "string", "title": "Pronunciation Dictionary Id" }, "version_id": { + "description": "The ID of the version of the pronunciation dictionary. If not provided, the latest version will be used.", "anyOf": [ { "type": "string" @@ -27917,10 +29562,9 @@ } }, "required": [ - "pronunciation_dictionary_id", - "version_id" + "pronunciation_dictionary_id" ], - "title": "PronunciationDictionaryVersionLocatorDBModel" + "title": "PronunciationDictionaryVersionLocatorRequestModel" }, "PronunciationDictionaryVersionResponseModel": { "type": "object", @@ -28029,6 +29673,7 @@ "additionalProperties": { "$ref": "#/components/schemas/LiteralJsonSchemaProperty" }, + "minProperties": 1, "title": "Properties" }, "required": { @@ -28468,6 +30113,72 @@ ], "title": "ResourceMetadataResponseModel" }, + "SIPMediaEncryptionEnum": { + "type": "string", + "enum": [ + "disabled", + "allowed", + "required" + ], + "title": "SIPMediaEncryptionEnum" + }, + "SIPTrunkConfigResponseModel": { + "description": "SIP Trunk configuration details for a phone number", + "type": "object", + "properties": { + "address": { + "description": "Hostname or IP the SIP INVITE is sent to", + "type": "string", + "title": "Address" + }, + "transport": { + "description": "Protocol to use for SIP transport", + "$ref": "#/components/schemas/SIPTrunkTransportEnum" + }, + "media_encryption": { + "description": "Whether or not to encrypt media (data layer).", + "$ref": "#/components/schemas/SIPMediaEncryptionEnum" + }, + "headers": { + "description": "SIP headers for INVITE request", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "title": "Headers" + }, + "has_auth_credentials": { + "description": "Whether authentication credentials are configured", + "type": "boolean", + "title": "Has Auth Credentials" + }, + "username": { + "description": "SIP trunk username (if available)", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Username" + }, + "has_outbound_trunk": { + "description": "Whether a LiveKit SIP outbound trunk is configured", + "type": "boolean", + "default": false, + "title": "Has Outbound Trunk" + } + }, + "required": [ + "address", + "transport", + "media_encryption", + "has_auth_credentials" + ], + "title": "SIPTrunkConfigResponseModel" + }, "SIPTrunkCredentials": { "type": "object", "properties": { @@ -28488,6 +30199,46 @@ ], "title": "SIPTrunkCredentials" }, + "SIPTrunkOutboundCallResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "title": "Success" + }, + "message": { + "type": "string", + "title": "Message" + }, + "sip_call_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Sip Call Id" + } + }, + "required": [ + "success", + "message", + "sip_call_id" + ], + "title": "SIPTrunkOutboundCallResponse" + }, + "SIPTrunkTransportEnum": { + "type": "string", + "enum": [ + "auto", + "udp", + "tcp", + "tls" + ], + "title": "SIPTrunkTransportEnum" + }, "SafetyCommonModel": { "description": "Safety object that has the information of safety evaluations based on used voice.", "type": "object", @@ -28715,6 +30466,20 @@ } ], "title": "Text" + }, + "translations": { + "anyOf": [ + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Translations" } }, "required": [ @@ -28933,6 +30698,74 @@ ], "title": "ShareOptionResponseModel" }, + "SimilarVoice": { + "type": "object", + "properties": { + "voice_id": { + "type": "string", + "title": "Voice Id" + }, + "name": { + "type": "string", + "title": "Name" + }, + "category": { + "type": "string", + "enum": [ + "premade", + "cloned", + "generated", + "professional", + "famous" + ], + "title": "Category" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Description" + }, + "preview_url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Preview Url" + } + }, + "required": [ + "voice_id", + "name", + "category" + ], + "title": "SimilarVoice" + }, + "SimilarVoicesForSpeakerResponse": { + "type": "object", + "properties": { + "voices": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SimilarVoice" + }, + "title": "Voices" + } + }, + "required": [ + "voices" + ], + "title": "SimilarVoicesForSpeakerResponse" + }, "SpeakerAudioResponseModel": { "type": "object", "properties": { @@ -29120,6 +30953,13 @@ "type": "string", "title": "Speaker Name" }, + "voices": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "title": "Voices" + }, "segments": { "type": "array", "items": { @@ -29132,10 +30972,24 @@ "id", "media_ref", "speaker_name", + "voices", "segments" ], "title": "SpeakerTrack" }, + "SpeakerUpdatedResponse": { + "type": "object", + "properties": { + "version": { + "type": "integer", + "title": "Version" + } + }, + "required": [ + "version" + ], + "title": "SpeakerUpdatedResponse" + }, "SpeechHistoryItemResponseModel": { "type": "object", "properties": { @@ -29267,7 +31121,7 @@ "title": "Share Link Id" }, "source": { - "description": "The source of the history item. Either TTS (text to speech), STS (speech to text), AN (audio native), Projects, Dubbing or PlayAPI.", + "description": "The source of the history item. Either TTS (text to speech), STS (speech to text), AN (audio native), Projects, Dubbing, PlayAPI, PD (pronunciation dictionary) or ConvAI (conversational AI).", "anyOf": [ { "type": "string", @@ -29275,9 +31129,11 @@ "TTS", "STS", "Projects", + "PD", "AN", "Dubbing", - "PlayAPI" + "PlayAPI", + "ConvAI" ] }, { @@ -29516,6 +31372,11 @@ ], "title": "Speaker Id" }, + "logprob": { + "description": "The log of the probability with which this word was predicted. Logprobs are in range [-infinity, 0], higher logprobs indicate a higher confidence the model has in its predictions.", + "type": "number", + "title": "Logprob" + }, "characters": { "description": "The characters that make up the word and their timing information.", "anyOf": [ @@ -29561,6 +31422,7 @@ } ], "end": 0.5, + "logprob": -0.124, "speaker_id": "speaker_1", "start": 0, "text": "Hello", @@ -29568,7 +31430,8 @@ }, "required": [ "text", - "type" + "type", + "logprob" ], "title": "SpeechToTextWordResponseModel" }, @@ -30160,13 +32023,6 @@ "default": "", "title": "Id" }, - "type": { - "description": "The type of tool", - "type": "string", - "default": "system", - "const": "system", - "title": "Type" - }, "name": { "type": "string", "minLength": 0, @@ -30178,6 +32034,19 @@ "minLength": 0, "title": "Description" }, + "response_timeout_secs": { + "description": "The maximum time in seconds to wait for the tool call to complete.", + "type": "integer", + "default": 20, + "title": "Response Timeout Secs" + }, + "type": { + "description": "The type of tool", + "type": "string", + "default": "system", + "const": "system", + "title": "Type" + }, "params": { "discriminator": { "propertyName": "system_tool_type", @@ -30224,13 +32093,6 @@ "default": "", "title": "Id" }, - "type": { - "description": "The type of tool", - "type": "string", - "default": "system", - "const": "system", - "title": "Type" - }, "name": { "type": "string", "minLength": 0, @@ -30242,6 +32104,19 @@ "minLength": 0, "title": "Description" }, + "response_timeout_secs": { + "description": "The maximum time in seconds to wait for the tool call to complete.", + "type": "integer", + "default": 20, + "title": "Response Timeout Secs" + }, + "type": { + "description": "The type of tool", + "type": "string", + "default": "system", + "const": "system", + "title": "Type" + }, "params": { "discriminator": { "propertyName": "system_tool_type", @@ -30423,6 +32298,22 @@ ], "title": "TelephonyProvider" }, + "ToolMockConfig": { + "type": "object", + "properties": { + "default_return_value": { + "type": "string", + "default": "Tool Called.", + "title": "Default Return Value" + }, + "default_is_error": { + "type": "boolean", + "default": false, + "title": "Default Is Error" + } + }, + "title": "ToolMockConfig" + }, "TransferToAgentToolConfig": { "type": "object", "properties": { @@ -31819,7 +33710,7 @@ "title": "Use Speaker Boost" }, "speed": { - "description": "Controls the speed of the generated speech. Values range from 0.7 to 1.2, with 1.0 being the default speed. Lower values create slower, more deliberate speech while higher values produce faster-paced speech. Extreme values can impact the quality of the generated speech.", + "description": "Adjusts the speed of the voice. A value of 1.0 is the default speed, while values less than 1.0 slow down the speech, and values greater than 1.0 speed it up.", "anyOf": [ { "type": "number" @@ -32645,13 +34536,6 @@ "default": "", "title": "Id" }, - "type": { - "description": "The type of tool", - "type": "string", - "default": "webhook", - "const": "webhook", - "title": "Type" - }, "name": { "type": "string", "minLength": 0, @@ -32663,6 +34547,21 @@ "minLength": 0, "title": "Description" }, + "response_timeout_secs": { + "description": "The maximum time in seconds to wait for the tool call to complete. Must be between 5 and 120 seconds (inclusive).", + "type": "integer", + "default": 20, + "maximum": 120, + "minimum": 5, + "title": "Response Timeout Secs" + }, + "type": { + "description": "The type of tool", + "type": "string", + "default": "webhook", + "const": "webhook", + "title": "Type" + }, "api_schema": { "description": "The schema for the outgoing webhoook, including parameters and URL specification", "$ref": "#/components/schemas/WebhookToolApiSchemaConfig-Input" @@ -32673,6 +34572,7 @@ } }, "example": { + "response_timeout_secs": 20, "type": "webhook" }, "required": [ @@ -32691,13 +34591,6 @@ "default": "", "title": "Id" }, - "type": { - "description": "The type of tool", - "type": "string", - "default": "webhook", - "const": "webhook", - "title": "Type" - }, "name": { "type": "string", "minLength": 0, @@ -32709,6 +34602,21 @@ "minLength": 0, "title": "Description" }, + "response_timeout_secs": { + "description": "The maximum time in seconds to wait for the tool call to complete. Must be between 5 and 120 seconds (inclusive).", + "type": "integer", + "default": 20, + "maximum": 120, + "minimum": 5, + "title": "Response Timeout Secs" + }, + "type": { + "description": "The type of tool", + "type": "string", + "default": "webhook", + "const": "webhook", + "title": "Type" + }, "api_schema": { "description": "The schema for the outgoing webhoook, including parameters and URL specification", "$ref": "#/components/schemas/WebhookToolApiSchemaConfig-Output" @@ -32719,6 +34627,7 @@ } }, "example": { + "response_timeout_secs": 20, "type": "webhook" }, "required": [ @@ -33363,6 +35272,7 @@ "convai_secrets", "music_latent", "convai_phone_numbers", + "convai_mcps", "convai_batch_calls" ], "title": "WorkspaceResourceType" diff --git a/poetry.lock b/poetry.lock index 66a3ca87..e31b1950 100644 --- a/poetry.lock +++ b/poetry.lock @@ -161,15 +161,18 @@ files = [ [[package]] name = "exceptiongroup" -version = "1.2.2" +version = "1.3.0" description = "Backport of PEP 654 (exception groups)" optional = false python-versions = ">=3.7" files = [ - {file = "exceptiongroup-1.2.2-py3-none-any.whl", hash = "sha256:3111b9d131c238bec2f8f516e123e14ba243563fb135d3fe885990585aa7795b"}, - {file = "exceptiongroup-1.2.2.tar.gz", hash = "sha256:47c2edf7c6738fafb49fd34290706d1a1a2f4d1c6df275526b62cbb4aa5393cc"}, + {file = "exceptiongroup-1.3.0-py3-none-any.whl", hash = "sha256:4d111e6e0c13d0644cad6ddaa7ed0261a0b36971f6d23e7ec9b4b9097da78a10"}, + {file = "exceptiongroup-1.3.0.tar.gz", hash = "sha256:b241f5885f560bc56a59ee63ca4c6a8bfa46ae4ad651af316d4e81817bb9fd88"}, ] +[package.dependencies] +typing-extensions = {version = ">=4.6.0", markers = "python_version < \"3.13\""} + [package.extras] test = ["pytest (>=6)"] diff --git a/pyproject.toml b/pyproject.toml index f6a5d23d..690d2ea3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ name = "elevenlabs" [tool.poetry] name = "elevenlabs" -version = "v1.58.1" +version = "v1.59.0" description = "" readme = "README.md" authors = [] diff --git a/reference.md b/reference.md index c80c76a6..719d439d 100644 --- a/reference.md +++ b/reference.md @@ -2952,6 +2952,14 @@ client.voices.get_shared(
+**include_custom_rates:** `typing.Optional[bool]` — Include/exclude voices with custom rates + +
+
+ +
+
+ **reader_app_enabled:** `typing.Optional[bool]` — Filter voices that are enabled for the reader app
@@ -3078,76 +3086,6 @@ typing.Optional[core.File]` — See core.File for more documentation
- - - - -
client.voices.get_a_profile_page(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Gets a profile page based on a handle -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.voices.get_a_profile_page( - handle="talexgeorge", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**handle:** `str` — Handle for a VA's profile page - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- -
@@ -3451,111 +3389,6 @@ client.dubbing.add_language_to_resource( - - - - -
client.dubbing.create_segment_for_speaker(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Creates a new segment in dubbing resource with a start and end time for the speaker in every available language. Does not automatically generate transcripts/translations/audio. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from elevenlabs import ElevenLabs - -client = ElevenLabs( - api_key="YOUR_API_KEY", -) -client.dubbing.create_segment_for_speaker( - dubbing_id="dubbing_id", - speaker_id="speaker_id", - start_time=1.1, - end_time=1.1, -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**dubbing_id:** `str` — ID of the dubbing project. - -
-
- -
-
- -**speaker_id:** `str` — ID of the speaker. - -
-
- -
-
- -**start_time:** `float` - -
-
- -
-
- -**end_time:** `float` - -
-
- -
-
- -**text:** `typing.Optional[str]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- -
@@ -4932,7 +4765,7 @@ typing.Optional[core.File]` — See core.File for more documentation
-Returns the credit usage metrics for the current user or the entire workspace they are part of. The response will return a time axis with unix timestamps for each day and daily usage along that axis. The usage will be broken down by the specified breakdown type. For example, breakdown type "voice" will return the usage of each voice along the time axis. +Returns the usage metrics for the current user or the entire workspace they are part of. The response provides a time axis based on the specified aggregation interval (default: day), with usage values for each interval along that axis. Usage is broken down by the selected breakdown type. For example, breakdown type "voice" will return the usage of each voice for each interval along the time axis.
@@ -6967,7 +6800,7 @@ client.conversational_ai.create_agent(
-**categories:** `typing.Optional[typing.Sequence[str]]` — Categories to help classify and filter the agent +**tags:** `typing.Optional[typing.Sequence[str]]` — Tags to help classify and filter the agent
@@ -7209,7 +7042,7 @@ client.conversational_ai.update_agent(
-**categories:** `typing.Optional[typing.Sequence[str]]` — Categories to help classify and filter the agent +**tags:** `typing.Optional[typing.Sequence[str]]` — Tags to help classify and filter the agent
@@ -7287,7 +7120,7 @@ client.conversational_ai.get_agent_widget(
-**conversation_signature:** `typing.Optional[str]` — An expiring token that enables a conversation to start. These can be generated for an agent using the /v1/convai/conversation/get_signed_url endpoint +**conversation_signature:** `typing.Optional[str]` — An expiring token that enables a websocket conversation to start. These can be generated for an agent using the /v1/convai/conversation/get-signed-url endpoint
@@ -7895,13 +7728,16 @@ Import Phone Number from provider configuration (Twilio or SIP trunk)
```python -from elevenlabs import CreateTwilioPhoneNumberRequest, ElevenLabs +from elevenlabs import ElevenLabs +from elevenlabs.conversational_ai import ( + ConversationalAiCreatePhoneNumberRequestBody_Twilio, +) client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.create_phone_number( - request=CreateTwilioPhoneNumberRequest( + request=ConversationalAiCreatePhoneNumberRequestBody_Twilio( phone_number="phone_number", label="label", sid="sid", @@ -8653,7 +8489,7 @@ client.conversational_ai.create_knowledge_base_text_document( -
client.conversational_ai.rag_index_status(...) +
client.conversational_ai.get_knowledge_base_document_by_id(...)
@@ -8665,7 +8501,7 @@ client.conversational_ai.create_knowledge_base_text_document(
-In case the document is not RAG indexed, it triggers rag indexing task, otherwise it just returns the current status. +Get details about a specific documentation making up the agent's knowledge base
@@ -8685,9 +8521,8 @@ from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) -client.conversational_ai.rag_index_status( +client.conversational_ai.get_knowledge_base_document_by_id( documentation_id="21m00Tcm4TlvDq8ikWAM", - model="e5_mistral_7b_instruct", ) ``` @@ -8712,14 +8547,6 @@ client.conversational_ai.rag_index_status(
-**model:** `EmbeddingModelEnum` - -
-
- -
-
- **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -8732,7 +8559,7 @@ client.conversational_ai.rag_index_status(
-
client.conversational_ai.get_knowledge_base_document_by_id(...) +
client.conversational_ai.delete_knowledge_base_document(...)
@@ -8744,7 +8571,7 @@ client.conversational_ai.rag_index_status(
-Get details about a specific documentation making up the agent's knowledge base +Delete a document from the knowledge base
@@ -8764,7 +8591,7 @@ from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) -client.conversational_ai.get_knowledge_base_document_by_id( +client.conversational_ai.delete_knowledge_base_document( documentation_id="21m00Tcm4TlvDq8ikWAM", ) @@ -8802,7 +8629,7 @@ client.conversational_ai.get_knowledge_base_document_by_id(
-
client.conversational_ai.delete_knowledge_base_document(...) +
client.conversational_ai.update_knowledge_base_document(...)
@@ -8814,7 +8641,7 @@ client.conversational_ai.get_knowledge_base_document_by_id(
-Delete a document from the knowledge base +Update the name of a document
@@ -8834,8 +8661,9 @@ from elevenlabs import ElevenLabs client = ElevenLabs( api_key="YOUR_API_KEY", ) -client.conversational_ai.delete_knowledge_base_document( +client.conversational_ai.update_knowledge_base_document( documentation_id="21m00Tcm4TlvDq8ikWAM", + name="name", ) ``` @@ -8860,6 +8688,14 @@ client.conversational_ai.delete_knowledge_base_document(
+**name:** `str` — A custom, human-readable name for the document. + +
+
+ +
+
+ **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -9231,6 +9067,14 @@ client.conversational_ai.update_settings()
+**rag_retention_period_days:** `typing.Optional[int]` + +
+
+ +
+
+ **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -9576,6 +9420,735 @@ client.conversational_ai.delete_secret(
+
+ + + +
client.conversational_ai.get_batch_call(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get detailed information about a batch call including all recipients. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from elevenlabs import ElevenLabs + +client = ElevenLabs( + api_key="YOUR_API_KEY", +) +client.conversational_ai.get_batch_call( + batch_id="batch_id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**batch_id:** `str` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +## ConversationalAi Agents +
client.conversational_ai.agents.simulate_conversation(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Run a conversation between the agent and a simulated user. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from elevenlabs import ( + AgentConfigDbModel, + ConversationSimulationSpecification, + ElevenLabs, +) + +client = ElevenLabs( + api_key="YOUR_API_KEY", +) +client.conversational_ai.agents.simulate_conversation( + agent_id="21m00Tcm4TlvDq8ikWAM", + simulation_specification=ConversationSimulationSpecification( + simulated_user_config=AgentConfigDbModel( + first_message="Hello, how can I help you today?", + language="en", + ), + ), +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**agent_id:** `str` — The id of an agent. This is returned on agent creation. + +
+
+ +
+
+ +**simulation_specification:** `ConversationSimulationSpecification` — A specification detailing how the conversation should be simulated + +
+
+ +
+
+ +**extra_evaluation_criteria:** `typing.Optional[typing.Sequence[PromptEvaluationCriteria]]` — A list of evaluation criteria to test + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.conversational_ai.agents.simulate_conversation_stream(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Run a conversation between the agent and a simulated user and stream back the response. Response is streamed back as partial lists of messages that should be concatenated and once the conversation has complete a single final message with the conversation analysis will be sent. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from elevenlabs import ( + AgentConfigDbModel, + ConversationSimulationSpecification, + ElevenLabs, +) + +client = ElevenLabs( + api_key="YOUR_API_KEY", +) +client.conversational_ai.agents.simulate_conversation_stream( + agent_id="21m00Tcm4TlvDq8ikWAM", + simulation_specification=ConversationSimulationSpecification( + simulated_user_config=AgentConfigDbModel( + first_message="Hello, how can I help you today?", + language="en", + ), + ), +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**agent_id:** `str` — The id of an agent. This is returned on agent creation. + +
+
+ +
+
+ +**simulation_specification:** `ConversationSimulationSpecification` — A specification detailing how the conversation should be simulated + +
+
+ +
+
+ +**extra_evaluation_criteria:** `typing.Optional[typing.Sequence[PromptEvaluationCriteria]]` — A list of evaluation criteria to test + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +## ConversationalAi SipTrunk +
client.conversational_ai.sip_trunk.outbound_call(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Handle an outbound call via SIP trunk +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from elevenlabs import ElevenLabs + +client = ElevenLabs( + api_key="YOUR_API_KEY", +) +client.conversational_ai.sip_trunk.outbound_call( + agent_id="agent_id", + agent_phone_number_id="agent_phone_number_id", + to_number="to_number", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**agent_id:** `str` + +
+
+ +
+
+ +**agent_phone_number_id:** `str` + +
+
+ +
+
+ +**to_number:** `str` + +
+
+ +
+
+ +**conversation_initiation_client_data:** `typing.Optional[ConversationInitiationClientDataRequestInput]` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +## ConversationalAi KnowledgeBase Document +
client.conversational_ai.knowledge_base.document.compute_rag_index(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +In case the document is not RAG indexed, it triggers rag indexing task, otherwise it just returns the current status. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from elevenlabs import ElevenLabs + +client = ElevenLabs( + api_key="YOUR_API_KEY", +) +client.conversational_ai.knowledge_base.document.compute_rag_index( + documentation_id="21m00Tcm4TlvDq8ikWAM", + model="e5_mistral_7b_instruct", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**documentation_id:** `str` — The id of a document from the knowledge base. This is returned on document addition. + +
+
+ +
+
+ +**model:** `EmbeddingModelEnum` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +## Dubbing Speaker +
client.dubbing.speaker.update(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Amend the metadata associated with a speaker, such as their voice. Both voice cloning and using voices from the ElevenLabs library are supported. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from elevenlabs import ElevenLabs + +client = ElevenLabs( + api_key="YOUR_API_KEY", +) +client.dubbing.speaker.update( + dubbing_id="dubbing_id", + speaker_id="speaker_id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**dubbing_id:** `str` — ID of the dubbing project. + +
+
+ +
+
+ +**speaker_id:** `str` — ID of the speaker. + +
+
+ +
+
+ +**voice_id:** `typing.Optional[str]` — Either the identifier of a voice from the ElevenLabs voice library, or one of ['track-clone', 'clip-clone']. + +
+
+ +
+
+ +**languages:** `typing.Optional[typing.Sequence[str]]` — Languages to apply these changes to. If empty, will apply to all languages. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.dubbing.speaker.similar_voices(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Fetch the top 10 similar voices to a speaker, including the voice IDs, names, descriptions, and, where possible, a sample audio recording. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from elevenlabs import ElevenLabs + +client = ElevenLabs( + api_key="YOUR_API_KEY", +) +client.dubbing.speaker.similar_voices( + dubbing_id="dubbing_id", + speaker_id="speaker_id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**dubbing_id:** `str` — ID of the dubbing project. + +
+
+ +
+
+ +**speaker_id:** `str` — ID of the speaker. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +## Dubbing Speaker Segment +
client.dubbing.speaker.segment.create(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates a new segment in dubbing resource with a start and end time for the speaker in every available language. Does not automatically generate transcripts/translations/audio. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from elevenlabs import ElevenLabs + +client = ElevenLabs( + api_key="YOUR_API_KEY", +) +client.dubbing.speaker.segment.create( + dubbing_id="dubbing_id", + speaker_id="speaker_id", + start_time=1.1, + end_time=1.1, +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**dubbing_id:** `str` — ID of the dubbing project. + +
+
+ +
+
+ +**speaker_id:** `str` — ID of the speaker. + +
+
+ +
+
+ +**start_time:** `float` + +
+
+ +
+
+ +**end_time:** `float` + +
+
+ +
+
+ +**text:** `typing.Optional[str]` + +
+
+ +
+
+ +**translations:** `typing.Optional[typing.Dict[str, typing.Optional[str]]]` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ +
diff --git a/src/elevenlabs/__init__.py b/src/elevenlabs/__init__.py index b708e8d3..31eae064 100644 --- a/src/elevenlabs/__init__.py +++ b/src/elevenlabs/__init__.py @@ -18,11 +18,13 @@ AgentBan, AgentCallLimits, AgentConfig, + AgentConfigDbModel, AgentConfigOverride, AgentConfigOverrideConfig, AgentMetadataResponseModel, AgentPlatformSettingsRequestModel, AgentPlatformSettingsResponseModel, + AgentSimulatedChatTestResponseModel, AgentSummaryResponseModel, AgentTransfer, AgentWorkspaceOverridesInput, @@ -42,10 +44,14 @@ AudioNativeProjectSettingsResponseModel, AudioNativeProjectSettingsResponseModelStatus, AudioOutput, + AudioOutputMulti, AudioWithTimestampsResponse, AuthSettings, AuthorizationMethod, BanReasonType, + BatchCallDetailedResponse, + BatchCallRecipientStatus, + BatchCallStatus, BodyAddChapterToAProjectV1ProjectsProjectIdChaptersAddPost, BodyAddProjectV1ProjectsAddPostApplyTextNormalization, BodyAddProjectV1ProjectsAddPostFiction, @@ -97,6 +103,8 @@ ClientToolConfigInput, ClientToolConfigOutput, CloseConnection, + CloseContext, + CloseSocket, ConvAiSecretLocator, ConvAiStoredSecretDependencies, ConvAiStoredSecretDependenciesAgentToolsItem, @@ -115,15 +123,21 @@ ConversationConfigClientOverrideOutput, ConversationDeletionSettings, ConversationHistoryAnalysisCommonModel, + ConversationHistoryBatchCallModel, ConversationHistoryErrorCommonModel, ConversationHistoryEvaluationCriteriaResultCommonModel, ConversationHistoryFeedbackCommonModel, ConversationHistoryMetadataCommonModel, ConversationHistoryMetadataCommonModelPhoneCall, + ConversationHistoryMetadataCommonModelPhoneCall_SipTrunking, ConversationHistoryMetadataCommonModelPhoneCall_Twilio, ConversationHistoryRagUsageCommonModel, - ConversationHistoryTranscriptCommonModel, - ConversationHistoryTranscriptCommonModelRole, + ConversationHistorySipTrunkingPhoneCallModel, + ConversationHistorySipTrunkingPhoneCallModelDirection, + ConversationHistoryTranscriptCommonModelInput, + ConversationHistoryTranscriptCommonModelInputRole, + ConversationHistoryTranscriptCommonModelOutput, + ConversationHistoryTranscriptCommonModelOutputRole, ConversationHistoryTranscriptToolCallClientDetails, ConversationHistoryTranscriptToolCallCommonModel, ConversationHistoryTranscriptToolCallCommonModelToolDetails, @@ -135,6 +149,8 @@ ConversationHistoryTwilioPhoneCallModelDirection, ConversationInitiationClientDataConfigInput, ConversationInitiationClientDataConfigOutput, + ConversationInitiationClientDataInternal, + ConversationInitiationClientDataInternalDynamicVariablesValue, ConversationInitiationClientDataRequestInput, ConversationInitiationClientDataRequestInputDynamicVariablesValue, ConversationInitiationClientDataRequestOutput, @@ -142,6 +158,7 @@ ConversationInitiationClientDataWebhook, ConversationInitiationClientDataWebhookRequestHeadersValue, ConversationSignedUrlResponseModel, + ConversationSimulationSpecification, ConversationSummaryResponseModel, ConversationSummaryResponseModelStatus, ConversationTokenDbModel, @@ -161,6 +178,7 @@ CustomLlm, DashboardCallSuccessChartModel, DashboardCriteriaChartModel, + DashboardDataCollectionChartModel, DataCollectionResultCommonModel, DeleteChapterRequest, DeleteChapterResponseModel, @@ -218,8 +236,10 @@ ExtendedSubscriptionResponseModelStatus, FeedbackItem, FinalOutput, + FinalOutputMulti, FineTuningResponse, FineTuningResponseModelStateValue, + FlushContext, ForcedAlignmentCharacterResponseModel, ForcedAlignmentResponseModel, ForcedAlignmentWordResponseModel, @@ -229,6 +249,9 @@ GetAgentEmbedResponseModel, GetAgentLinkResponseModel, GetAgentResponseModel, + GetAgentResponseModelPhoneNumbersItem, + GetAgentResponseModelPhoneNumbersItem_SipTrunk, + GetAgentResponseModelPhoneNumbersItem_Twilio, GetAgentsPageResponseModel, GetAudioNativeProjectSettingsResponseModel, GetChapterRequest, @@ -239,6 +262,7 @@ GetConvAiDashboardSettingsResponseModelChartsItem, GetConvAiDashboardSettingsResponseModelChartsItem_CallSuccess, GetConvAiDashboardSettingsResponseModelChartsItem_Criteria, + GetConvAiDashboardSettingsResponseModelChartsItem_DataCollection, GetConvAiSettingsResponseModel, GetConversationResponseModel, GetConversationResponseModelStatus, @@ -268,7 +292,9 @@ GetKnowledgeBaseTextResponseModel, GetKnowledgeBaseUrlResponseModel, GetLibraryVoicesResponse, - GetPhoneNumberResponseModel, + GetPhoneNumberResponse, + GetPhoneNumberSipTrunkResponseModel, + GetPhoneNumberTwilioResponseModel, GetProjectRequest, GetProjectsRequest, GetProjectsResponse, @@ -287,8 +313,11 @@ HtmlExportOptions, HttpValidationError, ImageAvatar, + InitialiseContext, InitializeConnection, + InitializeConnectionMulti, InvoiceResponse, + KeepContextAlive, KnowledgeBaseDocumentChunkResponseModel, KnowledgeBaseDocumentMetadataResponseModel, KnowledgeBaseDocumentType, @@ -308,9 +337,12 @@ LlmCategoryUsage, LlmInputOutputTokensUsage, LlmTokensCategoryUsage, - LlmUsage, + LlmUsageInput, + LlmUsageOutput, ManualVerificationFileResponse, ManualVerificationResponse, + McpToolConfigInput, + McpToolConfigOutput, MetricRecord, MetricType, Model, @@ -325,6 +357,7 @@ ObjectJsonSchemaPropertyOutput, ObjectJsonSchemaPropertyOutputPropertiesValue, OrbAvatar, + OutboundCallRecipientResponseModel, OutputFormat, PdfExportOptions, PhoneNumberAgentInfo, @@ -339,7 +372,6 @@ PostAgentAvatarResponseModel, PostWorkspaceSecretResponseModel, PrivacyConfig, - ProfilePageResponseModel, ProjectCreationMetaResponseModel, ProjectCreationMetaResponseModelStatus, ProjectCreationMetaResponseModelType, @@ -360,12 +392,20 @@ ProjectSnapshotsResponse, ProjectState, PromptAgent, + PromptAgentDbModel, + PromptAgentDbModelToolsItem, + PromptAgentDbModelToolsItem_Client, + PromptAgentDbModelToolsItem_Mcp, + PromptAgentDbModelToolsItem_System, + PromptAgentDbModelToolsItem_Webhook, PromptAgentInputToolsItem, PromptAgentInputToolsItem_Client, + PromptAgentInputToolsItem_Mcp, PromptAgentInputToolsItem_System, PromptAgentInputToolsItem_Webhook, PromptAgentOutputToolsItem, PromptAgentOutputToolsItem_Client, + PromptAgentOutputToolsItem_Mcp, PromptAgentOutputToolsItem_System, PromptAgentOutputToolsItem_Webhook, PromptAgentOverride, @@ -412,15 +452,24 @@ SegmentUpdateResponse, SegmentedJsonExportOptions, SendText, + SendTextMulti, ShareOptionResponseModel, ShareOptionResponseModelType, + SimilarVoice, + SimilarVoiceCategory, + SimilarVoicesForSpeakerResponse, + SipMediaEncryptionEnum, + SipTrunkConfigResponseModel, SipTrunkCredentials, + SipTrunkOutboundCallResponse, + SipTrunkTransportEnum, SpeakerAudioResponseModel, SpeakerResponseModel, SpeakerSegment, SpeakerSeparationResponseModel, SpeakerSeparationResponseModelStatus, SpeakerTrack, + SpeakerUpdatedResponse, SpeechHistoryItemResponse, SpeechHistoryItemResponseModelSource, SpeechHistoryItemResponseModelVoiceCategory, @@ -431,6 +480,8 @@ SrtExportOptions, StartPvcVoiceTrainingResponseModel, StartSpeakerSeparationResponseModel, + StreamInputQueryParameters, + StreamInputQueryParametersOptimizeStreamingLatency, StreamingAudioChunkWithTimestampsResponse, Subscription, SubscriptionExtrasResponseModel, @@ -453,7 +504,10 @@ SystemToolConfigOutputParams_TransferToAgent, SystemToolConfigOutputParams_TransferToNumber, TelephonyProvider, + TextToSpeechApplyTextNormalizationEnum, + TextToSpeechOutputFormatEnum, TextToSpeechStreamRequest, + ToolMockConfig, TransferToAgentToolConfig, TransferToNumberToolConfig, TtsConversationalConfig, @@ -507,6 +561,8 @@ WebhookToolApiSchemaConfigOutputRequestHeadersValue, WebhookToolConfigInput, WebhookToolConfigOutput, + WebsocketTtsClientMessageMulti, + WebsocketTtsServerMessageMulti, WidgetConfig, WidgetConfigAvatar, WidgetConfigAvatar_Image, @@ -541,6 +597,7 @@ text_to_voice, usage, user, + v_1_text_to_speech_voice_id_multi_stream_input, v_1_text_to_speech_voice_id_stream_input, voices, workspace, @@ -552,13 +609,29 @@ from .client import AsyncElevenLabs, ElevenLabs from .conversational_ai import ( ConversationalAiCreatePhoneNumberRequestBody, + ConversationalAiCreatePhoneNumberRequestBody_SipTrunk, + ConversationalAiCreatePhoneNumberRequestBody_Twilio, ConversationalAiGetKnowledgeBaseDocumentByIdResponse, ConversationalAiGetKnowledgeBaseDocumentByIdResponse_File, ConversationalAiGetKnowledgeBaseDocumentByIdResponse_Text, ConversationalAiGetKnowledgeBaseDocumentByIdResponse_Url, + ConversationalAiGetPhoneNumberResponse, + ConversationalAiGetPhoneNumberResponse_SipTrunk, + ConversationalAiGetPhoneNumberResponse_Twilio, + ConversationalAiGetPhoneNumbersResponseItem, + ConversationalAiGetPhoneNumbersResponseItem_SipTrunk, + ConversationalAiGetPhoneNumbersResponseItem_Twilio, + ConversationalAiUpdateKnowledgeBaseDocumentResponse, + ConversationalAiUpdateKnowledgeBaseDocumentResponse_File, + ConversationalAiUpdateKnowledgeBaseDocumentResponse_Text, + ConversationalAiUpdateKnowledgeBaseDocumentResponse_Url, + ConversationalAiUpdatePhoneNumberResponse, + ConversationalAiUpdatePhoneNumberResponse_SipTrunk, + ConversationalAiUpdatePhoneNumberResponse_Twilio, PatchConvAiDashboardSettingsRequestChartsItem, PatchConvAiDashboardSettingsRequestChartsItem_CallSuccess, PatchConvAiDashboardSettingsRequestChartsItem_Criteria, + PatchConvAiDashboardSettingsRequestChartsItem_DataCollection, ) from .dubbing import DubbingGetTranscriptForDubRequestFormatType from .environment import ElevenLabsEnvironment @@ -605,13 +678,13 @@ TextToSpeechStreamWithTimestampsRequestOutputFormat, ) from .text_to_voice import TextToVoiceCreatePreviewsRequestOutputFormat -from .v_1_text_to_speech_voice_id_stream_input import ( - ReceiveMessage, - SendMessage, +from .v_1_text_to_speech_voice_id_multi_stream_input import ( + ReceiveMessageMulti, + SendMessageMulti, TextToSpeechApplyTextNormalization, - TextToSpeechOptimizeStreamingLatency, TextToSpeechOutputFormat, ) +from .v_1_text_to_speech_voice_id_stream_input import ReceiveMessage, SendMessage from .version import __version__ from .voices import VoicesGetSharedRequestCategory from .workspace import ( @@ -638,11 +711,13 @@ "AgentBan", "AgentCallLimits", "AgentConfig", + "AgentConfigDbModel", "AgentConfigOverride", "AgentConfigOverrideConfig", "AgentMetadataResponseModel", "AgentPlatformSettingsRequestModel", "AgentPlatformSettingsResponseModel", + "AgentSimulatedChatTestResponseModel", "AgentSummaryResponseModel", "AgentTransfer", "AgentWorkspaceOverridesInput", @@ -665,11 +740,15 @@ "AudioNativeProjectSettingsResponseModel", "AudioNativeProjectSettingsResponseModelStatus", "AudioOutput", + "AudioOutputMulti", "AudioWithTimestampsResponse", "AuthSettings", "AuthorizationMethod", "BadRequestError", "BanReasonType", + "BatchCallDetailedResponse", + "BatchCallRecipientStatus", + "BatchCallStatus", "BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostRulesItem", "BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostRulesItem_Alias", "BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPostRulesItem_Phoneme", @@ -741,6 +820,8 @@ "ClientToolConfigInput", "ClientToolConfigOutput", "CloseConnection", + "CloseContext", + "CloseSocket", "ConvAiSecretLocator", "ConvAiStoredSecretDependencies", "ConvAiStoredSecretDependenciesAgentToolsItem", @@ -759,15 +840,21 @@ "ConversationConfigClientOverrideOutput", "ConversationDeletionSettings", "ConversationHistoryAnalysisCommonModel", + "ConversationHistoryBatchCallModel", "ConversationHistoryErrorCommonModel", "ConversationHistoryEvaluationCriteriaResultCommonModel", "ConversationHistoryFeedbackCommonModel", "ConversationHistoryMetadataCommonModel", "ConversationHistoryMetadataCommonModelPhoneCall", + "ConversationHistoryMetadataCommonModelPhoneCall_SipTrunking", "ConversationHistoryMetadataCommonModelPhoneCall_Twilio", "ConversationHistoryRagUsageCommonModel", - "ConversationHistoryTranscriptCommonModel", - "ConversationHistoryTranscriptCommonModelRole", + "ConversationHistorySipTrunkingPhoneCallModel", + "ConversationHistorySipTrunkingPhoneCallModelDirection", + "ConversationHistoryTranscriptCommonModelInput", + "ConversationHistoryTranscriptCommonModelInputRole", + "ConversationHistoryTranscriptCommonModelOutput", + "ConversationHistoryTranscriptCommonModelOutputRole", "ConversationHistoryTranscriptToolCallClientDetails", "ConversationHistoryTranscriptToolCallCommonModel", "ConversationHistoryTranscriptToolCallCommonModelToolDetails", @@ -779,6 +866,8 @@ "ConversationHistoryTwilioPhoneCallModelDirection", "ConversationInitiationClientDataConfigInput", "ConversationInitiationClientDataConfigOutput", + "ConversationInitiationClientDataInternal", + "ConversationInitiationClientDataInternalDynamicVariablesValue", "ConversationInitiationClientDataRequestInput", "ConversationInitiationClientDataRequestInputDynamicVariablesValue", "ConversationInitiationClientDataRequestOutput", @@ -786,16 +875,32 @@ "ConversationInitiationClientDataWebhook", "ConversationInitiationClientDataWebhookRequestHeadersValue", "ConversationSignedUrlResponseModel", + "ConversationSimulationSpecification", "ConversationSummaryResponseModel", "ConversationSummaryResponseModelStatus", "ConversationTokenDbModel", "ConversationTokenPurpose", "ConversationTurnMetrics", "ConversationalAiCreatePhoneNumberRequestBody", + "ConversationalAiCreatePhoneNumberRequestBody_SipTrunk", + "ConversationalAiCreatePhoneNumberRequestBody_Twilio", "ConversationalAiGetKnowledgeBaseDocumentByIdResponse", "ConversationalAiGetKnowledgeBaseDocumentByIdResponse_File", "ConversationalAiGetKnowledgeBaseDocumentByIdResponse_Text", "ConversationalAiGetKnowledgeBaseDocumentByIdResponse_Url", + "ConversationalAiGetPhoneNumberResponse", + "ConversationalAiGetPhoneNumberResponse_SipTrunk", + "ConversationalAiGetPhoneNumberResponse_Twilio", + "ConversationalAiGetPhoneNumbersResponseItem", + "ConversationalAiGetPhoneNumbersResponseItem_SipTrunk", + "ConversationalAiGetPhoneNumbersResponseItem_Twilio", + "ConversationalAiUpdateKnowledgeBaseDocumentResponse", + "ConversationalAiUpdateKnowledgeBaseDocumentResponse_File", + "ConversationalAiUpdateKnowledgeBaseDocumentResponse_Text", + "ConversationalAiUpdateKnowledgeBaseDocumentResponse_Url", + "ConversationalAiUpdatePhoneNumberResponse", + "ConversationalAiUpdatePhoneNumberResponse_SipTrunk", + "ConversationalAiUpdatePhoneNumberResponse_Twilio", "ConversationalConfig", "ConvertChapterResponseModel", "ConvertProjectResponseModel", @@ -810,6 +915,7 @@ "CustomLlm", "DashboardCallSuccessChartModel", "DashboardCriteriaChartModel", + "DashboardDataCollectionChartModel", "DataCollectionResultCommonModel", "DeleteChapterRequest", "DeleteChapterResponseModel", @@ -870,8 +976,10 @@ "ExtendedSubscriptionResponseModelStatus", "FeedbackItem", "FinalOutput", + "FinalOutputMulti", "FineTuningResponse", "FineTuningResponseModelStateValue", + "FlushContext", "ForbiddenError", "ForcedAlignmentCharacterResponseModel", "ForcedAlignmentResponseModel", @@ -882,6 +990,9 @@ "GetAgentEmbedResponseModel", "GetAgentLinkResponseModel", "GetAgentResponseModel", + "GetAgentResponseModelPhoneNumbersItem", + "GetAgentResponseModelPhoneNumbersItem_SipTrunk", + "GetAgentResponseModelPhoneNumbersItem_Twilio", "GetAgentsPageResponseModel", "GetAudioNativeProjectSettingsResponseModel", "GetChapterRequest", @@ -892,6 +1003,7 @@ "GetConvAiDashboardSettingsResponseModelChartsItem", "GetConvAiDashboardSettingsResponseModelChartsItem_CallSuccess", "GetConvAiDashboardSettingsResponseModelChartsItem_Criteria", + "GetConvAiDashboardSettingsResponseModelChartsItem_DataCollection", "GetConvAiSettingsResponseModel", "GetConversationResponseModel", "GetConversationResponseModelStatus", @@ -921,7 +1033,9 @@ "GetKnowledgeBaseTextResponseModel", "GetKnowledgeBaseUrlResponseModel", "GetLibraryVoicesResponse", - "GetPhoneNumberResponseModel", + "GetPhoneNumberResponse", + "GetPhoneNumberSipTrunkResponseModel", + "GetPhoneNumberTwilioResponseModel", "GetProjectRequest", "GetProjectsRequest", "GetProjectsResponse", @@ -941,8 +1055,11 @@ "HtmlExportOptions", "HttpValidationError", "ImageAvatar", + "InitialiseContext", "InitializeConnection", + "InitializeConnectionMulti", "InvoiceResponse", + "KeepContextAlive", "KnowledgeBaseDocumentChunkResponseModel", "KnowledgeBaseDocumentMetadataResponseModel", "KnowledgeBaseDocumentType", @@ -962,9 +1079,12 @@ "LlmCategoryUsage", "LlmInputOutputTokensUsage", "LlmTokensCategoryUsage", - "LlmUsage", + "LlmUsageInput", + "LlmUsageOutput", "ManualVerificationFileResponse", "ManualVerificationResponse", + "McpToolConfigInput", + "McpToolConfigOutput", "MetricRecord", "MetricType", "Model", @@ -980,10 +1100,12 @@ "ObjectJsonSchemaPropertyOutput", "ObjectJsonSchemaPropertyOutputPropertiesValue", "OrbAvatar", + "OutboundCallRecipientResponseModel", "OutputFormat", "PatchConvAiDashboardSettingsRequestChartsItem", "PatchConvAiDashboardSettingsRequestChartsItem_CallSuccess", "PatchConvAiDashboardSettingsRequestChartsItem_Criteria", + "PatchConvAiDashboardSettingsRequestChartsItem_DataCollection", "PdfExportOptions", "PhoneNumberAgentInfo", "PhoneNumberTransfer", @@ -997,7 +1119,6 @@ "PostAgentAvatarResponseModel", "PostWorkspaceSecretResponseModel", "PrivacyConfig", - "ProfilePageResponseModel", "ProjectCreationMetaResponseModel", "ProjectCreationMetaResponseModelStatus", "ProjectCreationMetaResponseModelType", @@ -1018,12 +1139,20 @@ "ProjectSnapshotsResponse", "ProjectState", "PromptAgent", + "PromptAgentDbModel", + "PromptAgentDbModelToolsItem", + "PromptAgentDbModelToolsItem_Client", + "PromptAgentDbModelToolsItem_Mcp", + "PromptAgentDbModelToolsItem_System", + "PromptAgentDbModelToolsItem_Webhook", "PromptAgentInputToolsItem", "PromptAgentInputToolsItem_Client", + "PromptAgentInputToolsItem_Mcp", "PromptAgentInputToolsItem_System", "PromptAgentInputToolsItem_Webhook", "PromptAgentOutputToolsItem", "PromptAgentOutputToolsItem_Client", + "PromptAgentOutputToolsItem_Mcp", "PromptAgentOutputToolsItem_System", "PromptAgentOutputToolsItem_Webhook", "PromptAgentOverride", @@ -1053,6 +1182,7 @@ "ReaderResourceResponseModelResourceType", "RealtimeVoiceSettings", "ReceiveMessage", + "ReceiveMessageMulti", "RecordingResponse", "RemoveMemberFromGroupRequest", "Render", @@ -1076,16 +1206,26 @@ "SegmentUpdateResponse", "SegmentedJsonExportOptions", "SendMessage", + "SendMessageMulti", "SendText", + "SendTextMulti", "ShareOptionResponseModel", "ShareOptionResponseModelType", + "SimilarVoice", + "SimilarVoiceCategory", + "SimilarVoicesForSpeakerResponse", + "SipMediaEncryptionEnum", + "SipTrunkConfigResponseModel", "SipTrunkCredentials", + "SipTrunkOutboundCallResponse", + "SipTrunkTransportEnum", "SpeakerAudioResponseModel", "SpeakerResponseModel", "SpeakerSegment", "SpeakerSeparationResponseModel", "SpeakerSeparationResponseModelStatus", "SpeakerTrack", + "SpeakerUpdatedResponse", "SpeechHistoryItemResponse", "SpeechHistoryItemResponseModelSource", "SpeechHistoryItemResponseModelVoiceCategory", @@ -1102,6 +1242,8 @@ "SrtExportOptions", "StartPvcVoiceTrainingResponseModel", "StartSpeakerSeparationResponseModel", + "StreamInputQueryParameters", + "StreamInputQueryParametersOptimizeStreamingLatency", "StreamingAudioChunkWithTimestampsResponse", "Subscription", "SubscriptionExtrasResponseModel", @@ -1126,15 +1268,17 @@ "TelephonyProvider", "TextToSoundEffectsConvertRequestOutputFormat", "TextToSpeechApplyTextNormalization", + "TextToSpeechApplyTextNormalizationEnum", "TextToSpeechConvertAsStreamRequestOutputFormat", "TextToSpeechConvertRequestOutputFormat", "TextToSpeechConvertWithTimestampsRequestOutputFormat", - "TextToSpeechOptimizeStreamingLatency", "TextToSpeechOutputFormat", + "TextToSpeechOutputFormatEnum", "TextToSpeechStreamRequest", "TextToSpeechStreamWithTimestampsRequestOutputFormat", "TextToVoiceCreatePreviewsRequestOutputFormat", "TooEarlyError", + "ToolMockConfig", "TransferToAgentToolConfig", "TransferToNumberToolConfig", "TtsConversationalConfig", @@ -1190,6 +1334,8 @@ "WebhookToolApiSchemaConfigOutputRequestHeadersValue", "WebhookToolConfigInput", "WebhookToolConfigOutput", + "WebsocketTtsClientMessageMulti", + "WebsocketTtsServerMessageMulti", "WidgetConfig", "WidgetConfigAvatar", "WidgetConfigAvatar_Image", @@ -1225,6 +1371,7 @@ "text_to_voice", "usage", "user", + "v_1_text_to_speech_voice_id_multi_stream_input", "v_1_text_to_speech_voice_id_stream_input", "voices", "workspace", diff --git a/src/elevenlabs/conversational_ai/__init__.py b/src/elevenlabs/conversational_ai/__init__.py index 32062136..ac442394 100644 --- a/src/elevenlabs/conversational_ai/__init__.py +++ b/src/elevenlabs/conversational_ai/__init__.py @@ -2,22 +2,58 @@ from .types import ( ConversationalAiCreatePhoneNumberRequestBody, + ConversationalAiCreatePhoneNumberRequestBody_SipTrunk, + ConversationalAiCreatePhoneNumberRequestBody_Twilio, ConversationalAiGetKnowledgeBaseDocumentByIdResponse, ConversationalAiGetKnowledgeBaseDocumentByIdResponse_File, ConversationalAiGetKnowledgeBaseDocumentByIdResponse_Text, ConversationalAiGetKnowledgeBaseDocumentByIdResponse_Url, + ConversationalAiGetPhoneNumberResponse, + ConversationalAiGetPhoneNumberResponse_SipTrunk, + ConversationalAiGetPhoneNumberResponse_Twilio, + ConversationalAiGetPhoneNumbersResponseItem, + ConversationalAiGetPhoneNumbersResponseItem_SipTrunk, + ConversationalAiGetPhoneNumbersResponseItem_Twilio, + ConversationalAiUpdateKnowledgeBaseDocumentResponse, + ConversationalAiUpdateKnowledgeBaseDocumentResponse_File, + ConversationalAiUpdateKnowledgeBaseDocumentResponse_Text, + ConversationalAiUpdateKnowledgeBaseDocumentResponse_Url, + ConversationalAiUpdatePhoneNumberResponse, + ConversationalAiUpdatePhoneNumberResponse_SipTrunk, + ConversationalAiUpdatePhoneNumberResponse_Twilio, PatchConvAiDashboardSettingsRequestChartsItem, PatchConvAiDashboardSettingsRequestChartsItem_CallSuccess, PatchConvAiDashboardSettingsRequestChartsItem_Criteria, + PatchConvAiDashboardSettingsRequestChartsItem_DataCollection, ) +from . import agents, knowledge_base, sip_trunk __all__ = [ "ConversationalAiCreatePhoneNumberRequestBody", + "ConversationalAiCreatePhoneNumberRequestBody_SipTrunk", + "ConversationalAiCreatePhoneNumberRequestBody_Twilio", "ConversationalAiGetKnowledgeBaseDocumentByIdResponse", "ConversationalAiGetKnowledgeBaseDocumentByIdResponse_File", "ConversationalAiGetKnowledgeBaseDocumentByIdResponse_Text", "ConversationalAiGetKnowledgeBaseDocumentByIdResponse_Url", + "ConversationalAiGetPhoneNumberResponse", + "ConversationalAiGetPhoneNumberResponse_SipTrunk", + "ConversationalAiGetPhoneNumberResponse_Twilio", + "ConversationalAiGetPhoneNumbersResponseItem", + "ConversationalAiGetPhoneNumbersResponseItem_SipTrunk", + "ConversationalAiGetPhoneNumbersResponseItem_Twilio", + "ConversationalAiUpdateKnowledgeBaseDocumentResponse", + "ConversationalAiUpdateKnowledgeBaseDocumentResponse_File", + "ConversationalAiUpdateKnowledgeBaseDocumentResponse_Text", + "ConversationalAiUpdateKnowledgeBaseDocumentResponse_Url", + "ConversationalAiUpdatePhoneNumberResponse", + "ConversationalAiUpdatePhoneNumberResponse_SipTrunk", + "ConversationalAiUpdatePhoneNumberResponse_Twilio", "PatchConvAiDashboardSettingsRequestChartsItem", "PatchConvAiDashboardSettingsRequestChartsItem_CallSuccess", "PatchConvAiDashboardSettingsRequestChartsItem_Criteria", + "PatchConvAiDashboardSettingsRequestChartsItem_DataCollection", + "agents", + "knowledge_base", + "sip_trunk", ] diff --git a/src/elevenlabs/conversational_ai/agents/__init__.py b/src/elevenlabs/conversational_ai/agents/__init__.py new file mode 100644 index 00000000..f3ea2659 --- /dev/null +++ b/src/elevenlabs/conversational_ai/agents/__init__.py @@ -0,0 +1,2 @@ +# This file was auto-generated by Fern from our API Definition. + diff --git a/src/elevenlabs/conversational_ai/agents/client.py b/src/elevenlabs/conversational_ai/agents/client.py new file mode 100644 index 00000000..338d44b7 --- /dev/null +++ b/src/elevenlabs/conversational_ai/agents/client.py @@ -0,0 +1,423 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from ...core.client_wrapper import SyncClientWrapper +from ...types.conversation_simulation_specification import ( + ConversationSimulationSpecification, +) +from ...types.prompt_evaluation_criteria import PromptEvaluationCriteria +from ...core.request_options import RequestOptions +from ...types.agent_simulated_chat_test_response_model import ( + AgentSimulatedChatTestResponseModel, +) +from ...core.jsonable_encoder import jsonable_encoder +from ...core.serialization import convert_and_respect_annotation_metadata +from ...core.unchecked_base_model import construct_type +from ...errors.unprocessable_entity_error import UnprocessableEntityError +from ...types.http_validation_error import HttpValidationError +from json.decoder import JSONDecodeError +from ...core.api_error import ApiError +from ...core.client_wrapper import AsyncClientWrapper + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class AgentsClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def simulate_conversation( + self, + agent_id: str, + *, + simulation_specification: ConversationSimulationSpecification, + extra_evaluation_criteria: typing.Optional[typing.Sequence[PromptEvaluationCriteria]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> AgentSimulatedChatTestResponseModel: + """ + Run a conversation between the agent and a simulated user. + + Parameters + ---------- + agent_id : str + The id of an agent. This is returned on agent creation. + + simulation_specification : ConversationSimulationSpecification + A specification detailing how the conversation should be simulated + + extra_evaluation_criteria : typing.Optional[typing.Sequence[PromptEvaluationCriteria]] + A list of evaluation criteria to test + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AgentSimulatedChatTestResponseModel + Successful Response + + Examples + -------- + from elevenlabs import ( + AgentConfigDbModel, + ConversationSimulationSpecification, + ElevenLabs, + ) + + client = ElevenLabs( + api_key="YOUR_API_KEY", + ) + client.conversational_ai.agents.simulate_conversation( + agent_id="21m00Tcm4TlvDq8ikWAM", + simulation_specification=ConversationSimulationSpecification( + simulated_user_config=AgentConfigDbModel( + first_message="Hello, how can I help you today?", + language="en", + ), + ), + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"v1/convai/agents/{jsonable_encoder(agent_id)}/simulate-conversation", + base_url=self._client_wrapper.get_environment().base, + method="POST", + json={ + "simulation_specification": convert_and_respect_annotation_metadata( + object_=simulation_specification, + annotation=ConversationSimulationSpecification, + direction="write", + ), + "extra_evaluation_criteria": convert_and_respect_annotation_metadata( + object_=extra_evaluation_criteria, + annotation=typing.Sequence[PromptEvaluationCriteria], + direction="write", + ), + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + AgentSimulatedChatTestResponseModel, + construct_type( + type_=AgentSimulatedChatTestResponseModel, # type: ignore + object_=_response.json(), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + typing.cast( + HttpValidationError, + construct_type( + type_=HttpValidationError, # type: ignore + object_=_response.json(), + ), + ) + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def simulate_conversation_stream( + self, + agent_id: str, + *, + simulation_specification: ConversationSimulationSpecification, + extra_evaluation_criteria: typing.Optional[typing.Sequence[PromptEvaluationCriteria]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> None: + """ + Run a conversation between the agent and a simulated user and stream back the response. Response is streamed back as partial lists of messages that should be concatenated and once the conversation has complete a single final message with the conversation analysis will be sent. + + Parameters + ---------- + agent_id : str + The id of an agent. This is returned on agent creation. + + simulation_specification : ConversationSimulationSpecification + A specification detailing how the conversation should be simulated + + extra_evaluation_criteria : typing.Optional[typing.Sequence[PromptEvaluationCriteria]] + A list of evaluation criteria to test + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + None + + Examples + -------- + from elevenlabs import ( + AgentConfigDbModel, + ConversationSimulationSpecification, + ElevenLabs, + ) + + client = ElevenLabs( + api_key="YOUR_API_KEY", + ) + client.conversational_ai.agents.simulate_conversation_stream( + agent_id="21m00Tcm4TlvDq8ikWAM", + simulation_specification=ConversationSimulationSpecification( + simulated_user_config=AgentConfigDbModel( + first_message="Hello, how can I help you today?", + language="en", + ), + ), + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"v1/convai/agents/{jsonable_encoder(agent_id)}/simulate-conversation/stream", + base_url=self._client_wrapper.get_environment().base, + method="POST", + json={ + "simulation_specification": convert_and_respect_annotation_metadata( + object_=simulation_specification, + annotation=ConversationSimulationSpecification, + direction="write", + ), + "extra_evaluation_criteria": convert_and_respect_annotation_metadata( + object_=extra_evaluation_criteria, + annotation=typing.Sequence[PromptEvaluationCriteria], + direction="write", + ), + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return + if _response.status_code == 422: + raise UnprocessableEntityError( + typing.cast( + HttpValidationError, + construct_type( + type_=HttpValidationError, # type: ignore + object_=_response.json(), + ), + ) + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + +class AsyncAgentsClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def simulate_conversation( + self, + agent_id: str, + *, + simulation_specification: ConversationSimulationSpecification, + extra_evaluation_criteria: typing.Optional[typing.Sequence[PromptEvaluationCriteria]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> AgentSimulatedChatTestResponseModel: + """ + Run a conversation between the agent and a simulated user. + + Parameters + ---------- + agent_id : str + The id of an agent. This is returned on agent creation. + + simulation_specification : ConversationSimulationSpecification + A specification detailing how the conversation should be simulated + + extra_evaluation_criteria : typing.Optional[typing.Sequence[PromptEvaluationCriteria]] + A list of evaluation criteria to test + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AgentSimulatedChatTestResponseModel + Successful Response + + Examples + -------- + import asyncio + + from elevenlabs import ( + AgentConfigDbModel, + AsyncElevenLabs, + ConversationSimulationSpecification, + ) + + client = AsyncElevenLabs( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.conversational_ai.agents.simulate_conversation( + agent_id="21m00Tcm4TlvDq8ikWAM", + simulation_specification=ConversationSimulationSpecification( + simulated_user_config=AgentConfigDbModel( + first_message="Hello, how can I help you today?", + language="en", + ), + ), + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"v1/convai/agents/{jsonable_encoder(agent_id)}/simulate-conversation", + base_url=self._client_wrapper.get_environment().base, + method="POST", + json={ + "simulation_specification": convert_and_respect_annotation_metadata( + object_=simulation_specification, + annotation=ConversationSimulationSpecification, + direction="write", + ), + "extra_evaluation_criteria": convert_and_respect_annotation_metadata( + object_=extra_evaluation_criteria, + annotation=typing.Sequence[PromptEvaluationCriteria], + direction="write", + ), + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + AgentSimulatedChatTestResponseModel, + construct_type( + type_=AgentSimulatedChatTestResponseModel, # type: ignore + object_=_response.json(), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + typing.cast( + HttpValidationError, + construct_type( + type_=HttpValidationError, # type: ignore + object_=_response.json(), + ), + ) + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def simulate_conversation_stream( + self, + agent_id: str, + *, + simulation_specification: ConversationSimulationSpecification, + extra_evaluation_criteria: typing.Optional[typing.Sequence[PromptEvaluationCriteria]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> None: + """ + Run a conversation between the agent and a simulated user and stream back the response. Response is streamed back as partial lists of messages that should be concatenated and once the conversation has complete a single final message with the conversation analysis will be sent. + + Parameters + ---------- + agent_id : str + The id of an agent. This is returned on agent creation. + + simulation_specification : ConversationSimulationSpecification + A specification detailing how the conversation should be simulated + + extra_evaluation_criteria : typing.Optional[typing.Sequence[PromptEvaluationCriteria]] + A list of evaluation criteria to test + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + None + + Examples + -------- + import asyncio + + from elevenlabs import ( + AgentConfigDbModel, + AsyncElevenLabs, + ConversationSimulationSpecification, + ) + + client = AsyncElevenLabs( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.conversational_ai.agents.simulate_conversation_stream( + agent_id="21m00Tcm4TlvDq8ikWAM", + simulation_specification=ConversationSimulationSpecification( + simulated_user_config=AgentConfigDbModel( + first_message="Hello, how can I help you today?", + language="en", + ), + ), + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"v1/convai/agents/{jsonable_encoder(agent_id)}/simulate-conversation/stream", + base_url=self._client_wrapper.get_environment().base, + method="POST", + json={ + "simulation_specification": convert_and_respect_annotation_metadata( + object_=simulation_specification, + annotation=ConversationSimulationSpecification, + direction="write", + ), + "extra_evaluation_criteria": convert_and_respect_annotation_metadata( + object_=extra_evaluation_criteria, + annotation=typing.Sequence[PromptEvaluationCriteria], + direction="write", + ), + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return + if _response.status_code == 422: + raise UnprocessableEntityError( + typing.cast( + HttpValidationError, + construct_type( + type_=HttpValidationError, # type: ignore + object_=_response.json(), + ), + ) + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/elevenlabs/conversational_ai/client.py b/src/elevenlabs/conversational_ai/client.py index e299cb6e..6ff1508c 100644 --- a/src/elevenlabs/conversational_ai/client.py +++ b/src/elevenlabs/conversational_ai/client.py @@ -2,6 +2,9 @@ import typing from ..core.client_wrapper import SyncClientWrapper +from .agents.client import AgentsClient +from .sip_trunk.client import SipTrunkClient +from .knowledge_base.client import KnowledgeBaseClient from ..core.request_options import RequestOptions from ..types.conversation_signed_url_response_model import ( ConversationSignedUrlResponseModel, @@ -38,17 +41,26 @@ ConversationalAiCreatePhoneNumberRequestBody, ) from ..types.create_phone_number_response_model import CreatePhoneNumberResponseModel -from ..types.get_phone_number_response_model import GetPhoneNumberResponseModel +from .types.conversational_ai_get_phone_number_response import ( + ConversationalAiGetPhoneNumberResponse, +) +from .types.conversational_ai_update_phone_number_response import ( + ConversationalAiUpdatePhoneNumberResponse, +) +from .types.conversational_ai_get_phone_numbers_response_item import ( + ConversationalAiGetPhoneNumbersResponseItem, +) from ..types.knowledge_base_document_type import KnowledgeBaseDocumentType from ..types.get_knowledge_base_list_response_model import ( GetKnowledgeBaseListResponseModel, ) from ..types.add_knowledge_base_response_model import AddKnowledgeBaseResponseModel -from ..types.embedding_model_enum import EmbeddingModelEnum -from ..types.rag_index_response_model import RagIndexResponseModel from .types.conversational_ai_get_knowledge_base_document_by_id_response import ( ConversationalAiGetKnowledgeBaseDocumentByIdResponse, ) +from .types.conversational_ai_update_knowledge_base_document_response import ( + ConversationalAiUpdateKnowledgeBaseDocumentResponse, +) from ..types.get_knowledge_base_dependent_agents_response_model import ( GetKnowledgeBaseDependentAgentsResponseModel, ) @@ -72,7 +84,11 @@ from ..types.post_workspace_secret_response_model import ( PostWorkspaceSecretResponseModel, ) +from ..types.batch_call_detailed_response import BatchCallDetailedResponse from ..core.client_wrapper import AsyncClientWrapper +from .agents.client import AsyncAgentsClient +from .sip_trunk.client import AsyncSipTrunkClient +from .knowledge_base.client import AsyncKnowledgeBaseClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -81,6 +97,9 @@ class ConversationalAiClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper + self.agents = AgentsClient(client_wrapper=self._client_wrapper) + self.sip_trunk = SipTrunkClient(client_wrapper=self._client_wrapper) + self.knowledge_base = KnowledgeBaseClient(client_wrapper=self._client_wrapper) def get_signed_url( self, *, agent_id: str, request_options: typing.Optional[RequestOptions] = None @@ -113,7 +132,7 @@ def get_signed_url( ) """ _response = self._client_wrapper.httpx_client.request( - "v1/convai/conversation/get_signed_url", + "v1/convai/conversation/get-signed-url", base_url=self._client_wrapper.get_environment().base, method="GET", params={ @@ -189,7 +208,7 @@ def twilio_outbound_call( ) """ _response = self._client_wrapper.httpx_client.request( - "v1/convai/twilio/outbound_call", + "v1/convai/twilio/outbound-call", base_url=self._client_wrapper.get_environment().base, method="POST", json={ @@ -238,7 +257,7 @@ def create_agent( conversation_config: ConversationalConfig, platform_settings: typing.Optional[AgentPlatformSettingsRequestModel] = OMIT, name: typing.Optional[str] = OMIT, - categories: typing.Optional[typing.Sequence[str]] = OMIT, + tags: typing.Optional[typing.Sequence[str]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> CreateAgentResponseModel: """ @@ -255,8 +274,8 @@ def create_agent( name : typing.Optional[str] A name to make the agent easier to find - categories : typing.Optional[typing.Sequence[str]] - Categories to help classify and filter the agent + tags : typing.Optional[typing.Sequence[str]] + Tags to help classify and filter the agent request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -293,7 +312,7 @@ def create_agent( direction="write", ), "name": name, - "categories": categories, + "tags": tags, }, headers={ "content-type": "application/json", @@ -443,7 +462,7 @@ def update_agent( conversation_config: typing.Optional[typing.Optional[typing.Any]] = OMIT, platform_settings: typing.Optional[typing.Optional[typing.Any]] = OMIT, name: typing.Optional[str] = OMIT, - categories: typing.Optional[typing.Sequence[str]] = OMIT, + tags: typing.Optional[typing.Sequence[str]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> GetAgentResponseModel: """ @@ -461,8 +480,8 @@ def update_agent( name : typing.Optional[str] A name to make the agent easier to find - categories : typing.Optional[typing.Sequence[str]] - Categories to help classify and filter the agent + tags : typing.Optional[typing.Sequence[str]] + Tags to help classify and filter the agent request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -491,7 +510,7 @@ def update_agent( "conversation_config": conversation_config, "platform_settings": platform_settings, "name": name, - "categories": categories, + "tags": tags, }, headers={ "content-type": "application/json", @@ -539,7 +558,7 @@ def get_agent_widget( The id of an agent. This is returned on agent creation. conversation_signature : typing.Optional[str] - An expiring token that enables a conversation to start. These can be generated for an agent using the /v1/convai/conversation/get_signed_url endpoint + An expiring token that enables a websocket conversation to start. These can be generated for an agent using the /v1/convai/conversation/get-signed-url endpoint request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -1162,13 +1181,16 @@ def create_phone_number( Examples -------- - from elevenlabs import CreateTwilioPhoneNumberRequest, ElevenLabs + from elevenlabs import ElevenLabs + from elevenlabs.conversational_ai import ( + ConversationalAiCreatePhoneNumberRequestBody_Twilio, + ) client = ElevenLabs( api_key="YOUR_API_KEY", ) client.conversational_ai.create_phone_number( - request=CreateTwilioPhoneNumberRequest( + request=ConversationalAiCreatePhoneNumberRequestBody_Twilio( phone_number="phone_number", label="label", sid="sid", @@ -1217,7 +1239,7 @@ def get_phone_number( phone_number_id: str, *, request_options: typing.Optional[RequestOptions] = None, - ) -> GetPhoneNumberResponseModel: + ) -> ConversationalAiGetPhoneNumberResponse: """ Retrieve Phone Number details by ID @@ -1231,7 +1253,7 @@ def get_phone_number( Returns ------- - GetPhoneNumberResponseModel + ConversationalAiGetPhoneNumberResponse Successful Response Examples @@ -1254,9 +1276,9 @@ def get_phone_number( try: if 200 <= _response.status_code < 300: return typing.cast( - GetPhoneNumberResponseModel, + ConversationalAiGetPhoneNumberResponse, construct_type( - type_=GetPhoneNumberResponseModel, # type: ignore + type_=ConversationalAiGetPhoneNumberResponse, # type: ignore object_=_response.json(), ), ) @@ -1344,7 +1366,7 @@ def update_phone_number( *, agent_id: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> GetPhoneNumberResponseModel: + ) -> ConversationalAiUpdatePhoneNumberResponse: """ Update Phone Number details by ID @@ -1360,7 +1382,7 @@ def update_phone_number( Returns ------- - GetPhoneNumberResponseModel + ConversationalAiUpdatePhoneNumberResponse Successful Response Examples @@ -1390,9 +1412,9 @@ def update_phone_number( try: if 200 <= _response.status_code < 300: return typing.cast( - GetPhoneNumberResponseModel, + ConversationalAiUpdatePhoneNumberResponse, construct_type( - type_=GetPhoneNumberResponseModel, # type: ignore + type_=ConversationalAiUpdatePhoneNumberResponse, # type: ignore object_=_response.json(), ), ) @@ -1413,7 +1435,7 @@ def update_phone_number( def get_phone_numbers( self, *, request_options: typing.Optional[RequestOptions] = None - ) -> typing.List[GetPhoneNumberResponseModel]: + ) -> typing.List[ConversationalAiGetPhoneNumbersResponseItem]: """ Retrieve all Phone Numbers @@ -1424,7 +1446,7 @@ def get_phone_numbers( Returns ------- - typing.List[GetPhoneNumberResponseModel] + typing.List[ConversationalAiGetPhoneNumbersResponseItem] Successful Response Examples @@ -1445,9 +1467,9 @@ def get_phone_numbers( try: if 200 <= _response.status_code < 300: return typing.cast( - typing.List[GetPhoneNumberResponseModel], + typing.List[ConversationalAiGetPhoneNumbersResponseItem], construct_type( - type_=typing.List[GetPhoneNumberResponseModel], # type: ignore + type_=typing.List[ConversationalAiGetPhoneNumbersResponseItem], # type: ignore object_=_response.json(), ), ) @@ -1856,29 +1878,26 @@ def create_knowledge_base_text_document( raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def rag_index_status( + def get_knowledge_base_document_by_id( self, documentation_id: str, *, - model: EmbeddingModelEnum, request_options: typing.Optional[RequestOptions] = None, - ) -> RagIndexResponseModel: + ) -> ConversationalAiGetKnowledgeBaseDocumentByIdResponse: """ - In case the document is not RAG indexed, it triggers rag indexing task, otherwise it just returns the current status. + Get details about a specific documentation making up the agent's knowledge base Parameters ---------- documentation_id : str The id of a document from the knowledge base. This is returned on document addition. - model : EmbeddingModelEnum - request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - RagIndexResponseModel + ConversationalAiGetKnowledgeBaseDocumentByIdResponse Successful Response Examples @@ -1888,30 +1907,22 @@ def rag_index_status( client = ElevenLabs( api_key="YOUR_API_KEY", ) - client.conversational_ai.rag_index_status( + client.conversational_ai.get_knowledge_base_document_by_id( documentation_id="21m00Tcm4TlvDq8ikWAM", - model="e5_mistral_7b_instruct", ) """ _response = self._client_wrapper.httpx_client.request( - f"v1/convai/knowledge-base/{jsonable_encoder(documentation_id)}/rag-index", + f"v1/convai/knowledge-base/{jsonable_encoder(documentation_id)}", base_url=self._client_wrapper.get_environment().base, - method="POST", - json={ - "model": model, - }, - headers={ - "content-type": "application/json", - }, + method="GET", request_options=request_options, - omit=OMIT, ) try: if 200 <= _response.status_code < 300: return typing.cast( - RagIndexResponseModel, + ConversationalAiGetKnowledgeBaseDocumentByIdResponse, construct_type( - type_=RagIndexResponseModel, # type: ignore + type_=ConversationalAiGetKnowledgeBaseDocumentByIdResponse, # type: ignore object_=_response.json(), ), ) @@ -1930,14 +1941,14 @@ def rag_index_status( raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def get_knowledge_base_document_by_id( + def delete_knowledge_base_document( self, documentation_id: str, *, request_options: typing.Optional[RequestOptions] = None, - ) -> ConversationalAiGetKnowledgeBaseDocumentByIdResponse: + ) -> typing.Optional[typing.Any]: """ - Get details about a specific documentation making up the agent's knowledge base + Delete a document from the knowledge base Parameters ---------- @@ -1949,7 +1960,7 @@ def get_knowledge_base_document_by_id( Returns ------- - ConversationalAiGetKnowledgeBaseDocumentByIdResponse + typing.Optional[typing.Any] Successful Response Examples @@ -1959,22 +1970,22 @@ def get_knowledge_base_document_by_id( client = ElevenLabs( api_key="YOUR_API_KEY", ) - client.conversational_ai.get_knowledge_base_document_by_id( + client.conversational_ai.delete_knowledge_base_document( documentation_id="21m00Tcm4TlvDq8ikWAM", ) """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/knowledge-base/{jsonable_encoder(documentation_id)}", base_url=self._client_wrapper.get_environment().base, - method="GET", + method="DELETE", request_options=request_options, ) try: if 200 <= _response.status_code < 300: return typing.cast( - ConversationalAiGetKnowledgeBaseDocumentByIdResponse, + typing.Optional[typing.Any], construct_type( - type_=ConversationalAiGetKnowledgeBaseDocumentByIdResponse, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ) @@ -1993,26 +2004,30 @@ def get_knowledge_base_document_by_id( raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def delete_knowledge_base_document( + def update_knowledge_base_document( self, documentation_id: str, *, + name: str, request_options: typing.Optional[RequestOptions] = None, - ) -> typing.Optional[typing.Any]: + ) -> ConversationalAiUpdateKnowledgeBaseDocumentResponse: """ - Delete a document from the knowledge base + Update the name of a document Parameters ---------- documentation_id : str The id of a document from the knowledge base. This is returned on document addition. + name : str + A custom, human-readable name for the document. + request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - typing.Optional[typing.Any] + ConversationalAiUpdateKnowledgeBaseDocumentResponse Successful Response Examples @@ -2022,22 +2037,30 @@ def delete_knowledge_base_document( client = ElevenLabs( api_key="YOUR_API_KEY", ) - client.conversational_ai.delete_knowledge_base_document( + client.conversational_ai.update_knowledge_base_document( documentation_id="21m00Tcm4TlvDq8ikWAM", + name="name", ) """ _response = self._client_wrapper.httpx_client.request( f"v1/convai/knowledge-base/{jsonable_encoder(documentation_id)}", base_url=self._client_wrapper.get_environment().base, - method="DELETE", + method="PATCH", + json={ + "name": name, + }, + headers={ + "content-type": "application/json", + }, request_options=request_options, + omit=OMIT, ) try: if 200 <= _response.status_code < 300: return typing.cast( - typing.Optional[typing.Any], + ConversationalAiUpdateKnowledgeBaseDocumentResponse, construct_type( - type_=typing.Optional[typing.Any], # type: ignore + type_=ConversationalAiUpdateKnowledgeBaseDocumentResponse, # type: ignore object_=_response.json(), ), ) @@ -2315,6 +2338,7 @@ def update_settings( *, conversation_initiation_client_data_webhook: typing.Optional[ConversationInitiationClientDataWebhook] = OMIT, webhooks: typing.Optional[ConvAiWebhooks] = OMIT, + rag_retention_period_days: typing.Optional[int] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> GetConvAiSettingsResponseModel: """ @@ -2326,6 +2350,8 @@ def update_settings( webhooks : typing.Optional[ConvAiWebhooks] + rag_retention_period_days : typing.Optional[int] + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -2356,6 +2382,7 @@ def update_settings( "webhooks": convert_and_respect_annotation_metadata( object_=webhooks, annotation=ConvAiWebhooks, direction="write" ), + "rag_retention_period_days": rag_retention_period_days, }, headers={ "content-type": "application/json", @@ -2693,10 +2720,72 @@ def delete_secret(self, secret_id: str, *, request_options: typing.Optional[Requ raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) + def get_batch_call( + self, batch_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> BatchCallDetailedResponse: + """ + Get detailed information about a batch call including all recipients. + + Parameters + ---------- + batch_id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + BatchCallDetailedResponse + Successful Response + + Examples + -------- + from elevenlabs import ElevenLabs + + client = ElevenLabs( + api_key="YOUR_API_KEY", + ) + client.conversational_ai.get_batch_call( + batch_id="batch_id", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"v1/convai/batch-calling/{jsonable_encoder(batch_id)}", + base_url=self._client_wrapper.get_environment().base, + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + BatchCallDetailedResponse, + construct_type( + type_=BatchCallDetailedResponse, # type: ignore + object_=_response.json(), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + typing.cast( + HttpValidationError, + construct_type( + type_=HttpValidationError, # type: ignore + object_=_response.json(), + ), + ) + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + class AsyncConversationalAiClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper + self.agents = AsyncAgentsClient(client_wrapper=self._client_wrapper) + self.sip_trunk = AsyncSipTrunkClient(client_wrapper=self._client_wrapper) + self.knowledge_base = AsyncKnowledgeBaseClient(client_wrapper=self._client_wrapper) async def get_signed_url( self, *, agent_id: str, request_options: typing.Optional[RequestOptions] = None @@ -2737,7 +2826,7 @@ async def main() -> None: asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - "v1/convai/conversation/get_signed_url", + "v1/convai/conversation/get-signed-url", base_url=self._client_wrapper.get_environment().base, method="GET", params={ @@ -2821,7 +2910,7 @@ async def main() -> None: asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - "v1/convai/twilio/outbound_call", + "v1/convai/twilio/outbound-call", base_url=self._client_wrapper.get_environment().base, method="POST", json={ @@ -2870,7 +2959,7 @@ async def create_agent( conversation_config: ConversationalConfig, platform_settings: typing.Optional[AgentPlatformSettingsRequestModel] = OMIT, name: typing.Optional[str] = OMIT, - categories: typing.Optional[typing.Sequence[str]] = OMIT, + tags: typing.Optional[typing.Sequence[str]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> CreateAgentResponseModel: """ @@ -2887,8 +2976,8 @@ async def create_agent( name : typing.Optional[str] A name to make the agent easier to find - categories : typing.Optional[typing.Sequence[str]] - Categories to help classify and filter the agent + tags : typing.Optional[typing.Sequence[str]] + Tags to help classify and filter the agent request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -2933,7 +3022,7 @@ async def main() -> None: direction="write", ), "name": name, - "categories": categories, + "tags": tags, }, headers={ "content-type": "application/json", @@ -3099,7 +3188,7 @@ async def update_agent( conversation_config: typing.Optional[typing.Optional[typing.Any]] = OMIT, platform_settings: typing.Optional[typing.Optional[typing.Any]] = OMIT, name: typing.Optional[str] = OMIT, - categories: typing.Optional[typing.Sequence[str]] = OMIT, + tags: typing.Optional[typing.Sequence[str]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> GetAgentResponseModel: """ @@ -3117,8 +3206,8 @@ async def update_agent( name : typing.Optional[str] A name to make the agent easier to find - categories : typing.Optional[typing.Sequence[str]] - Categories to help classify and filter the agent + tags : typing.Optional[typing.Sequence[str]] + Tags to help classify and filter the agent request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -3155,7 +3244,7 @@ async def main() -> None: "conversation_config": conversation_config, "platform_settings": platform_settings, "name": name, - "categories": categories, + "tags": tags, }, headers={ "content-type": "application/json", @@ -3203,7 +3292,7 @@ async def get_agent_widget( The id of an agent. This is returned on agent creation. conversation_signature : typing.Optional[str] - An expiring token that enables a conversation to start. These can be generated for an agent using the /v1/convai/conversation/get_signed_url endpoint + An expiring token that enables a websocket conversation to start. These can be generated for an agent using the /v1/convai/conversation/get-signed-url endpoint request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -3892,7 +3981,10 @@ async def create_phone_number( -------- import asyncio - from elevenlabs import AsyncElevenLabs, CreateTwilioPhoneNumberRequest + from elevenlabs import AsyncElevenLabs + from elevenlabs.conversational_ai import ( + ConversationalAiCreatePhoneNumberRequestBody_Twilio, + ) client = AsyncElevenLabs( api_key="YOUR_API_KEY", @@ -3901,7 +3993,7 @@ async def create_phone_number( async def main() -> None: await client.conversational_ai.create_phone_number( - request=CreateTwilioPhoneNumberRequest( + request=ConversationalAiCreatePhoneNumberRequestBody_Twilio( phone_number="phone_number", label="label", sid="sid", @@ -3953,7 +4045,7 @@ async def get_phone_number( phone_number_id: str, *, request_options: typing.Optional[RequestOptions] = None, - ) -> GetPhoneNumberResponseModel: + ) -> ConversationalAiGetPhoneNumberResponse: """ Retrieve Phone Number details by ID @@ -3967,7 +4059,7 @@ async def get_phone_number( Returns ------- - GetPhoneNumberResponseModel + ConversationalAiGetPhoneNumberResponse Successful Response Examples @@ -3998,9 +4090,9 @@ async def main() -> None: try: if 200 <= _response.status_code < 300: return typing.cast( - GetPhoneNumberResponseModel, + ConversationalAiGetPhoneNumberResponse, construct_type( - type_=GetPhoneNumberResponseModel, # type: ignore + type_=ConversationalAiGetPhoneNumberResponse, # type: ignore object_=_response.json(), ), ) @@ -4096,7 +4188,7 @@ async def update_phone_number( *, agent_id: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> GetPhoneNumberResponseModel: + ) -> ConversationalAiUpdatePhoneNumberResponse: """ Update Phone Number details by ID @@ -4112,7 +4204,7 @@ async def update_phone_number( Returns ------- - GetPhoneNumberResponseModel + ConversationalAiUpdatePhoneNumberResponse Successful Response Examples @@ -4150,9 +4242,9 @@ async def main() -> None: try: if 200 <= _response.status_code < 300: return typing.cast( - GetPhoneNumberResponseModel, + ConversationalAiUpdatePhoneNumberResponse, construct_type( - type_=GetPhoneNumberResponseModel, # type: ignore + type_=ConversationalAiUpdatePhoneNumberResponse, # type: ignore object_=_response.json(), ), ) @@ -4173,7 +4265,7 @@ async def main() -> None: async def get_phone_numbers( self, *, request_options: typing.Optional[RequestOptions] = None - ) -> typing.List[GetPhoneNumberResponseModel]: + ) -> typing.List[ConversationalAiGetPhoneNumbersResponseItem]: """ Retrieve all Phone Numbers @@ -4184,7 +4276,7 @@ async def get_phone_numbers( Returns ------- - typing.List[GetPhoneNumberResponseModel] + typing.List[ConversationalAiGetPhoneNumbersResponseItem] Successful Response Examples @@ -4213,9 +4305,9 @@ async def main() -> None: try: if 200 <= _response.status_code < 300: return typing.cast( - typing.List[GetPhoneNumberResponseModel], + typing.List[ConversationalAiGetPhoneNumbersResponseItem], construct_type( - type_=typing.List[GetPhoneNumberResponseModel], # type: ignore + type_=typing.List[ConversationalAiGetPhoneNumbersResponseItem], # type: ignore object_=_response.json(), ), ) @@ -4664,29 +4756,26 @@ async def main() -> None: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def rag_index_status( + async def get_knowledge_base_document_by_id( self, documentation_id: str, *, - model: EmbeddingModelEnum, request_options: typing.Optional[RequestOptions] = None, - ) -> RagIndexResponseModel: + ) -> ConversationalAiGetKnowledgeBaseDocumentByIdResponse: """ - In case the document is not RAG indexed, it triggers rag indexing task, otherwise it just returns the current status. + Get details about a specific documentation making up the agent's knowledge base Parameters ---------- documentation_id : str The id of a document from the knowledge base. This is returned on document addition. - model : EmbeddingModelEnum - request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - RagIndexResponseModel + ConversationalAiGetKnowledgeBaseDocumentByIdResponse Successful Response Examples @@ -4701,33 +4790,25 @@ async def rag_index_status( async def main() -> None: - await client.conversational_ai.rag_index_status( + await client.conversational_ai.get_knowledge_base_document_by_id( documentation_id="21m00Tcm4TlvDq8ikWAM", - model="e5_mistral_7b_instruct", ) asyncio.run(main()) """ _response = await self._client_wrapper.httpx_client.request( - f"v1/convai/knowledge-base/{jsonable_encoder(documentation_id)}/rag-index", + f"v1/convai/knowledge-base/{jsonable_encoder(documentation_id)}", base_url=self._client_wrapper.get_environment().base, - method="POST", - json={ - "model": model, - }, - headers={ - "content-type": "application/json", - }, + method="GET", request_options=request_options, - omit=OMIT, ) try: if 200 <= _response.status_code < 300: return typing.cast( - RagIndexResponseModel, + ConversationalAiGetKnowledgeBaseDocumentByIdResponse, construct_type( - type_=RagIndexResponseModel, # type: ignore + type_=ConversationalAiGetKnowledgeBaseDocumentByIdResponse, # type: ignore object_=_response.json(), ), ) @@ -4746,14 +4827,14 @@ async def main() -> None: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def get_knowledge_base_document_by_id( + async def delete_knowledge_base_document( self, documentation_id: str, *, request_options: typing.Optional[RequestOptions] = None, - ) -> ConversationalAiGetKnowledgeBaseDocumentByIdResponse: + ) -> typing.Optional[typing.Any]: """ - Get details about a specific documentation making up the agent's knowledge base + Delete a document from the knowledge base Parameters ---------- @@ -4765,7 +4846,7 @@ async def get_knowledge_base_document_by_id( Returns ------- - ConversationalAiGetKnowledgeBaseDocumentByIdResponse + typing.Optional[typing.Any] Successful Response Examples @@ -4780,7 +4861,7 @@ async def get_knowledge_base_document_by_id( async def main() -> None: - await client.conversational_ai.get_knowledge_base_document_by_id( + await client.conversational_ai.delete_knowledge_base_document( documentation_id="21m00Tcm4TlvDq8ikWAM", ) @@ -4790,15 +4871,15 @@ async def main() -> None: _response = await self._client_wrapper.httpx_client.request( f"v1/convai/knowledge-base/{jsonable_encoder(documentation_id)}", base_url=self._client_wrapper.get_environment().base, - method="GET", + method="DELETE", request_options=request_options, ) try: if 200 <= _response.status_code < 300: return typing.cast( - ConversationalAiGetKnowledgeBaseDocumentByIdResponse, + typing.Optional[typing.Any], construct_type( - type_=ConversationalAiGetKnowledgeBaseDocumentByIdResponse, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ) @@ -4817,26 +4898,30 @@ async def main() -> None: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def delete_knowledge_base_document( + async def update_knowledge_base_document( self, documentation_id: str, *, + name: str, request_options: typing.Optional[RequestOptions] = None, - ) -> typing.Optional[typing.Any]: + ) -> ConversationalAiUpdateKnowledgeBaseDocumentResponse: """ - Delete a document from the knowledge base + Update the name of a document Parameters ---------- documentation_id : str The id of a document from the knowledge base. This is returned on document addition. + name : str + A custom, human-readable name for the document. + request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - typing.Optional[typing.Any] + ConversationalAiUpdateKnowledgeBaseDocumentResponse Successful Response Examples @@ -4851,8 +4936,9 @@ async def delete_knowledge_base_document( async def main() -> None: - await client.conversational_ai.delete_knowledge_base_document( + await client.conversational_ai.update_knowledge_base_document( documentation_id="21m00Tcm4TlvDq8ikWAM", + name="name", ) @@ -4861,15 +4947,22 @@ async def main() -> None: _response = await self._client_wrapper.httpx_client.request( f"v1/convai/knowledge-base/{jsonable_encoder(documentation_id)}", base_url=self._client_wrapper.get_environment().base, - method="DELETE", + method="PATCH", + json={ + "name": name, + }, + headers={ + "content-type": "application/json", + }, request_options=request_options, + omit=OMIT, ) try: if 200 <= _response.status_code < 300: return typing.cast( - typing.Optional[typing.Any], + ConversationalAiUpdateKnowledgeBaseDocumentResponse, construct_type( - type_=typing.Optional[typing.Any], # type: ignore + type_=ConversationalAiUpdateKnowledgeBaseDocumentResponse, # type: ignore object_=_response.json(), ), ) @@ -5179,6 +5272,7 @@ async def update_settings( *, conversation_initiation_client_data_webhook: typing.Optional[ConversationInitiationClientDataWebhook] = OMIT, webhooks: typing.Optional[ConvAiWebhooks] = OMIT, + rag_retention_period_days: typing.Optional[int] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> GetConvAiSettingsResponseModel: """ @@ -5190,6 +5284,8 @@ async def update_settings( webhooks : typing.Optional[ConvAiWebhooks] + rag_retention_period_days : typing.Optional[int] + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -5228,6 +5324,7 @@ async def main() -> None: "webhooks": convert_and_respect_annotation_metadata( object_=webhooks, annotation=ConvAiWebhooks, direction="write" ), + "rag_retention_period_days": rag_retention_period_days, }, headers={ "content-type": "application/json", @@ -5604,3 +5701,70 @@ async def main() -> None: except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) + + async def get_batch_call( + self, batch_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> BatchCallDetailedResponse: + """ + Get detailed information about a batch call including all recipients. + + Parameters + ---------- + batch_id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + BatchCallDetailedResponse + Successful Response + + Examples + -------- + import asyncio + + from elevenlabs import AsyncElevenLabs + + client = AsyncElevenLabs( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.conversational_ai.get_batch_call( + batch_id="batch_id", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"v1/convai/batch-calling/{jsonable_encoder(batch_id)}", + base_url=self._client_wrapper.get_environment().base, + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + BatchCallDetailedResponse, + construct_type( + type_=BatchCallDetailedResponse, # type: ignore + object_=_response.json(), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + typing.cast( + HttpValidationError, + construct_type( + type_=HttpValidationError, # type: ignore + object_=_response.json(), + ), + ) + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/elevenlabs/conversational_ai/knowledge_base/__init__.py b/src/elevenlabs/conversational_ai/knowledge_base/__init__.py new file mode 100644 index 00000000..0136afe9 --- /dev/null +++ b/src/elevenlabs/conversational_ai/knowledge_base/__init__.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from . import document + +__all__ = ["document"] diff --git a/src/elevenlabs/conversational_ai/knowledge_base/client.py b/src/elevenlabs/conversational_ai/knowledge_base/client.py new file mode 100644 index 00000000..391d7cc8 --- /dev/null +++ b/src/elevenlabs/conversational_ai/knowledge_base/client.py @@ -0,0 +1,18 @@ +# This file was auto-generated by Fern from our API Definition. + +from ...core.client_wrapper import SyncClientWrapper +from .document.client import DocumentClient +from ...core.client_wrapper import AsyncClientWrapper +from .document.client import AsyncDocumentClient + + +class KnowledgeBaseClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + self.document = DocumentClient(client_wrapper=self._client_wrapper) + + +class AsyncKnowledgeBaseClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + self.document = AsyncDocumentClient(client_wrapper=self._client_wrapper) diff --git a/src/elevenlabs/conversational_ai/knowledge_base/document/__init__.py b/src/elevenlabs/conversational_ai/knowledge_base/document/__init__.py new file mode 100644 index 00000000..f3ea2659 --- /dev/null +++ b/src/elevenlabs/conversational_ai/knowledge_base/document/__init__.py @@ -0,0 +1,2 @@ +# This file was auto-generated by Fern from our API Definition. + diff --git a/src/elevenlabs/conversational_ai/knowledge_base/document/client.py b/src/elevenlabs/conversational_ai/knowledge_base/document/client.py new file mode 100644 index 00000000..2dc35a44 --- /dev/null +++ b/src/elevenlabs/conversational_ai/knowledge_base/document/client.py @@ -0,0 +1,183 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from ....core.client_wrapper import SyncClientWrapper +from ....types.embedding_model_enum import EmbeddingModelEnum +from ....core.request_options import RequestOptions +from ....types.rag_index_response_model import RagIndexResponseModel +from ....core.jsonable_encoder import jsonable_encoder +from ....core.unchecked_base_model import construct_type +from ....errors.unprocessable_entity_error import UnprocessableEntityError +from ....types.http_validation_error import HttpValidationError +from json.decoder import JSONDecodeError +from ....core.api_error import ApiError +from ....core.client_wrapper import AsyncClientWrapper + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class DocumentClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def compute_rag_index( + self, + documentation_id: str, + *, + model: EmbeddingModelEnum, + request_options: typing.Optional[RequestOptions] = None, + ) -> RagIndexResponseModel: + """ + In case the document is not RAG indexed, it triggers rag indexing task, otherwise it just returns the current status. + + Parameters + ---------- + documentation_id : str + The id of a document from the knowledge base. This is returned on document addition. + + model : EmbeddingModelEnum + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + RagIndexResponseModel + Successful Response + + Examples + -------- + from elevenlabs import ElevenLabs + + client = ElevenLabs( + api_key="YOUR_API_KEY", + ) + client.conversational_ai.knowledge_base.document.compute_rag_index( + documentation_id="21m00Tcm4TlvDq8ikWAM", + model="e5_mistral_7b_instruct", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"v1/convai/knowledge-base/{jsonable_encoder(documentation_id)}/rag-index", + base_url=self._client_wrapper.get_environment().base, + method="POST", + json={ + "model": model, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + RagIndexResponseModel, + construct_type( + type_=RagIndexResponseModel, # type: ignore + object_=_response.json(), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + typing.cast( + HttpValidationError, + construct_type( + type_=HttpValidationError, # type: ignore + object_=_response.json(), + ), + ) + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + +class AsyncDocumentClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def compute_rag_index( + self, + documentation_id: str, + *, + model: EmbeddingModelEnum, + request_options: typing.Optional[RequestOptions] = None, + ) -> RagIndexResponseModel: + """ + In case the document is not RAG indexed, it triggers rag indexing task, otherwise it just returns the current status. + + Parameters + ---------- + documentation_id : str + The id of a document from the knowledge base. This is returned on document addition. + + model : EmbeddingModelEnum + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + RagIndexResponseModel + Successful Response + + Examples + -------- + import asyncio + + from elevenlabs import AsyncElevenLabs + + client = AsyncElevenLabs( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.conversational_ai.knowledge_base.document.compute_rag_index( + documentation_id="21m00Tcm4TlvDq8ikWAM", + model="e5_mistral_7b_instruct", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"v1/convai/knowledge-base/{jsonable_encoder(documentation_id)}/rag-index", + base_url=self._client_wrapper.get_environment().base, + method="POST", + json={ + "model": model, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + RagIndexResponseModel, + construct_type( + type_=RagIndexResponseModel, # type: ignore + object_=_response.json(), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + typing.cast( + HttpValidationError, + construct_type( + type_=HttpValidationError, # type: ignore + object_=_response.json(), + ), + ) + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/elevenlabs/conversational_ai/sip_trunk/__init__.py b/src/elevenlabs/conversational_ai/sip_trunk/__init__.py new file mode 100644 index 00000000..f3ea2659 --- /dev/null +++ b/src/elevenlabs/conversational_ai/sip_trunk/__init__.py @@ -0,0 +1,2 @@ +# This file was auto-generated by Fern from our API Definition. + diff --git a/src/elevenlabs/conversational_ai/sip_trunk/client.py b/src/elevenlabs/conversational_ai/sip_trunk/client.py new file mode 100644 index 00000000..7d3172d2 --- /dev/null +++ b/src/elevenlabs/conversational_ai/sip_trunk/client.py @@ -0,0 +1,211 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from ...core.client_wrapper import SyncClientWrapper +from ...types.conversation_initiation_client_data_request_input import ( + ConversationInitiationClientDataRequestInput, +) +from ...core.request_options import RequestOptions +from ...types.sip_trunk_outbound_call_response import SipTrunkOutboundCallResponse +from ...core.serialization import convert_and_respect_annotation_metadata +from ...core.unchecked_base_model import construct_type +from ...errors.unprocessable_entity_error import UnprocessableEntityError +from ...types.http_validation_error import HttpValidationError +from json.decoder import JSONDecodeError +from ...core.api_error import ApiError +from ...core.client_wrapper import AsyncClientWrapper + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class SipTrunkClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def outbound_call( + self, + *, + agent_id: str, + agent_phone_number_id: str, + to_number: str, + conversation_initiation_client_data: typing.Optional[ConversationInitiationClientDataRequestInput] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> SipTrunkOutboundCallResponse: + """ + Handle an outbound call via SIP trunk + + Parameters + ---------- + agent_id : str + + agent_phone_number_id : str + + to_number : str + + conversation_initiation_client_data : typing.Optional[ConversationInitiationClientDataRequestInput] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SipTrunkOutboundCallResponse + Successful Response + + Examples + -------- + from elevenlabs import ElevenLabs + + client = ElevenLabs( + api_key="YOUR_API_KEY", + ) + client.conversational_ai.sip_trunk.outbound_call( + agent_id="agent_id", + agent_phone_number_id="agent_phone_number_id", + to_number="to_number", + ) + """ + _response = self._client_wrapper.httpx_client.request( + "v1/convai/sip-trunk/outbound-call", + base_url=self._client_wrapper.get_environment().base, + method="POST", + json={ + "agent_id": agent_id, + "agent_phone_number_id": agent_phone_number_id, + "to_number": to_number, + "conversation_initiation_client_data": convert_and_respect_annotation_metadata( + object_=conversation_initiation_client_data, + annotation=ConversationInitiationClientDataRequestInput, + direction="write", + ), + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + SipTrunkOutboundCallResponse, + construct_type( + type_=SipTrunkOutboundCallResponse, # type: ignore + object_=_response.json(), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + typing.cast( + HttpValidationError, + construct_type( + type_=HttpValidationError, # type: ignore + object_=_response.json(), + ), + ) + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + +class AsyncSipTrunkClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def outbound_call( + self, + *, + agent_id: str, + agent_phone_number_id: str, + to_number: str, + conversation_initiation_client_data: typing.Optional[ConversationInitiationClientDataRequestInput] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> SipTrunkOutboundCallResponse: + """ + Handle an outbound call via SIP trunk + + Parameters + ---------- + agent_id : str + + agent_phone_number_id : str + + to_number : str + + conversation_initiation_client_data : typing.Optional[ConversationInitiationClientDataRequestInput] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SipTrunkOutboundCallResponse + Successful Response + + Examples + -------- + import asyncio + + from elevenlabs import AsyncElevenLabs + + client = AsyncElevenLabs( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.conversational_ai.sip_trunk.outbound_call( + agent_id="agent_id", + agent_phone_number_id="agent_phone_number_id", + to_number="to_number", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + "v1/convai/sip-trunk/outbound-call", + base_url=self._client_wrapper.get_environment().base, + method="POST", + json={ + "agent_id": agent_id, + "agent_phone_number_id": agent_phone_number_id, + "to_number": to_number, + "conversation_initiation_client_data": convert_and_respect_annotation_metadata( + object_=conversation_initiation_client_data, + annotation=ConversationInitiationClientDataRequestInput, + direction="write", + ), + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + SipTrunkOutboundCallResponse, + construct_type( + type_=SipTrunkOutboundCallResponse, # type: ignore + object_=_response.json(), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + typing.cast( + HttpValidationError, + construct_type( + type_=HttpValidationError, # type: ignore + object_=_response.json(), + ), + ) + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/elevenlabs/conversational_ai/types/__init__.py b/src/elevenlabs/conversational_ai/types/__init__.py index 66b49f99..82e3bb60 100644 --- a/src/elevenlabs/conversational_ai/types/__init__.py +++ b/src/elevenlabs/conversational_ai/types/__init__.py @@ -1,25 +1,67 @@ # This file was auto-generated by Fern from our API Definition. -from .conversational_ai_create_phone_number_request_body import ConversationalAiCreatePhoneNumberRequestBody +from .conversational_ai_create_phone_number_request_body import ( + ConversationalAiCreatePhoneNumberRequestBody, + ConversationalAiCreatePhoneNumberRequestBody_SipTrunk, + ConversationalAiCreatePhoneNumberRequestBody_Twilio, +) from .conversational_ai_get_knowledge_base_document_by_id_response import ( ConversationalAiGetKnowledgeBaseDocumentByIdResponse, ConversationalAiGetKnowledgeBaseDocumentByIdResponse_File, ConversationalAiGetKnowledgeBaseDocumentByIdResponse_Text, ConversationalAiGetKnowledgeBaseDocumentByIdResponse_Url, ) +from .conversational_ai_get_phone_number_response import ( + ConversationalAiGetPhoneNumberResponse, + ConversationalAiGetPhoneNumberResponse_SipTrunk, + ConversationalAiGetPhoneNumberResponse_Twilio, +) +from .conversational_ai_get_phone_numbers_response_item import ( + ConversationalAiGetPhoneNumbersResponseItem, + ConversationalAiGetPhoneNumbersResponseItem_SipTrunk, + ConversationalAiGetPhoneNumbersResponseItem_Twilio, +) +from .conversational_ai_update_knowledge_base_document_response import ( + ConversationalAiUpdateKnowledgeBaseDocumentResponse, + ConversationalAiUpdateKnowledgeBaseDocumentResponse_File, + ConversationalAiUpdateKnowledgeBaseDocumentResponse_Text, + ConversationalAiUpdateKnowledgeBaseDocumentResponse_Url, +) +from .conversational_ai_update_phone_number_response import ( + ConversationalAiUpdatePhoneNumberResponse, + ConversationalAiUpdatePhoneNumberResponse_SipTrunk, + ConversationalAiUpdatePhoneNumberResponse_Twilio, +) from .patch_conv_ai_dashboard_settings_request_charts_item import ( PatchConvAiDashboardSettingsRequestChartsItem, PatchConvAiDashboardSettingsRequestChartsItem_CallSuccess, PatchConvAiDashboardSettingsRequestChartsItem_Criteria, + PatchConvAiDashboardSettingsRequestChartsItem_DataCollection, ) __all__ = [ "ConversationalAiCreatePhoneNumberRequestBody", + "ConversationalAiCreatePhoneNumberRequestBody_SipTrunk", + "ConversationalAiCreatePhoneNumberRequestBody_Twilio", "ConversationalAiGetKnowledgeBaseDocumentByIdResponse", "ConversationalAiGetKnowledgeBaseDocumentByIdResponse_File", "ConversationalAiGetKnowledgeBaseDocumentByIdResponse_Text", "ConversationalAiGetKnowledgeBaseDocumentByIdResponse_Url", + "ConversationalAiGetPhoneNumberResponse", + "ConversationalAiGetPhoneNumberResponse_SipTrunk", + "ConversationalAiGetPhoneNumberResponse_Twilio", + "ConversationalAiGetPhoneNumbersResponseItem", + "ConversationalAiGetPhoneNumbersResponseItem_SipTrunk", + "ConversationalAiGetPhoneNumbersResponseItem_Twilio", + "ConversationalAiUpdateKnowledgeBaseDocumentResponse", + "ConversationalAiUpdateKnowledgeBaseDocumentResponse_File", + "ConversationalAiUpdateKnowledgeBaseDocumentResponse_Text", + "ConversationalAiUpdateKnowledgeBaseDocumentResponse_Url", + "ConversationalAiUpdatePhoneNumberResponse", + "ConversationalAiUpdatePhoneNumberResponse_SipTrunk", + "ConversationalAiUpdatePhoneNumberResponse_Twilio", "PatchConvAiDashboardSettingsRequestChartsItem", "PatchConvAiDashboardSettingsRequestChartsItem_CallSuccess", "PatchConvAiDashboardSettingsRequestChartsItem_Criteria", + "PatchConvAiDashboardSettingsRequestChartsItem_DataCollection", ] diff --git a/src/elevenlabs/conversational_ai/types/conversational_ai_create_phone_number_request_body.py b/src/elevenlabs/conversational_ai/types/conversational_ai_create_phone_number_request_body.py index 68eecd01..55000873 100644 --- a/src/elevenlabs/conversational_ai/types/conversational_ai_create_phone_number_request_body.py +++ b/src/elevenlabs/conversational_ai/types/conversational_ai_create_phone_number_request_body.py @@ -1,11 +1,67 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations +from ...core.unchecked_base_model import UncheckedBaseModel import typing -from ...types.create_twilio_phone_number_request import CreateTwilioPhoneNumberRequest -from ...types.create_sip_trunk_phone_number_request import ( - CreateSipTrunkPhoneNumberRequest, -) +from ...core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from ...types.sip_trunk_transport_enum import SipTrunkTransportEnum +from ...types.sip_media_encryption_enum import SipMediaEncryptionEnum +from ...types.sip_trunk_credentials import SipTrunkCredentials +import typing_extensions +from ...core.unchecked_base_model import UnionMetadata -ConversationalAiCreatePhoneNumberRequestBody = typing.Union[ - CreateTwilioPhoneNumberRequest, CreateSipTrunkPhoneNumberRequest + +class ConversationalAiCreatePhoneNumberRequestBody_Twilio(UncheckedBaseModel): + """ + Create Phone Request Information + """ + + provider: typing.Literal["twilio"] = "twilio" + phone_number: str + label: str + sid: str + token: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ConversationalAiCreatePhoneNumberRequestBody_SipTrunk(UncheckedBaseModel): + """ + Create Phone Request Information + """ + + provider: typing.Literal["sip_trunk"] = "sip_trunk" + phone_number: str + label: str + termination_uri: str + address: typing.Optional[str] = None + transport: typing.Optional[SipTrunkTransportEnum] = None + media_encryption: typing.Optional[SipMediaEncryptionEnum] = None + headers: typing.Optional[typing.Dict[str, str]] = None + credentials: typing.Optional[SipTrunkCredentials] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +ConversationalAiCreatePhoneNumberRequestBody = typing_extensions.Annotated[ + typing.Union[ + ConversationalAiCreatePhoneNumberRequestBody_Twilio, + ConversationalAiCreatePhoneNumberRequestBody_SipTrunk, + ], + UnionMetadata(discriminant="provider"), ] diff --git a/src/elevenlabs/conversational_ai/types/conversational_ai_get_phone_number_response.py b/src/elevenlabs/conversational_ai/types/conversational_ai_get_phone_number_response.py new file mode 100644 index 00000000..c4e43591 --- /dev/null +++ b/src/elevenlabs/conversational_ai/types/conversational_ai_get_phone_number_response.py @@ -0,0 +1,55 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ...core.unchecked_base_model import UncheckedBaseModel +import typing +from ...types.phone_number_agent_info import PhoneNumberAgentInfo +from ...core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from ...types.sip_trunk_config_response_model import SipTrunkConfigResponseModel +import typing_extensions +from ...core.unchecked_base_model import UnionMetadata + + +class ConversationalAiGetPhoneNumberResponse_Twilio(UncheckedBaseModel): + provider: typing.Literal["twilio"] = "twilio" + phone_number: str + label: str + phone_number_id: str + assigned_agent: typing.Optional[PhoneNumberAgentInfo] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ConversationalAiGetPhoneNumberResponse_SipTrunk(UncheckedBaseModel): + provider: typing.Literal["sip_trunk"] = "sip_trunk" + phone_number: str + label: str + phone_number_id: str + assigned_agent: typing.Optional[PhoneNumberAgentInfo] = None + provider_config: typing.Optional[SipTrunkConfigResponseModel] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +ConversationalAiGetPhoneNumberResponse = typing_extensions.Annotated[ + typing.Union[ + ConversationalAiGetPhoneNumberResponse_Twilio, + ConversationalAiGetPhoneNumberResponse_SipTrunk, + ], + UnionMetadata(discriminant="provider"), +] diff --git a/src/elevenlabs/conversational_ai/types/conversational_ai_get_phone_numbers_response_item.py b/src/elevenlabs/conversational_ai/types/conversational_ai_get_phone_numbers_response_item.py new file mode 100644 index 00000000..95133628 --- /dev/null +++ b/src/elevenlabs/conversational_ai/types/conversational_ai_get_phone_numbers_response_item.py @@ -0,0 +1,55 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ...core.unchecked_base_model import UncheckedBaseModel +import typing +from ...types.phone_number_agent_info import PhoneNumberAgentInfo +from ...core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from ...types.sip_trunk_config_response_model import SipTrunkConfigResponseModel +import typing_extensions +from ...core.unchecked_base_model import UnionMetadata + + +class ConversationalAiGetPhoneNumbersResponseItem_Twilio(UncheckedBaseModel): + provider: typing.Literal["twilio"] = "twilio" + phone_number: str + label: str + phone_number_id: str + assigned_agent: typing.Optional[PhoneNumberAgentInfo] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ConversationalAiGetPhoneNumbersResponseItem_SipTrunk(UncheckedBaseModel): + provider: typing.Literal["sip_trunk"] = "sip_trunk" + phone_number: str + label: str + phone_number_id: str + assigned_agent: typing.Optional[PhoneNumberAgentInfo] = None + provider_config: typing.Optional[SipTrunkConfigResponseModel] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +ConversationalAiGetPhoneNumbersResponseItem = typing_extensions.Annotated[ + typing.Union[ + ConversationalAiGetPhoneNumbersResponseItem_Twilio, + ConversationalAiGetPhoneNumbersResponseItem_SipTrunk, + ], + UnionMetadata(discriminant="provider"), +] diff --git a/src/elevenlabs/conversational_ai/types/conversational_ai_update_knowledge_base_document_response.py b/src/elevenlabs/conversational_ai/types/conversational_ai_update_knowledge_base_document_response.py new file mode 100644 index 00000000..8f1e0a55 --- /dev/null +++ b/src/elevenlabs/conversational_ai/types/conversational_ai_update_knowledge_base_document_response.py @@ -0,0 +1,81 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ...core.unchecked_base_model import UncheckedBaseModel +import typing +from ...types.knowledge_base_document_metadata_response_model import ( + KnowledgeBaseDocumentMetadataResponseModel, +) +from ...types.resource_access_info import ResourceAccessInfo +from ...core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +import typing_extensions +from ...core.unchecked_base_model import UnionMetadata + + +class ConversationalAiUpdateKnowledgeBaseDocumentResponse_Url(UncheckedBaseModel): + type: typing.Literal["url"] = "url" + id: str + name: str + metadata: KnowledgeBaseDocumentMetadataResponseModel + prompt_injectable: bool + access_info: ResourceAccessInfo + extracted_inner_html: str + url: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ConversationalAiUpdateKnowledgeBaseDocumentResponse_File(UncheckedBaseModel): + type: typing.Literal["file"] = "file" + id: str + name: str + metadata: KnowledgeBaseDocumentMetadataResponseModel + prompt_injectable: bool + access_info: ResourceAccessInfo + extracted_inner_html: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ConversationalAiUpdateKnowledgeBaseDocumentResponse_Text(UncheckedBaseModel): + type: typing.Literal["text"] = "text" + id: str + name: str + metadata: KnowledgeBaseDocumentMetadataResponseModel + prompt_injectable: bool + access_info: ResourceAccessInfo + extracted_inner_html: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +ConversationalAiUpdateKnowledgeBaseDocumentResponse = typing_extensions.Annotated[ + typing.Union[ + ConversationalAiUpdateKnowledgeBaseDocumentResponse_Url, + ConversationalAiUpdateKnowledgeBaseDocumentResponse_File, + ConversationalAiUpdateKnowledgeBaseDocumentResponse_Text, + ], + UnionMetadata(discriminant="type"), +] diff --git a/src/elevenlabs/conversational_ai/types/conversational_ai_update_phone_number_response.py b/src/elevenlabs/conversational_ai/types/conversational_ai_update_phone_number_response.py new file mode 100644 index 00000000..7354cddd --- /dev/null +++ b/src/elevenlabs/conversational_ai/types/conversational_ai_update_phone_number_response.py @@ -0,0 +1,55 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ...core.unchecked_base_model import UncheckedBaseModel +import typing +from ...types.phone_number_agent_info import PhoneNumberAgentInfo +from ...core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from ...types.sip_trunk_config_response_model import SipTrunkConfigResponseModel +import typing_extensions +from ...core.unchecked_base_model import UnionMetadata + + +class ConversationalAiUpdatePhoneNumberResponse_Twilio(UncheckedBaseModel): + provider: typing.Literal["twilio"] = "twilio" + phone_number: str + label: str + phone_number_id: str + assigned_agent: typing.Optional[PhoneNumberAgentInfo] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class ConversationalAiUpdatePhoneNumberResponse_SipTrunk(UncheckedBaseModel): + provider: typing.Literal["sip_trunk"] = "sip_trunk" + phone_number: str + label: str + phone_number_id: str + assigned_agent: typing.Optional[PhoneNumberAgentInfo] = None + provider_config: typing.Optional[SipTrunkConfigResponseModel] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +ConversationalAiUpdatePhoneNumberResponse = typing_extensions.Annotated[ + typing.Union[ + ConversationalAiUpdatePhoneNumberResponse_Twilio, + ConversationalAiUpdatePhoneNumberResponse_SipTrunk, + ], + UnionMetadata(discriminant="provider"), +] diff --git a/src/elevenlabs/conversational_ai/types/patch_conv_ai_dashboard_settings_request_charts_item.py b/src/elevenlabs/conversational_ai/types/patch_conv_ai_dashboard_settings_request_charts_item.py index 91b50768..54756eff 100644 --- a/src/elevenlabs/conversational_ai/types/patch_conv_ai_dashboard_settings_request_charts_item.py +++ b/src/elevenlabs/conversational_ai/types/patch_conv_ai_dashboard_settings_request_charts_item.py @@ -38,10 +38,26 @@ class Config: extra = pydantic.Extra.allow +class PatchConvAiDashboardSettingsRequestChartsItem_DataCollection(UncheckedBaseModel): + type: typing.Literal["data_collection"] = "data_collection" + name: str + data_collection_id: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + PatchConvAiDashboardSettingsRequestChartsItem = typing_extensions.Annotated[ typing.Union[ PatchConvAiDashboardSettingsRequestChartsItem_CallSuccess, PatchConvAiDashboardSettingsRequestChartsItem_Criteria, + PatchConvAiDashboardSettingsRequestChartsItem_DataCollection, ], UnionMetadata(discriminant="type"), ] diff --git a/src/elevenlabs/core/client_wrapper.py b/src/elevenlabs/core/client_wrapper.py index c9432a0f..b02638fe 100644 --- a/src/elevenlabs/core/client_wrapper.py +++ b/src/elevenlabs/core/client_wrapper.py @@ -23,7 +23,7 @@ def get_headers(self) -> typing.Dict[str, str]: headers: typing.Dict[str, str] = { "X-Fern-Language": "Python", "X-Fern-SDK-Name": "elevenlabs", - "X-Fern-SDK-Version": "v1.58.1", + "X-Fern-SDK-Version": "v1.59.0", } if self._api_key is not None: headers["xi-api-key"] = self._api_key diff --git a/src/elevenlabs/dubbing/__init__.py b/src/elevenlabs/dubbing/__init__.py index 54967ecf..08f84ed0 100644 --- a/src/elevenlabs/dubbing/__init__.py +++ b/src/elevenlabs/dubbing/__init__.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. from .types import DubbingGetTranscriptForDubRequestFormatType +from . import speaker -__all__ = ["DubbingGetTranscriptForDubRequestFormatType"] +__all__ = ["DubbingGetTranscriptForDubRequestFormatType", "speaker"] diff --git a/src/elevenlabs/dubbing/client.py b/src/elevenlabs/dubbing/client.py index 2c2501ad..8ac3bfb5 100644 --- a/src/elevenlabs/dubbing/client.py +++ b/src/elevenlabs/dubbing/client.py @@ -2,6 +2,7 @@ import typing from ..core.client_wrapper import SyncClientWrapper +from .speaker.client import SpeakerClient from ..core.request_options import RequestOptions from ..types.dubbing_resource import DubbingResource from ..core.jsonable_encoder import jsonable_encoder @@ -11,7 +12,6 @@ from json.decoder import JSONDecodeError from ..core.api_error import ApiError from ..types.language_added_response import LanguageAddedResponse -from ..types.segment_create_response import SegmentCreateResponse from ..types.segment_update_response import SegmentUpdateResponse from ..types.segment_delete_response import SegmentDeleteResponse from ..types.segment_transcription_response import SegmentTranscriptionResponse @@ -30,6 +30,7 @@ DubbingGetTranscriptForDubRequestFormatType, ) from ..core.client_wrapper import AsyncClientWrapper +from .speaker.client import AsyncSpeakerClient # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -38,6 +39,7 @@ class DubbingClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper + self.speaker = SpeakerClient(client_wrapper=self._client_wrapper) def get_dubbing_resource( self, @@ -176,94 +178,6 @@ def add_language_to_resource( raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def create_segment_for_speaker( - self, - dubbing_id: str, - speaker_id: str, - *, - start_time: float, - end_time: float, - text: typing.Optional[str] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> SegmentCreateResponse: - """ - Creates a new segment in dubbing resource with a start and end time for the speaker in every available language. Does not automatically generate transcripts/translations/audio. - - Parameters - ---------- - dubbing_id : str - ID of the dubbing project. - - speaker_id : str - ID of the speaker. - - start_time : float - - end_time : float - - text : typing.Optional[str] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - SegmentCreateResponse - Successful Response - - Examples - -------- - from elevenlabs import ElevenLabs - - client = ElevenLabs( - api_key="YOUR_API_KEY", - ) - client.dubbing.create_segment_for_speaker( - dubbing_id="dubbing_id", - speaker_id="speaker_id", - start_time=1.1, - end_time=1.1, - ) - """ - _response = self._client_wrapper.httpx_client.request( - f"v1/dubbing/resource/{jsonable_encoder(dubbing_id)}/speaker/{jsonable_encoder(speaker_id)}/segment", - base_url=self._client_wrapper.get_environment().base, - method="POST", - json={ - "start_time": start_time, - "end_time": end_time, - "text": text, - }, - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - return typing.cast( - SegmentCreateResponse, - construct_type( - type_=SegmentCreateResponse, # type: ignore - object_=_response.json(), - ), - ) - if _response.status_code == 422: - raise UnprocessableEntityError( - typing.cast( - HttpValidationError, - construct_type( - type_=HttpValidationError, # type: ignore - object_=_response.json(), - ), - ) - ) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - def update_segment_language( self, dubbing_id: str, @@ -1203,6 +1117,7 @@ def get_transcript_for_dub( class AsyncDubbingClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper + self.speaker = AsyncSpeakerClient(client_wrapper=self._client_wrapper) async def get_dubbing_resource( self, @@ -1357,102 +1272,6 @@ async def main() -> None: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def create_segment_for_speaker( - self, - dubbing_id: str, - speaker_id: str, - *, - start_time: float, - end_time: float, - text: typing.Optional[str] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> SegmentCreateResponse: - """ - Creates a new segment in dubbing resource with a start and end time for the speaker in every available language. Does not automatically generate transcripts/translations/audio. - - Parameters - ---------- - dubbing_id : str - ID of the dubbing project. - - speaker_id : str - ID of the speaker. - - start_time : float - - end_time : float - - text : typing.Optional[str] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - SegmentCreateResponse - Successful Response - - Examples - -------- - import asyncio - - from elevenlabs import AsyncElevenLabs - - client = AsyncElevenLabs( - api_key="YOUR_API_KEY", - ) - - - async def main() -> None: - await client.dubbing.create_segment_for_speaker( - dubbing_id="dubbing_id", - speaker_id="speaker_id", - start_time=1.1, - end_time=1.1, - ) - - - asyncio.run(main()) - """ - _response = await self._client_wrapper.httpx_client.request( - f"v1/dubbing/resource/{jsonable_encoder(dubbing_id)}/speaker/{jsonable_encoder(speaker_id)}/segment", - base_url=self._client_wrapper.get_environment().base, - method="POST", - json={ - "start_time": start_time, - "end_time": end_time, - "text": text, - }, - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - return typing.cast( - SegmentCreateResponse, - construct_type( - type_=SegmentCreateResponse, # type: ignore - object_=_response.json(), - ), - ) - if _response.status_code == 422: - raise UnprocessableEntityError( - typing.cast( - HttpValidationError, - construct_type( - type_=HttpValidationError, # type: ignore - object_=_response.json(), - ), - ) - ) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - async def update_segment_language( self, dubbing_id: str, diff --git a/src/elevenlabs/dubbing/speaker/__init__.py b/src/elevenlabs/dubbing/speaker/__init__.py new file mode 100644 index 00000000..c2182255 --- /dev/null +++ b/src/elevenlabs/dubbing/speaker/__init__.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from . import segment + +__all__ = ["segment"] diff --git a/src/elevenlabs/dubbing/speaker/client.py b/src/elevenlabs/dubbing/speaker/client.py new file mode 100644 index 00000000..0cbd680b --- /dev/null +++ b/src/elevenlabs/dubbing/speaker/client.py @@ -0,0 +1,351 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from ...core.client_wrapper import SyncClientWrapper +from .segment.client import SegmentClient +from ...core.request_options import RequestOptions +from ...types.speaker_updated_response import SpeakerUpdatedResponse +from ...core.jsonable_encoder import jsonable_encoder +from ...core.unchecked_base_model import construct_type +from ...errors.unprocessable_entity_error import UnprocessableEntityError +from ...types.http_validation_error import HttpValidationError +from json.decoder import JSONDecodeError +from ...core.api_error import ApiError +from ...types.similar_voices_for_speaker_response import SimilarVoicesForSpeakerResponse +from ...core.client_wrapper import AsyncClientWrapper +from .segment.client import AsyncSegmentClient + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class SpeakerClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + self.segment = SegmentClient(client_wrapper=self._client_wrapper) + + def update( + self, + dubbing_id: str, + speaker_id: str, + *, + voice_id: typing.Optional[str] = OMIT, + languages: typing.Optional[typing.Sequence[str]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> SpeakerUpdatedResponse: + """ + Amend the metadata associated with a speaker, such as their voice. Both voice cloning and using voices from the ElevenLabs library are supported. + + Parameters + ---------- + dubbing_id : str + ID of the dubbing project. + + speaker_id : str + ID of the speaker. + + voice_id : typing.Optional[str] + Either the identifier of a voice from the ElevenLabs voice library, or one of ['track-clone', 'clip-clone']. + + languages : typing.Optional[typing.Sequence[str]] + Languages to apply these changes to. If empty, will apply to all languages. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SpeakerUpdatedResponse + Successful Response + + Examples + -------- + from elevenlabs import ElevenLabs + + client = ElevenLabs( + api_key="YOUR_API_KEY", + ) + client.dubbing.speaker.update( + dubbing_id="dubbing_id", + speaker_id="speaker_id", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"v1/dubbing/resource/{jsonable_encoder(dubbing_id)}/speaker/{jsonable_encoder(speaker_id)}", + base_url=self._client_wrapper.get_environment().base, + method="PATCH", + json={ + "voice_id": voice_id, + "languages": languages, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + SpeakerUpdatedResponse, + construct_type( + type_=SpeakerUpdatedResponse, # type: ignore + object_=_response.json(), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + typing.cast( + HttpValidationError, + construct_type( + type_=HttpValidationError, # type: ignore + object_=_response.json(), + ), + ) + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def similar_voices( + self, + dubbing_id: str, + speaker_id: str, + *, + request_options: typing.Optional[RequestOptions] = None, + ) -> SimilarVoicesForSpeakerResponse: + """ + Fetch the top 10 similar voices to a speaker, including the voice IDs, names, descriptions, and, where possible, a sample audio recording. + + Parameters + ---------- + dubbing_id : str + ID of the dubbing project. + + speaker_id : str + ID of the speaker. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SimilarVoicesForSpeakerResponse + Successful Response + + Examples + -------- + from elevenlabs import ElevenLabs + + client = ElevenLabs( + api_key="YOUR_API_KEY", + ) + client.dubbing.speaker.similar_voices( + dubbing_id="dubbing_id", + speaker_id="speaker_id", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"v1/dubbing/resource/{jsonable_encoder(dubbing_id)}/speaker/{jsonable_encoder(speaker_id)}/similar-voices", + base_url=self._client_wrapper.get_environment().base, + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + SimilarVoicesForSpeakerResponse, + construct_type( + type_=SimilarVoicesForSpeakerResponse, # type: ignore + object_=_response.json(), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + typing.cast( + HttpValidationError, + construct_type( + type_=HttpValidationError, # type: ignore + object_=_response.json(), + ), + ) + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + +class AsyncSpeakerClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + self.segment = AsyncSegmentClient(client_wrapper=self._client_wrapper) + + async def update( + self, + dubbing_id: str, + speaker_id: str, + *, + voice_id: typing.Optional[str] = OMIT, + languages: typing.Optional[typing.Sequence[str]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> SpeakerUpdatedResponse: + """ + Amend the metadata associated with a speaker, such as their voice. Both voice cloning and using voices from the ElevenLabs library are supported. + + Parameters + ---------- + dubbing_id : str + ID of the dubbing project. + + speaker_id : str + ID of the speaker. + + voice_id : typing.Optional[str] + Either the identifier of a voice from the ElevenLabs voice library, or one of ['track-clone', 'clip-clone']. + + languages : typing.Optional[typing.Sequence[str]] + Languages to apply these changes to. If empty, will apply to all languages. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SpeakerUpdatedResponse + Successful Response + + Examples + -------- + import asyncio + + from elevenlabs import AsyncElevenLabs + + client = AsyncElevenLabs( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.dubbing.speaker.update( + dubbing_id="dubbing_id", + speaker_id="speaker_id", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"v1/dubbing/resource/{jsonable_encoder(dubbing_id)}/speaker/{jsonable_encoder(speaker_id)}", + base_url=self._client_wrapper.get_environment().base, + method="PATCH", + json={ + "voice_id": voice_id, + "languages": languages, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + SpeakerUpdatedResponse, + construct_type( + type_=SpeakerUpdatedResponse, # type: ignore + object_=_response.json(), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + typing.cast( + HttpValidationError, + construct_type( + type_=HttpValidationError, # type: ignore + object_=_response.json(), + ), + ) + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def similar_voices( + self, + dubbing_id: str, + speaker_id: str, + *, + request_options: typing.Optional[RequestOptions] = None, + ) -> SimilarVoicesForSpeakerResponse: + """ + Fetch the top 10 similar voices to a speaker, including the voice IDs, names, descriptions, and, where possible, a sample audio recording. + + Parameters + ---------- + dubbing_id : str + ID of the dubbing project. + + speaker_id : str + ID of the speaker. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SimilarVoicesForSpeakerResponse + Successful Response + + Examples + -------- + import asyncio + + from elevenlabs import AsyncElevenLabs + + client = AsyncElevenLabs( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.dubbing.speaker.similar_voices( + dubbing_id="dubbing_id", + speaker_id="speaker_id", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"v1/dubbing/resource/{jsonable_encoder(dubbing_id)}/speaker/{jsonable_encoder(speaker_id)}/similar-voices", + base_url=self._client_wrapper.get_environment().base, + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + SimilarVoicesForSpeakerResponse, + construct_type( + type_=SimilarVoicesForSpeakerResponse, # type: ignore + object_=_response.json(), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + typing.cast( + HttpValidationError, + construct_type( + type_=HttpValidationError, # type: ignore + object_=_response.json(), + ), + ) + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/elevenlabs/dubbing/speaker/segment/__init__.py b/src/elevenlabs/dubbing/speaker/segment/__init__.py new file mode 100644 index 00000000..f3ea2659 --- /dev/null +++ b/src/elevenlabs/dubbing/speaker/segment/__init__.py @@ -0,0 +1,2 @@ +# This file was auto-generated by Fern from our API Definition. + diff --git a/src/elevenlabs/dubbing/speaker/segment/client.py b/src/elevenlabs/dubbing/speaker/segment/client.py new file mode 100644 index 00000000..6f07af59 --- /dev/null +++ b/src/elevenlabs/dubbing/speaker/segment/client.py @@ -0,0 +1,218 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from ....core.client_wrapper import SyncClientWrapper +from ....core.request_options import RequestOptions +from ....types.segment_create_response import SegmentCreateResponse +from ....core.jsonable_encoder import jsonable_encoder +from ....core.unchecked_base_model import construct_type +from ....errors.unprocessable_entity_error import UnprocessableEntityError +from ....types.http_validation_error import HttpValidationError +from json.decoder import JSONDecodeError +from ....core.api_error import ApiError +from ....core.client_wrapper import AsyncClientWrapper + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class SegmentClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def create( + self, + dubbing_id: str, + speaker_id: str, + *, + start_time: float, + end_time: float, + text: typing.Optional[str] = OMIT, + translations: typing.Optional[typing.Dict[str, typing.Optional[str]]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> SegmentCreateResponse: + """ + Creates a new segment in dubbing resource with a start and end time for the speaker in every available language. Does not automatically generate transcripts/translations/audio. + + Parameters + ---------- + dubbing_id : str + ID of the dubbing project. + + speaker_id : str + ID of the speaker. + + start_time : float + + end_time : float + + text : typing.Optional[str] + + translations : typing.Optional[typing.Dict[str, typing.Optional[str]]] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SegmentCreateResponse + Successful Response + + Examples + -------- + from elevenlabs import ElevenLabs + + client = ElevenLabs( + api_key="YOUR_API_KEY", + ) + client.dubbing.speaker.segment.create( + dubbing_id="dubbing_id", + speaker_id="speaker_id", + start_time=1.1, + end_time=1.1, + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"v1/dubbing/resource/{jsonable_encoder(dubbing_id)}/speaker/{jsonable_encoder(speaker_id)}/segment", + base_url=self._client_wrapper.get_environment().base, + method="POST", + json={ + "start_time": start_time, + "end_time": end_time, + "text": text, + "translations": translations, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + SegmentCreateResponse, + construct_type( + type_=SegmentCreateResponse, # type: ignore + object_=_response.json(), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + typing.cast( + HttpValidationError, + construct_type( + type_=HttpValidationError, # type: ignore + object_=_response.json(), + ), + ) + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + +class AsyncSegmentClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def create( + self, + dubbing_id: str, + speaker_id: str, + *, + start_time: float, + end_time: float, + text: typing.Optional[str] = OMIT, + translations: typing.Optional[typing.Dict[str, typing.Optional[str]]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> SegmentCreateResponse: + """ + Creates a new segment in dubbing resource with a start and end time for the speaker in every available language. Does not automatically generate transcripts/translations/audio. + + Parameters + ---------- + dubbing_id : str + ID of the dubbing project. + + speaker_id : str + ID of the speaker. + + start_time : float + + end_time : float + + text : typing.Optional[str] + + translations : typing.Optional[typing.Dict[str, typing.Optional[str]]] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SegmentCreateResponse + Successful Response + + Examples + -------- + import asyncio + + from elevenlabs import AsyncElevenLabs + + client = AsyncElevenLabs( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.dubbing.speaker.segment.create( + dubbing_id="dubbing_id", + speaker_id="speaker_id", + start_time=1.1, + end_time=1.1, + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"v1/dubbing/resource/{jsonable_encoder(dubbing_id)}/speaker/{jsonable_encoder(speaker_id)}/segment", + base_url=self._client_wrapper.get_environment().base, + method="POST", + json={ + "start_time": start_time, + "end_time": end_time, + "text": text, + "translations": translations, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + SegmentCreateResponse, + construct_type( + type_=SegmentCreateResponse, # type: ignore + object_=_response.json(), + ), + ) + if _response.status_code == 422: + raise UnprocessableEntityError( + typing.cast( + HttpValidationError, + construct_type( + type_=HttpValidationError, # type: ignore + object_=_response.json(), + ), + ) + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/src/elevenlabs/environment.py b/src/elevenlabs/environment.py index 3239ad95..87216577 100644 --- a/src/elevenlabs/environment.py +++ b/src/elevenlabs/environment.py @@ -6,6 +6,7 @@ class ElevenLabsEnvironment: PRODUCTION: ElevenLabsEnvironment PRODUCTION_US: ElevenLabsEnvironment + PRODUCTION_EU: ElevenLabsEnvironment def __init__(self, *, base: str, wss: str): self.base = base @@ -18,3 +19,6 @@ def __init__(self, *, base: str, wss: str): ElevenLabsEnvironment.PRODUCTION_US = ElevenLabsEnvironment( base="https://api.us.elevenlabs.io", wss="wss://api.elevenlabs.io" ) +ElevenLabsEnvironment.PRODUCTION_EU = ElevenLabsEnvironment( + base="https://api.eu.residency.elevenlabs.io", wss="wss://api.elevenlabs.io" +) diff --git a/src/elevenlabs/types/__init__.py b/src/elevenlabs/types/__init__.py index 3d999998..7ca55ed6 100644 --- a/src/elevenlabs/types/__init__.py +++ b/src/elevenlabs/types/__init__.py @@ -19,11 +19,13 @@ from .agent_ban import AgentBan from .agent_call_limits import AgentCallLimits from .agent_config import AgentConfig +from .agent_config_db_model import AgentConfigDbModel from .agent_config_override import AgentConfigOverride from .agent_config_override_config import AgentConfigOverrideConfig from .agent_metadata_response_model import AgentMetadataResponseModel from .agent_platform_settings_request_model import AgentPlatformSettingsRequestModel from .agent_platform_settings_response_model import AgentPlatformSettingsResponseModel +from .agent_simulated_chat_test_response_model import AgentSimulatedChatTestResponseModel from .agent_summary_response_model import AgentSummaryResponseModel from .agent_transfer import AgentTransfer from .agent_workspace_overrides_input import AgentWorkspaceOverridesInput @@ -43,10 +45,14 @@ from .audio_native_project_settings_response_model import AudioNativeProjectSettingsResponseModel from .audio_native_project_settings_response_model_status import AudioNativeProjectSettingsResponseModelStatus from .audio_output import AudioOutput +from .audio_output_multi import AudioOutputMulti from .audio_with_timestamps_response import AudioWithTimestampsResponse from .auth_settings import AuthSettings from .authorization_method import AuthorizationMethod from .ban_reason_type import BanReasonType +from .batch_call_detailed_response import BatchCallDetailedResponse +from .batch_call_recipient_status import BatchCallRecipientStatus +from .batch_call_status import BatchCallStatus from .body_add_chapter_to_a_project_v_1_projects_project_id_chapters_add_post import ( BodyAddChapterToAProjectV1ProjectsProjectIdChaptersAddPost, ) @@ -132,6 +138,8 @@ from .client_tool_config_input import ClientToolConfigInput from .client_tool_config_output import ClientToolConfigOutput from .close_connection import CloseConnection +from .close_context import CloseContext +from .close_socket import CloseSocket from .conv_ai_secret_locator import ConvAiSecretLocator from .conv_ai_stored_secret_dependencies import ConvAiStoredSecretDependencies from .conv_ai_stored_secret_dependencies_agent_tools_item import ( @@ -154,6 +162,7 @@ from .conversation_config_client_override_output import ConversationConfigClientOverrideOutput from .conversation_deletion_settings import ConversationDeletionSettings from .conversation_history_analysis_common_model import ConversationHistoryAnalysisCommonModel +from .conversation_history_batch_call_model import ConversationHistoryBatchCallModel from .conversation_history_error_common_model import ConversationHistoryErrorCommonModel from .conversation_history_evaluation_criteria_result_common_model import ( ConversationHistoryEvaluationCriteriaResultCommonModel, @@ -162,11 +171,18 @@ from .conversation_history_metadata_common_model import ConversationHistoryMetadataCommonModel from .conversation_history_metadata_common_model_phone_call import ( ConversationHistoryMetadataCommonModelPhoneCall, + ConversationHistoryMetadataCommonModelPhoneCall_SipTrunking, ConversationHistoryMetadataCommonModelPhoneCall_Twilio, ) from .conversation_history_rag_usage_common_model import ConversationHistoryRagUsageCommonModel -from .conversation_history_transcript_common_model import ConversationHistoryTranscriptCommonModel -from .conversation_history_transcript_common_model_role import ConversationHistoryTranscriptCommonModelRole +from .conversation_history_sip_trunking_phone_call_model import ConversationHistorySipTrunkingPhoneCallModel +from .conversation_history_sip_trunking_phone_call_model_direction import ( + ConversationHistorySipTrunkingPhoneCallModelDirection, +) +from .conversation_history_transcript_common_model_input import ConversationHistoryTranscriptCommonModelInput +from .conversation_history_transcript_common_model_input_role import ConversationHistoryTranscriptCommonModelInputRole +from .conversation_history_transcript_common_model_output import ConversationHistoryTranscriptCommonModelOutput +from .conversation_history_transcript_common_model_output_role import ConversationHistoryTranscriptCommonModelOutputRole from .conversation_history_transcript_tool_call_client_details import ConversationHistoryTranscriptToolCallClientDetails from .conversation_history_transcript_tool_call_common_model import ConversationHistoryTranscriptToolCallCommonModel from .conversation_history_transcript_tool_call_common_model_tool_details import ( @@ -182,6 +198,10 @@ from .conversation_history_twilio_phone_call_model_direction import ConversationHistoryTwilioPhoneCallModelDirection from .conversation_initiation_client_data_config_input import ConversationInitiationClientDataConfigInput from .conversation_initiation_client_data_config_output import ConversationInitiationClientDataConfigOutput +from .conversation_initiation_client_data_internal import ConversationInitiationClientDataInternal +from .conversation_initiation_client_data_internal_dynamic_variables_value import ( + ConversationInitiationClientDataInternalDynamicVariablesValue, +) from .conversation_initiation_client_data_request_input import ConversationInitiationClientDataRequestInput from .conversation_initiation_client_data_request_input_dynamic_variables_value import ( ConversationInitiationClientDataRequestInputDynamicVariablesValue, @@ -195,6 +215,7 @@ ConversationInitiationClientDataWebhookRequestHeadersValue, ) from .conversation_signed_url_response_model import ConversationSignedUrlResponseModel +from .conversation_simulation_specification import ConversationSimulationSpecification from .conversation_summary_response_model import ConversationSummaryResponseModel from .conversation_summary_response_model_status import ConversationSummaryResponseModelStatus from .conversation_token_db_model import ConversationTokenDbModel @@ -214,6 +235,7 @@ from .custom_llm import CustomLlm from .dashboard_call_success_chart_model import DashboardCallSuccessChartModel from .dashboard_criteria_chart_model import DashboardCriteriaChartModel +from .dashboard_data_collection_chart_model import DashboardDataCollectionChartModel from .data_collection_result_common_model import DataCollectionResultCommonModel from .delete_chapter_request import DeleteChapterRequest from .delete_chapter_response_model import DeleteChapterResponseModel @@ -277,8 +299,10 @@ from .extended_subscription_response_model_status import ExtendedSubscriptionResponseModelStatus from .feedback_item import FeedbackItem from .final_output import FinalOutput +from .final_output_multi import FinalOutputMulti from .fine_tuning_response import FineTuningResponse from .fine_tuning_response_model_state_value import FineTuningResponseModelStateValue +from .flush_context import FlushContext from .forced_alignment_character_response_model import ForcedAlignmentCharacterResponseModel from .forced_alignment_response_model import ForcedAlignmentResponseModel from .forced_alignment_word_response_model import ForcedAlignmentWordResponseModel @@ -288,6 +312,11 @@ from .get_agent_embed_response_model import GetAgentEmbedResponseModel from .get_agent_link_response_model import GetAgentLinkResponseModel from .get_agent_response_model import GetAgentResponseModel +from .get_agent_response_model_phone_numbers_item import ( + GetAgentResponseModelPhoneNumbersItem, + GetAgentResponseModelPhoneNumbersItem_SipTrunk, + GetAgentResponseModelPhoneNumbersItem_Twilio, +) from .get_agents_page_response_model import GetAgentsPageResponseModel from .get_audio_native_project_settings_response_model import GetAudioNativeProjectSettingsResponseModel from .get_chapter_request import GetChapterRequest @@ -299,6 +328,7 @@ GetConvAiDashboardSettingsResponseModelChartsItem, GetConvAiDashboardSettingsResponseModelChartsItem_CallSuccess, GetConvAiDashboardSettingsResponseModelChartsItem_Criteria, + GetConvAiDashboardSettingsResponseModelChartsItem_DataCollection, ) from .get_conv_ai_settings_response_model import GetConvAiSettingsResponseModel from .get_conversation_response_model import GetConversationResponseModel @@ -339,7 +369,9 @@ from .get_knowledge_base_text_response_model import GetKnowledgeBaseTextResponseModel from .get_knowledge_base_url_response_model import GetKnowledgeBaseUrlResponseModel from .get_library_voices_response import GetLibraryVoicesResponse -from .get_phone_number_response_model import GetPhoneNumberResponseModel +from .get_phone_number_response import GetPhoneNumberResponse +from .get_phone_number_sip_trunk_response_model import GetPhoneNumberSipTrunkResponseModel +from .get_phone_number_twilio_response_model import GetPhoneNumberTwilioResponseModel from .get_project_request import GetProjectRequest from .get_projects_request import GetProjectsRequest from .get_projects_response import GetProjectsResponse @@ -360,8 +392,11 @@ from .html_export_options import HtmlExportOptions from .http_validation_error import HttpValidationError from .image_avatar import ImageAvatar +from .initialise_context import InitialiseContext from .initialize_connection import InitializeConnection +from .initialize_connection_multi import InitializeConnectionMulti from .invoice_response import InvoiceResponse +from .keep_context_alive import KeepContextAlive from .knowledge_base_document_chunk_response_model import KnowledgeBaseDocumentChunkResponseModel from .knowledge_base_document_metadata_response_model import KnowledgeBaseDocumentMetadataResponseModel from .knowledge_base_document_type import KnowledgeBaseDocumentType @@ -381,9 +416,12 @@ from .llm_category_usage import LlmCategoryUsage from .llm_input_output_tokens_usage import LlmInputOutputTokensUsage from .llm_tokens_category_usage import LlmTokensCategoryUsage -from .llm_usage import LlmUsage +from .llm_usage_input import LlmUsageInput +from .llm_usage_output import LlmUsageOutput from .manual_verification_file_response import ManualVerificationFileResponse from .manual_verification_response import ManualVerificationResponse +from .mcp_tool_config_input import McpToolConfigInput +from .mcp_tool_config_output import McpToolConfigOutput from .metric_record import MetricRecord from .metric_type import MetricType from .model import Model @@ -398,6 +436,7 @@ from .object_json_schema_property_output import ObjectJsonSchemaPropertyOutput from .object_json_schema_property_output_properties_value import ObjectJsonSchemaPropertyOutputPropertiesValue from .orb_avatar import OrbAvatar +from .outbound_call_recipient_response_model import OutboundCallRecipientResponseModel from .output_format import OutputFormat from .pdf_export_options import PdfExportOptions from .phone_number_agent_info import PhoneNumberAgentInfo @@ -412,7 +451,6 @@ from .post_agent_avatar_response_model import PostAgentAvatarResponseModel from .post_workspace_secret_response_model import PostWorkspaceSecretResponseModel from .privacy_config import PrivacyConfig -from .profile_page_response_model import ProfilePageResponseModel from .project_creation_meta_response_model import ProjectCreationMetaResponseModel from .project_creation_meta_response_model_status import ProjectCreationMetaResponseModelStatus from .project_creation_meta_response_model_type import ProjectCreationMetaResponseModelType @@ -433,15 +471,25 @@ from .project_snapshots_response import ProjectSnapshotsResponse from .project_state import ProjectState from .prompt_agent import PromptAgent +from .prompt_agent_db_model import PromptAgentDbModel +from .prompt_agent_db_model_tools_item import ( + PromptAgentDbModelToolsItem, + PromptAgentDbModelToolsItem_Client, + PromptAgentDbModelToolsItem_Mcp, + PromptAgentDbModelToolsItem_System, + PromptAgentDbModelToolsItem_Webhook, +) from .prompt_agent_input_tools_item import ( PromptAgentInputToolsItem, PromptAgentInputToolsItem_Client, + PromptAgentInputToolsItem_Mcp, PromptAgentInputToolsItem_System, PromptAgentInputToolsItem_Webhook, ) from .prompt_agent_output_tools_item import ( PromptAgentOutputToolsItem, PromptAgentOutputToolsItem_Client, + PromptAgentOutputToolsItem_Mcp, PromptAgentOutputToolsItem_System, PromptAgentOutputToolsItem_Webhook, ) @@ -491,15 +539,24 @@ from .segment_update_response import SegmentUpdateResponse from .segmented_json_export_options import SegmentedJsonExportOptions from .send_text import SendText +from .send_text_multi import SendTextMulti from .share_option_response_model import ShareOptionResponseModel from .share_option_response_model_type import ShareOptionResponseModelType +from .similar_voice import SimilarVoice +from .similar_voice_category import SimilarVoiceCategory +from .similar_voices_for_speaker_response import SimilarVoicesForSpeakerResponse +from .sip_media_encryption_enum import SipMediaEncryptionEnum +from .sip_trunk_config_response_model import SipTrunkConfigResponseModel from .sip_trunk_credentials import SipTrunkCredentials +from .sip_trunk_outbound_call_response import SipTrunkOutboundCallResponse +from .sip_trunk_transport_enum import SipTrunkTransportEnum from .speaker_audio_response_model import SpeakerAudioResponseModel from .speaker_response_model import SpeakerResponseModel from .speaker_segment import SpeakerSegment from .speaker_separation_response_model import SpeakerSeparationResponseModel from .speaker_separation_response_model_status import SpeakerSeparationResponseModelStatus from .speaker_track import SpeakerTrack +from .speaker_updated_response import SpeakerUpdatedResponse from .speech_history_item_response import SpeechHistoryItemResponse from .speech_history_item_response_model_source import SpeechHistoryItemResponseModelSource from .speech_history_item_response_model_voice_category import SpeechHistoryItemResponseModelVoiceCategory @@ -510,6 +567,8 @@ from .srt_export_options import SrtExportOptions from .start_pvc_voice_training_response_model import StartPvcVoiceTrainingResponseModel from .start_speaker_separation_response_model import StartSpeakerSeparationResponseModel +from .stream_input_query_parameters import StreamInputQueryParameters +from .stream_input_query_parameters_optimize_streaming_latency import StreamInputQueryParametersOptimizeStreamingLatency from .streaming_audio_chunk_with_timestamps_response import StreamingAudioChunkWithTimestampsResponse from .subscription import Subscription from .subscription_extras_response_model import SubscriptionExtrasResponseModel @@ -536,7 +595,10 @@ SystemToolConfigOutputParams_TransferToNumber, ) from .telephony_provider import TelephonyProvider +from .text_to_speech_apply_text_normalization_enum import TextToSpeechApplyTextNormalizationEnum +from .text_to_speech_output_format_enum import TextToSpeechOutputFormatEnum from .text_to_speech_stream_request import TextToSpeechStreamRequest +from .tool_mock_config import ToolMockConfig from .transfer_to_agent_tool_config import TransferToAgentToolConfig from .transfer_to_number_tool_config import TransferToNumberToolConfig from .tts_conversational_config import TtsConversationalConfig @@ -594,6 +656,8 @@ ) from .webhook_tool_config_input import WebhookToolConfigInput from .webhook_tool_config_output import WebhookToolConfigOutput +from .websocket_tts_client_message_multi import WebsocketTtsClientMessageMulti +from .websocket_tts_server_message_multi import WebsocketTtsServerMessageMulti from .widget_config import WidgetConfig from .widget_config_avatar import ( WidgetConfigAvatar, @@ -631,11 +695,13 @@ "AgentBan", "AgentCallLimits", "AgentConfig", + "AgentConfigDbModel", "AgentConfigOverride", "AgentConfigOverrideConfig", "AgentMetadataResponseModel", "AgentPlatformSettingsRequestModel", "AgentPlatformSettingsResponseModel", + "AgentSimulatedChatTestResponseModel", "AgentSummaryResponseModel", "AgentTransfer", "AgentWorkspaceOverridesInput", @@ -655,10 +721,14 @@ "AudioNativeProjectSettingsResponseModel", "AudioNativeProjectSettingsResponseModelStatus", "AudioOutput", + "AudioOutputMulti", "AudioWithTimestampsResponse", "AuthSettings", "AuthorizationMethod", "BanReasonType", + "BatchCallDetailedResponse", + "BatchCallRecipientStatus", + "BatchCallStatus", "BodyAddChapterToAProjectV1ProjectsProjectIdChaptersAddPost", "BodyAddProjectV1ProjectsAddPostApplyTextNormalization", "BodyAddProjectV1ProjectsAddPostFiction", @@ -710,6 +780,8 @@ "ClientToolConfigInput", "ClientToolConfigOutput", "CloseConnection", + "CloseContext", + "CloseSocket", "ConvAiSecretLocator", "ConvAiStoredSecretDependencies", "ConvAiStoredSecretDependenciesAgentToolsItem", @@ -728,15 +800,21 @@ "ConversationConfigClientOverrideOutput", "ConversationDeletionSettings", "ConversationHistoryAnalysisCommonModel", + "ConversationHistoryBatchCallModel", "ConversationHistoryErrorCommonModel", "ConversationHistoryEvaluationCriteriaResultCommonModel", "ConversationHistoryFeedbackCommonModel", "ConversationHistoryMetadataCommonModel", "ConversationHistoryMetadataCommonModelPhoneCall", + "ConversationHistoryMetadataCommonModelPhoneCall_SipTrunking", "ConversationHistoryMetadataCommonModelPhoneCall_Twilio", "ConversationHistoryRagUsageCommonModel", - "ConversationHistoryTranscriptCommonModel", - "ConversationHistoryTranscriptCommonModelRole", + "ConversationHistorySipTrunkingPhoneCallModel", + "ConversationHistorySipTrunkingPhoneCallModelDirection", + "ConversationHistoryTranscriptCommonModelInput", + "ConversationHistoryTranscriptCommonModelInputRole", + "ConversationHistoryTranscriptCommonModelOutput", + "ConversationHistoryTranscriptCommonModelOutputRole", "ConversationHistoryTranscriptToolCallClientDetails", "ConversationHistoryTranscriptToolCallCommonModel", "ConversationHistoryTranscriptToolCallCommonModelToolDetails", @@ -748,6 +826,8 @@ "ConversationHistoryTwilioPhoneCallModelDirection", "ConversationInitiationClientDataConfigInput", "ConversationInitiationClientDataConfigOutput", + "ConversationInitiationClientDataInternal", + "ConversationInitiationClientDataInternalDynamicVariablesValue", "ConversationInitiationClientDataRequestInput", "ConversationInitiationClientDataRequestInputDynamicVariablesValue", "ConversationInitiationClientDataRequestOutput", @@ -755,6 +835,7 @@ "ConversationInitiationClientDataWebhook", "ConversationInitiationClientDataWebhookRequestHeadersValue", "ConversationSignedUrlResponseModel", + "ConversationSimulationSpecification", "ConversationSummaryResponseModel", "ConversationSummaryResponseModelStatus", "ConversationTokenDbModel", @@ -774,6 +855,7 @@ "CustomLlm", "DashboardCallSuccessChartModel", "DashboardCriteriaChartModel", + "DashboardDataCollectionChartModel", "DataCollectionResultCommonModel", "DeleteChapterRequest", "DeleteChapterResponseModel", @@ -831,8 +913,10 @@ "ExtendedSubscriptionResponseModelStatus", "FeedbackItem", "FinalOutput", + "FinalOutputMulti", "FineTuningResponse", "FineTuningResponseModelStateValue", + "FlushContext", "ForcedAlignmentCharacterResponseModel", "ForcedAlignmentResponseModel", "ForcedAlignmentWordResponseModel", @@ -842,6 +926,9 @@ "GetAgentEmbedResponseModel", "GetAgentLinkResponseModel", "GetAgentResponseModel", + "GetAgentResponseModelPhoneNumbersItem", + "GetAgentResponseModelPhoneNumbersItem_SipTrunk", + "GetAgentResponseModelPhoneNumbersItem_Twilio", "GetAgentsPageResponseModel", "GetAudioNativeProjectSettingsResponseModel", "GetChapterRequest", @@ -852,6 +939,7 @@ "GetConvAiDashboardSettingsResponseModelChartsItem", "GetConvAiDashboardSettingsResponseModelChartsItem_CallSuccess", "GetConvAiDashboardSettingsResponseModelChartsItem_Criteria", + "GetConvAiDashboardSettingsResponseModelChartsItem_DataCollection", "GetConvAiSettingsResponseModel", "GetConversationResponseModel", "GetConversationResponseModelStatus", @@ -881,7 +969,9 @@ "GetKnowledgeBaseTextResponseModel", "GetKnowledgeBaseUrlResponseModel", "GetLibraryVoicesResponse", - "GetPhoneNumberResponseModel", + "GetPhoneNumberResponse", + "GetPhoneNumberSipTrunkResponseModel", + "GetPhoneNumberTwilioResponseModel", "GetProjectRequest", "GetProjectsRequest", "GetProjectsResponse", @@ -900,8 +990,11 @@ "HtmlExportOptions", "HttpValidationError", "ImageAvatar", + "InitialiseContext", "InitializeConnection", + "InitializeConnectionMulti", "InvoiceResponse", + "KeepContextAlive", "KnowledgeBaseDocumentChunkResponseModel", "KnowledgeBaseDocumentMetadataResponseModel", "KnowledgeBaseDocumentType", @@ -921,9 +1014,12 @@ "LlmCategoryUsage", "LlmInputOutputTokensUsage", "LlmTokensCategoryUsage", - "LlmUsage", + "LlmUsageInput", + "LlmUsageOutput", "ManualVerificationFileResponse", "ManualVerificationResponse", + "McpToolConfigInput", + "McpToolConfigOutput", "MetricRecord", "MetricType", "Model", @@ -938,6 +1034,7 @@ "ObjectJsonSchemaPropertyOutput", "ObjectJsonSchemaPropertyOutputPropertiesValue", "OrbAvatar", + "OutboundCallRecipientResponseModel", "OutputFormat", "PdfExportOptions", "PhoneNumberAgentInfo", @@ -952,7 +1049,6 @@ "PostAgentAvatarResponseModel", "PostWorkspaceSecretResponseModel", "PrivacyConfig", - "ProfilePageResponseModel", "ProjectCreationMetaResponseModel", "ProjectCreationMetaResponseModelStatus", "ProjectCreationMetaResponseModelType", @@ -973,12 +1069,20 @@ "ProjectSnapshotsResponse", "ProjectState", "PromptAgent", + "PromptAgentDbModel", + "PromptAgentDbModelToolsItem", + "PromptAgentDbModelToolsItem_Client", + "PromptAgentDbModelToolsItem_Mcp", + "PromptAgentDbModelToolsItem_System", + "PromptAgentDbModelToolsItem_Webhook", "PromptAgentInputToolsItem", "PromptAgentInputToolsItem_Client", + "PromptAgentInputToolsItem_Mcp", "PromptAgentInputToolsItem_System", "PromptAgentInputToolsItem_Webhook", "PromptAgentOutputToolsItem", "PromptAgentOutputToolsItem_Client", + "PromptAgentOutputToolsItem_Mcp", "PromptAgentOutputToolsItem_System", "PromptAgentOutputToolsItem_Webhook", "PromptAgentOverride", @@ -1025,15 +1129,24 @@ "SegmentUpdateResponse", "SegmentedJsonExportOptions", "SendText", + "SendTextMulti", "ShareOptionResponseModel", "ShareOptionResponseModelType", + "SimilarVoice", + "SimilarVoiceCategory", + "SimilarVoicesForSpeakerResponse", + "SipMediaEncryptionEnum", + "SipTrunkConfigResponseModel", "SipTrunkCredentials", + "SipTrunkOutboundCallResponse", + "SipTrunkTransportEnum", "SpeakerAudioResponseModel", "SpeakerResponseModel", "SpeakerSegment", "SpeakerSeparationResponseModel", "SpeakerSeparationResponseModelStatus", "SpeakerTrack", + "SpeakerUpdatedResponse", "SpeechHistoryItemResponse", "SpeechHistoryItemResponseModelSource", "SpeechHistoryItemResponseModelVoiceCategory", @@ -1044,6 +1157,8 @@ "SrtExportOptions", "StartPvcVoiceTrainingResponseModel", "StartSpeakerSeparationResponseModel", + "StreamInputQueryParameters", + "StreamInputQueryParametersOptimizeStreamingLatency", "StreamingAudioChunkWithTimestampsResponse", "Subscription", "SubscriptionExtrasResponseModel", @@ -1066,7 +1181,10 @@ "SystemToolConfigOutputParams_TransferToAgent", "SystemToolConfigOutputParams_TransferToNumber", "TelephonyProvider", + "TextToSpeechApplyTextNormalizationEnum", + "TextToSpeechOutputFormatEnum", "TextToSpeechStreamRequest", + "ToolMockConfig", "TransferToAgentToolConfig", "TransferToNumberToolConfig", "TtsConversationalConfig", @@ -1120,6 +1238,8 @@ "WebhookToolApiSchemaConfigOutputRequestHeadersValue", "WebhookToolConfigInput", "WebhookToolConfigOutput", + "WebsocketTtsClientMessageMulti", + "WebsocketTtsServerMessageMulti", "WidgetConfig", "WidgetConfigAvatar", "WidgetConfigAvatar_Image", diff --git a/src/elevenlabs/types/agent_config_db_model.py b/src/elevenlabs/types/agent_config_db_model.py new file mode 100644 index 00000000..3aac0694 --- /dev/null +++ b/src/elevenlabs/types/agent_config_db_model.py @@ -0,0 +1,38 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.unchecked_base_model import UncheckedBaseModel +from .array_json_schema_property_input import ArrayJsonSchemaPropertyInput +from .object_json_schema_property_input import ObjectJsonSchemaPropertyInput +import typing +import pydantic +from .dynamic_variables_config import DynamicVariablesConfig +from .prompt_agent_db_model import PromptAgentDbModel +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class AgentConfigDbModel(UncheckedBaseModel): + first_message: typing.Optional[str] = pydantic.Field(default=None) + """ + If non-empty, the first message the agent will say. If empty, the agent waits for the user to start the discussion. + """ + + language: typing.Optional[str] = pydantic.Field(default=None) + """ + Language of the agent - used for ASR and TTS + """ + + dynamic_variables: typing.Optional[DynamicVariablesConfig] = pydantic.Field(default=None) + """ + Configuration for dynamic variables + """ + + prompt: typing.Optional[PromptAgentDbModel] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/elevenlabs/types/agent_simulated_chat_test_response_model.py b/src/elevenlabs/types/agent_simulated_chat_test_response_model.py new file mode 100644 index 00000000..4038e4fc --- /dev/null +++ b/src/elevenlabs/types/agent_simulated_chat_test_response_model.py @@ -0,0 +1,26 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.unchecked_base_model import UncheckedBaseModel +import typing +from .conversation_history_transcript_common_model_output import ( + ConversationHistoryTranscriptCommonModelOutput, +) +from .conversation_history_analysis_common_model import ( + ConversationHistoryAnalysisCommonModel, +) +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic + + +class AgentSimulatedChatTestResponseModel(UncheckedBaseModel): + simulated_conversation: typing.List[ConversationHistoryTranscriptCommonModelOutput] + analysis: ConversationHistoryAnalysisCommonModel + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/elevenlabs/types/agent_summary_response_model.py b/src/elevenlabs/types/agent_summary_response_model.py index 36d1060c..c441c8c5 100644 --- a/src/elevenlabs/types/agent_summary_response_model.py +++ b/src/elevenlabs/types/agent_summary_response_model.py @@ -18,9 +18,9 @@ class AgentSummaryResponseModel(UncheckedBaseModel): The name of the agent """ - categories: typing.List[str] = pydantic.Field() + tags: typing.List[str] = pydantic.Field() """ - The categories of the agent + Agent tags used to categorize the agent """ created_at_unix_secs: int = pydantic.Field() diff --git a/src/elevenlabs/types/alignment.py b/src/elevenlabs/types/alignment.py index 09f6d96b..269f9360 100644 --- a/src/elevenlabs/types/alignment.py +++ b/src/elevenlabs/types/alignment.py @@ -1,7 +1,9 @@ # This file was auto-generated by Fern from our API Definition. from ..core.unchecked_base_model import UncheckedBaseModel +import typing_extensions import typing +from ..core.serialization import FieldMetadata import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 @@ -11,7 +13,9 @@ class Alignment(UncheckedBaseModel): Alignment information for the generated audio given the input text sequence. """ - char_start_times_ms: typing.Optional[typing.List[int]] = pydantic.Field(default=None) + char_start_times_ms: typing_extensions.Annotated[ + typing.Optional[typing.List[int]], FieldMetadata(alias="charStartTimesMs") + ] = pydantic.Field(default=None) """ A list of starting times (in milliseconds) for each character in the text as it corresponds to the audio. For instance, the character 'H' starts at time 0 ms in the audio. @@ -19,7 +23,9 @@ class Alignment(UncheckedBaseModel): full audio response. """ - chars_durations_ms: typing.Optional[typing.List[int]] = pydantic.Field(default=None) + chars_durations_ms: typing_extensions.Annotated[ + typing.Optional[typing.List[int]], FieldMetadata(alias="charsDurationsMs") + ] = pydantic.Field(default=None) """ A list of durations (in milliseconds) for each character in the text as it corresponds to the audio. For instance, the character 'H' lasts for 3 ms in the audio. @@ -31,7 +37,7 @@ class Alignment(UncheckedBaseModel): """ A list of characters in the text sequence. For instance, the first character is 'H'. Note that this list may contain spaces, punctuation, and other special characters. - The length of this list should be the same as the lengths of `char_start_times_ms` and `chars_durations_ms`. + The length of this list should be the same as the lengths of `charStartTimesMs` and `charsDurationsMs`. """ if IS_PYDANTIC_V2: diff --git a/src/elevenlabs/types/array_json_schema_property_input.py b/src/elevenlabs/types/array_json_schema_property_input.py index ee2a5606..bb63310d 100644 --- a/src/elevenlabs/types/array_json_schema_property_input.py +++ b/src/elevenlabs/types/array_json_schema_property_input.py @@ -10,8 +10,8 @@ class ArrayJsonSchemaPropertyInput(UncheckedBaseModel): type: typing.Optional[typing.Literal["array"]] = None - items: "ArrayJsonSchemaPropertyInputItems" description: typing.Optional[str] = None + items: "ArrayJsonSchemaPropertyInputItems" if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/elevenlabs/types/array_json_schema_property_output.py b/src/elevenlabs/types/array_json_schema_property_output.py index 5af9930c..6ffeb5bc 100644 --- a/src/elevenlabs/types/array_json_schema_property_output.py +++ b/src/elevenlabs/types/array_json_schema_property_output.py @@ -10,8 +10,8 @@ class ArrayJsonSchemaPropertyOutput(UncheckedBaseModel): type: typing.Optional[typing.Literal["array"]] = None - items: "ArrayJsonSchemaPropertyOutputItems" description: typing.Optional[str] = None + items: "ArrayJsonSchemaPropertyOutputItems" if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/elevenlabs/types/audio_output_multi.py b/src/elevenlabs/types/audio_output_multi.py new file mode 100644 index 00000000..2c9a5a42 --- /dev/null +++ b/src/elevenlabs/types/audio_output_multi.py @@ -0,0 +1,39 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.unchecked_base_model import UncheckedBaseModel +import pydantic +import typing_extensions +import typing +from .normalized_alignment import NormalizedAlignment +from ..core.serialization import FieldMetadata +from .alignment import Alignment +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class AudioOutputMulti(UncheckedBaseModel): + """ + Server payload containing an audio chunk for a specific context. + """ + + audio: str = pydantic.Field() + """ + Base64 encoded audio chunk. + """ + + normalized_alignment: typing_extensions.Annotated[ + typing.Optional[NormalizedAlignment], FieldMetadata(alias="normalizedAlignment") + ] = None + alignment: typing.Optional[Alignment] = None + context_id: typing.Optional[str] = pydantic.Field(default=None) + """ + The context_id for which this audio is. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/elevenlabs/types/authorization_method.py b/src/elevenlabs/types/authorization_method.py index 0446c46a..c0c52427 100644 --- a/src/elevenlabs/types/authorization_method.py +++ b/src/elevenlabs/types/authorization_method.py @@ -3,6 +3,14 @@ import typing AuthorizationMethod = typing.Union[ - typing.Literal["invalid", "public", "authorization_header", "signed_url", "shareable_link"], + typing.Literal[ + "invalid", + "public", + "authorization_header", + "signed_url", + "shareable_link", + "livekit_token", + "livekit_token_website", + ], typing.Any, ] diff --git a/src/elevenlabs/types/batch_call_detailed_response.py b/src/elevenlabs/types/batch_call_detailed_response.py new file mode 100644 index 00000000..342438e3 --- /dev/null +++ b/src/elevenlabs/types/batch_call_detailed_response.py @@ -0,0 +1,36 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.unchecked_base_model import UncheckedBaseModel +from .batch_call_status import BatchCallStatus +import typing +from .outbound_call_recipient_response_model import OutboundCallRecipientResponseModel +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic + + +class BatchCallDetailedResponse(UncheckedBaseModel): + """ + Detailed response model for a batch call including all recipients. + """ + + id: str + phone_number_id: str + name: str + agent_id: str + created_at_unix: int + scheduled_time_unix: int + total_calls_dispatched: int + total_calls_scheduled: int + last_updated_at_unix: int + status: BatchCallStatus + agent_name: str + recipients: typing.List[OutboundCallRecipientResponseModel] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/elevenlabs/types/batch_call_recipient_status.py b/src/elevenlabs/types/batch_call_recipient_status.py new file mode 100644 index 00000000..b10cc237 --- /dev/null +++ b/src/elevenlabs/types/batch_call_recipient_status.py @@ -0,0 +1,8 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +BatchCallRecipientStatus = typing.Union[ + typing.Literal["pending", "in_progress", "completed", "failed", "cancelled"], + typing.Any, +] diff --git a/src/elevenlabs/types/batch_call_status.py b/src/elevenlabs/types/batch_call_status.py new file mode 100644 index 00000000..be65cb6b --- /dev/null +++ b/src/elevenlabs/types/batch_call_status.py @@ -0,0 +1,8 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +BatchCallStatus = typing.Union[ + typing.Literal["pending", "in_progress", "completed", "failed", "cancelled"], + typing.Any, +] diff --git a/src/elevenlabs/types/client_tool_config_input.py b/src/elevenlabs/types/client_tool_config_input.py index 28f5b724..8f11940e 100644 --- a/src/elevenlabs/types/client_tool_config_input.py +++ b/src/elevenlabs/types/client_tool_config_input.py @@ -17,6 +17,11 @@ class ClientToolConfigInput(UncheckedBaseModel): id: typing.Optional[str] = None name: str description: str + response_timeout_secs: typing.Optional[int] = pydantic.Field(default=None) + """ + The maximum time in seconds to wait for the tool call to complete. Must be between 1 and 30 seconds (inclusive). + """ + parameters: typing.Optional[ObjectJsonSchemaPropertyInput] = pydantic.Field(default=None) """ Schema for any parameters to pass to the client @@ -27,11 +32,6 @@ class ClientToolConfigInput(UncheckedBaseModel): If true, calling this tool should block the conversation until the client responds with some response which is passed to the llm. If false then we will continue the conversation without waiting for the client to respond, this is useful to show content to a user but not block the conversation """ - response_timeout_secs: typing.Optional[int] = pydantic.Field(default=None) - """ - The maximum time in seconds to wait for a response from the client. Should only be set if expects_response is true - """ - dynamic_variables: typing.Optional[DynamicVariablesConfig] = pydantic.Field(default=None) """ Configuration for dynamic variables diff --git a/src/elevenlabs/types/client_tool_config_output.py b/src/elevenlabs/types/client_tool_config_output.py index 8525744b..1f04b0d3 100644 --- a/src/elevenlabs/types/client_tool_config_output.py +++ b/src/elevenlabs/types/client_tool_config_output.py @@ -17,6 +17,11 @@ class ClientToolConfigOutput(UncheckedBaseModel): id: typing.Optional[str] = None name: str description: str + response_timeout_secs: typing.Optional[int] = pydantic.Field(default=None) + """ + The maximum time in seconds to wait for the tool call to complete. Must be between 1 and 30 seconds (inclusive). + """ + parameters: typing.Optional[ObjectJsonSchemaPropertyOutput] = pydantic.Field(default=None) """ Schema for any parameters to pass to the client @@ -27,11 +32,6 @@ class ClientToolConfigOutput(UncheckedBaseModel): If true, calling this tool should block the conversation until the client responds with some response which is passed to the llm. If false then we will continue the conversation without waiting for the client to respond, this is useful to show content to a user but not block the conversation """ - response_timeout_secs: typing.Optional[int] = pydantic.Field(default=None) - """ - The maximum time in seconds to wait for a response from the client. Should only be set if expects_response is true - """ - dynamic_variables: typing.Optional[DynamicVariablesConfig] = pydantic.Field(default=None) """ Configuration for dynamic variables diff --git a/src/elevenlabs/types/close_context.py b/src/elevenlabs/types/close_context.py new file mode 100644 index 00000000..68fc9cfb --- /dev/null +++ b/src/elevenlabs/types/close_context.py @@ -0,0 +1,31 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.unchecked_base_model import UncheckedBaseModel +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing + + +class CloseContext(UncheckedBaseModel): + """ + Payload to close a specific TTS context. + """ + + context_id: str = pydantic.Field() + """ + The context_id to close. + """ + + close_context: bool = pydantic.Field() + """ + Must set the close_context to true, to close the specified context. If false, the context will remain open and the text will be ignored. If set to true, the context will close. If it has already been set to flush it will continue flushing. The same context id can be used again but will not be linked to the previous context with the same name. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/elevenlabs/types/close_socket.py b/src/elevenlabs/types/close_socket.py new file mode 100644 index 00000000..355688b8 --- /dev/null +++ b/src/elevenlabs/types/close_socket.py @@ -0,0 +1,26 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.unchecked_base_model import UncheckedBaseModel +import typing +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class CloseSocket(UncheckedBaseModel): + """ + Payload to signal closing the entire WebSocket connection. + """ + + close_socket: typing.Optional[bool] = pydantic.Field(default=None) + """ + If true, closes all contexts and closes the entire WebSocket connection. Any context that was previously set to flush will wait to flush before closing. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/elevenlabs/types/profile_page_response_model.py b/src/elevenlabs/types/conversation_history_batch_call_model.py similarity index 65% rename from src/elevenlabs/types/profile_page_response_model.py rename to src/elevenlabs/types/conversation_history_batch_call_model.py index 85c0a003..1b07c5bc 100644 --- a/src/elevenlabs/types/profile_page_response_model.py +++ b/src/elevenlabs/types/conversation_history_batch_call_model.py @@ -1,17 +1,14 @@ # This file was auto-generated by Fern from our API Definition. from ..core.unchecked_base_model import UncheckedBaseModel -import typing from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing import pydantic -class ProfilePageResponseModel(UncheckedBaseModel): - handle: typing.Optional[str] = None - public_user_id: typing.Optional[str] = None - name: typing.Optional[str] = None - bio: typing.Optional[str] = None - profile_picture: typing.Optional[str] = None +class ConversationHistoryBatchCallModel(UncheckedBaseModel): + batch_call_id: str + batch_call_recipient_id: str if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/elevenlabs/types/conversation_history_metadata_common_model.py b/src/elevenlabs/types/conversation_history_metadata_common_model.py index fbef35ab..79122fb4 100644 --- a/src/elevenlabs/types/conversation_history_metadata_common_model.py +++ b/src/elevenlabs/types/conversation_history_metadata_common_model.py @@ -11,6 +11,7 @@ from .conversation_history_metadata_common_model_phone_call import ( ConversationHistoryMetadataCommonModelPhoneCall, ) +from .conversation_history_batch_call_model import ConversationHistoryBatchCallModel from .conversation_history_error_common_model import ConversationHistoryErrorCommonModel from .conversation_history_rag_usage_common_model import ( ConversationHistoryRagUsageCommonModel, @@ -29,6 +30,7 @@ class ConversationHistoryMetadataCommonModel(UncheckedBaseModel): authorization_method: typing.Optional[AuthorizationMethod] = None charging: typing.Optional[ConversationChargingCommonModel] = None phone_call: typing.Optional[ConversationHistoryMetadataCommonModelPhoneCall] = None + batch_call: typing.Optional[ConversationHistoryBatchCallModel] = None termination_reason: typing.Optional[str] = None error: typing.Optional[ConversationHistoryErrorCommonModel] = None main_language: typing.Optional[str] = None diff --git a/src/elevenlabs/types/conversation_history_metadata_common_model_phone_call.py b/src/elevenlabs/types/conversation_history_metadata_common_model_phone_call.py index 2caa5ee7..de0ed913 100644 --- a/src/elevenlabs/types/conversation_history_metadata_common_model_phone_call.py +++ b/src/elevenlabs/types/conversation_history_metadata_common_model_phone_call.py @@ -3,15 +3,36 @@ from __future__ import annotations from ..core.unchecked_base_model import UncheckedBaseModel import typing -from .conversation_history_twilio_phone_call_model_direction import ( - ConversationHistoryTwilioPhoneCallModelDirection, +from .conversation_history_sip_trunking_phone_call_model_direction import ( + ConversationHistorySipTrunkingPhoneCallModelDirection, ) from ..core.pydantic_utilities import IS_PYDANTIC_V2 import pydantic +from .conversation_history_twilio_phone_call_model_direction import ( + ConversationHistoryTwilioPhoneCallModelDirection, +) import typing_extensions from ..core.unchecked_base_model import UnionMetadata +class ConversationHistoryMetadataCommonModelPhoneCall_SipTrunking(UncheckedBaseModel): + type: typing.Literal["sip_trunking"] = "sip_trunking" + direction: ConversationHistorySipTrunkingPhoneCallModelDirection + phone_number_id: str + agent_number: str + external_number: str + call_sid: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + class ConversationHistoryMetadataCommonModelPhoneCall_Twilio(UncheckedBaseModel): type: typing.Literal["twilio"] = "twilio" direction: ConversationHistoryTwilioPhoneCallModelDirection @@ -32,6 +53,9 @@ class Config: ConversationHistoryMetadataCommonModelPhoneCall = typing_extensions.Annotated[ - ConversationHistoryMetadataCommonModelPhoneCall_Twilio, + typing.Union[ + ConversationHistoryMetadataCommonModelPhoneCall_SipTrunking, + ConversationHistoryMetadataCommonModelPhoneCall_Twilio, + ], UnionMetadata(discriminant="type"), ] diff --git a/src/elevenlabs/types/conversation_history_sip_trunking_phone_call_model.py b/src/elevenlabs/types/conversation_history_sip_trunking_phone_call_model.py new file mode 100644 index 00000000..6d508427 --- /dev/null +++ b/src/elevenlabs/types/conversation_history_sip_trunking_phone_call_model.py @@ -0,0 +1,26 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.unchecked_base_model import UncheckedBaseModel +from .conversation_history_sip_trunking_phone_call_model_direction import ( + ConversationHistorySipTrunkingPhoneCallModelDirection, +) +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing +import pydantic + + +class ConversationHistorySipTrunkingPhoneCallModel(UncheckedBaseModel): + direction: ConversationHistorySipTrunkingPhoneCallModelDirection + phone_number_id: str + agent_number: str + external_number: str + call_sid: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/elevenlabs/types/conversation_history_sip_trunking_phone_call_model_direction.py b/src/elevenlabs/types/conversation_history_sip_trunking_phone_call_model_direction.py new file mode 100644 index 00000000..37a3c7a9 --- /dev/null +++ b/src/elevenlabs/types/conversation_history_sip_trunking_phone_call_model_direction.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +ConversationHistorySipTrunkingPhoneCallModelDirection = typing.Union[typing.Literal["inbound", "outbound"], typing.Any] diff --git a/src/elevenlabs/types/conversation_history_transcript_common_model.py b/src/elevenlabs/types/conversation_history_transcript_common_model_input.py similarity index 80% rename from src/elevenlabs/types/conversation_history_transcript_common_model.py rename to src/elevenlabs/types/conversation_history_transcript_common_model_input.py index 1b027868..855fd684 100644 --- a/src/elevenlabs/types/conversation_history_transcript_common_model.py +++ b/src/elevenlabs/types/conversation_history_transcript_common_model_input.py @@ -1,8 +1,8 @@ # This file was auto-generated by Fern from our API Definition. from ..core.unchecked_base_model import UncheckedBaseModel -from .conversation_history_transcript_common_model_role import ( - ConversationHistoryTranscriptCommonModelRole, +from .conversation_history_transcript_common_model_input_role import ( + ConversationHistoryTranscriptCommonModelInputRole, ) import typing from .conversation_history_transcript_tool_call_common_model import ( @@ -14,13 +14,13 @@ from .user_feedback import UserFeedback from .conversation_turn_metrics import ConversationTurnMetrics from .rag_retrieval_info import RagRetrievalInfo -from .llm_usage import LlmUsage +from .llm_usage_input import LlmUsageInput from ..core.pydantic_utilities import IS_PYDANTIC_V2 import pydantic -class ConversationHistoryTranscriptCommonModel(UncheckedBaseModel): - role: ConversationHistoryTranscriptCommonModelRole +class ConversationHistoryTranscriptCommonModelInput(UncheckedBaseModel): + role: ConversationHistoryTranscriptCommonModelInputRole message: typing.Optional[str] = None tool_calls: typing.Optional[typing.List[ConversationHistoryTranscriptToolCallCommonModel]] = None tool_results: typing.Optional[typing.List[ConversationHistoryTranscriptToolResultCommonModel]] = None @@ -29,7 +29,7 @@ class ConversationHistoryTranscriptCommonModel(UncheckedBaseModel): time_in_call_secs: int conversation_turn_metrics: typing.Optional[ConversationTurnMetrics] = None rag_retrieval_info: typing.Optional[RagRetrievalInfo] = None - llm_usage: typing.Optional[LlmUsage] = None + llm_usage: typing.Optional[LlmUsageInput] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/elevenlabs/types/conversation_history_transcript_common_model_input_role.py b/src/elevenlabs/types/conversation_history_transcript_common_model_input_role.py new file mode 100644 index 00000000..0ced1587 --- /dev/null +++ b/src/elevenlabs/types/conversation_history_transcript_common_model_input_role.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +ConversationHistoryTranscriptCommonModelInputRole = typing.Union[typing.Literal["user", "agent"], typing.Any] diff --git a/src/elevenlabs/types/conversation_history_transcript_common_model_output.py b/src/elevenlabs/types/conversation_history_transcript_common_model_output.py new file mode 100644 index 00000000..8792c17e --- /dev/null +++ b/src/elevenlabs/types/conversation_history_transcript_common_model_output.py @@ -0,0 +1,41 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.unchecked_base_model import UncheckedBaseModel +from .conversation_history_transcript_common_model_output_role import ( + ConversationHistoryTranscriptCommonModelOutputRole, +) +import typing +from .conversation_history_transcript_tool_call_common_model import ( + ConversationHistoryTranscriptToolCallCommonModel, +) +from .conversation_history_transcript_tool_result_common_model import ( + ConversationHistoryTranscriptToolResultCommonModel, +) +from .user_feedback import UserFeedback +from .conversation_turn_metrics import ConversationTurnMetrics +from .rag_retrieval_info import RagRetrievalInfo +from .llm_usage_output import LlmUsageOutput +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic + + +class ConversationHistoryTranscriptCommonModelOutput(UncheckedBaseModel): + role: ConversationHistoryTranscriptCommonModelOutputRole + message: typing.Optional[str] = None + tool_calls: typing.Optional[typing.List[ConversationHistoryTranscriptToolCallCommonModel]] = None + tool_results: typing.Optional[typing.List[ConversationHistoryTranscriptToolResultCommonModel]] = None + feedback: typing.Optional[UserFeedback] = None + llm_override: typing.Optional[str] = None + time_in_call_secs: int + conversation_turn_metrics: typing.Optional[ConversationTurnMetrics] = None + rag_retrieval_info: typing.Optional[RagRetrievalInfo] = None + llm_usage: typing.Optional[LlmUsageOutput] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/elevenlabs/types/conversation_history_transcript_common_model_output_role.py b/src/elevenlabs/types/conversation_history_transcript_common_model_output_role.py new file mode 100644 index 00000000..2ee8fce3 --- /dev/null +++ b/src/elevenlabs/types/conversation_history_transcript_common_model_output_role.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +ConversationHistoryTranscriptCommonModelOutputRole = typing.Union[typing.Literal["user", "agent"], typing.Any] diff --git a/src/elevenlabs/types/conversation_history_transcript_common_model_role.py b/src/elevenlabs/types/conversation_history_transcript_common_model_role.py deleted file mode 100644 index 1964c6f2..00000000 --- a/src/elevenlabs/types/conversation_history_transcript_common_model_role.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -ConversationHistoryTranscriptCommonModelRole = typing.Union[typing.Literal["user", "agent"], typing.Any] diff --git a/src/elevenlabs/types/conversation_initiation_client_data_internal.py b/src/elevenlabs/types/conversation_initiation_client_data_internal.py new file mode 100644 index 00000000..179b3031 --- /dev/null +++ b/src/elevenlabs/types/conversation_initiation_client_data_internal.py @@ -0,0 +1,32 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.unchecked_base_model import UncheckedBaseModel +import typing +from .conversation_config_client_override_output import ( + ConversationConfigClientOverrideOutput, +) +from .conversation_initiation_client_data_internal_dynamic_variables_value import ( + ConversationInitiationClientDataInternalDynamicVariablesValue, +) +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic + + +class ConversationInitiationClientDataInternal(UncheckedBaseModel): + conversation_config_override: typing.Optional[ConversationConfigClientOverrideOutput] = None + custom_llm_extra_body: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None + dynamic_variables: typing.Optional[ + typing.Dict[ + str, + typing.Optional[ConversationInitiationClientDataInternalDynamicVariablesValue], + ] + ] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/elevenlabs/types/conversation_initiation_client_data_internal_dynamic_variables_value.py b/src/elevenlabs/types/conversation_initiation_client_data_internal_dynamic_variables_value.py new file mode 100644 index 00000000..1b088e76 --- /dev/null +++ b/src/elevenlabs/types/conversation_initiation_client_data_internal_dynamic_variables_value.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +ConversationInitiationClientDataInternalDynamicVariablesValue = typing.Union[str, float, int, bool] diff --git a/src/elevenlabs/types/conversation_simulation_specification.py b/src/elevenlabs/types/conversation_simulation_specification.py new file mode 100644 index 00000000..71c6468e --- /dev/null +++ b/src/elevenlabs/types/conversation_simulation_specification.py @@ -0,0 +1,37 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.unchecked_base_model import UncheckedBaseModel +from .array_json_schema_property_input import ArrayJsonSchemaPropertyInput +from .object_json_schema_property_input import ObjectJsonSchemaPropertyInput +from .agent_config_db_model import AgentConfigDbModel +import typing +from .tool_mock_config import ToolMockConfig +from .conversation_history_transcript_common_model_input import ( + ConversationHistoryTranscriptCommonModelInput, +) +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class ConversationSimulationSpecification(UncheckedBaseModel): + """ + A specification that will be used to simulate a conversation between an agent and an AI user. + """ + + simulated_user_config: AgentConfigDbModel + tool_mock_config: typing.Optional[typing.Dict[str, ToolMockConfig]] = None + partial_conversation_history: typing.Optional[typing.List[ConversationHistoryTranscriptCommonModelInput]] = ( + pydantic.Field(default=None) + ) + """ + A partial conversation history to start the simulation from. If empty, simulation starts fresh. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/elevenlabs/types/create_sip_trunk_phone_number_request.py b/src/elevenlabs/types/create_sip_trunk_phone_number_request.py index c0b2e604..38fadb4a 100644 --- a/src/elevenlabs/types/create_sip_trunk_phone_number_request.py +++ b/src/elevenlabs/types/create_sip_trunk_phone_number_request.py @@ -3,7 +3,8 @@ from ..core.unchecked_base_model import UncheckedBaseModel import pydantic import typing -from .telephony_provider import TelephonyProvider +from .sip_trunk_transport_enum import SipTrunkTransportEnum +from .sip_media_encryption_enum import SipMediaEncryptionEnum from .sip_trunk_credentials import SipTrunkCredentials from ..core.pydantic_utilities import IS_PYDANTIC_V2 @@ -22,7 +23,6 @@ class CreateSipTrunkPhoneNumberRequest(UncheckedBaseModel): Phone number """ - provider: typing.Optional[TelephonyProvider] = None label: str = pydantic.Field() """ Label for the phone number @@ -33,6 +33,26 @@ class CreateSipTrunkPhoneNumberRequest(UncheckedBaseModel): SIP trunk termination URI """ + address: typing.Optional[str] = pydantic.Field(default=None) + """ + Hostname or IP the SIP INVITE is sent to. + """ + + transport: typing.Optional[SipTrunkTransportEnum] = pydantic.Field(default=None) + """ + Protocol to use for SIP transport (signalling layer). + """ + + media_encryption: typing.Optional[SipMediaEncryptionEnum] = pydantic.Field(default=None) + """ + Whether or not to encrypt media (data layer). + """ + + headers: typing.Optional[typing.Dict[str, str]] = pydantic.Field(default=None) + """ + SIP X-* headers for INVITE request. These headers are sent as-is and may help identify this call. + """ + credentials: typing.Optional[SipTrunkCredentials] = pydantic.Field(default=None) """ Optional digest authentication credentials (username/password). If not provided, ACL authentication is assumed. diff --git a/src/elevenlabs/types/create_twilio_phone_number_request.py b/src/elevenlabs/types/create_twilio_phone_number_request.py index 6f189efb..fa9870d3 100644 --- a/src/elevenlabs/types/create_twilio_phone_number_request.py +++ b/src/elevenlabs/types/create_twilio_phone_number_request.py @@ -2,9 +2,8 @@ from ..core.unchecked_base_model import UncheckedBaseModel import pydantic -import typing -from .telephony_provider import TelephonyProvider from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing class CreateTwilioPhoneNumberRequest(UncheckedBaseModel): @@ -13,7 +12,6 @@ class CreateTwilioPhoneNumberRequest(UncheckedBaseModel): Phone number """ - provider: typing.Optional[TelephonyProvider] = None label: str = pydantic.Field() """ Label for the phone number diff --git a/src/elevenlabs/types/dashboard_data_collection_chart_model.py b/src/elevenlabs/types/dashboard_data_collection_chart_model.py new file mode 100644 index 00000000..724d49b4 --- /dev/null +++ b/src/elevenlabs/types/dashboard_data_collection_chart_model.py @@ -0,0 +1,20 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.unchecked_base_model import UncheckedBaseModel +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing +import pydantic + + +class DashboardDataCollectionChartModel(UncheckedBaseModel): + name: str + data_collection_id: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/elevenlabs/types/dubbed_segment.py b/src/elevenlabs/types/dubbed_segment.py index aa198028..e628a510 100644 --- a/src/elevenlabs/types/dubbed_segment.py +++ b/src/elevenlabs/types/dubbed_segment.py @@ -11,6 +11,7 @@ class DubbedSegment(UncheckedBaseModel): start_time: float end_time: float text: typing.Optional[str] = None + audio_stale: bool media_ref: typing.Optional[DubbingMediaReference] = None if IS_PYDANTIC_V2: diff --git a/src/elevenlabs/types/final_output_multi.py b/src/elevenlabs/types/final_output_multi.py new file mode 100644 index 00000000..f2cee7ea --- /dev/null +++ b/src/elevenlabs/types/final_output_multi.py @@ -0,0 +1,37 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.unchecked_base_model import UncheckedBaseModel +import typing_extensions +import typing +from ..core.serialization import FieldMetadata +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class FinalOutputMulti(UncheckedBaseModel): + """ + Server payload indicating the final output for a specific context. + """ + + is_final: typing_extensions.Annotated[typing.Literal[True], FieldMetadata(alias="isFinal")] = pydantic.Field( + default=True + ) + """ + Indicates this is the final message for the context. + """ + + context_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="contextId")] = pydantic.Field( + default=None + ) + """ + The context_id for which this is the final message. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/elevenlabs/types/flush_context.py b/src/elevenlabs/types/flush_context.py new file mode 100644 index 00000000..c828fe55 --- /dev/null +++ b/src/elevenlabs/types/flush_context.py @@ -0,0 +1,36 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.unchecked_base_model import UncheckedBaseModel +import pydantic +import typing +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class FlushContext(UncheckedBaseModel): + """ + Payload to flush the audio buffer for a specific context. + """ + + context_id: str = pydantic.Field() + """ + The context_id to flush. + """ + + text: typing.Optional[str] = pydantic.Field(default=None) + """ + The text to append to the buffer to be flushed. + """ + + flush: bool = pydantic.Field() + """ + If true, flushes the audio buffer for the specified context. If false, the context will remain open and the text will be appended to the buffer to be generated. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/elevenlabs/types/get_agent_response_model.py b/src/elevenlabs/types/get_agent_response_model.py index 3e2d4370..930b3549 100644 --- a/src/elevenlabs/types/get_agent_response_model.py +++ b/src/elevenlabs/types/get_agent_response_model.py @@ -6,7 +6,7 @@ from .agent_metadata_response_model import AgentMetadataResponseModel import typing from .agent_platform_settings_response_model import AgentPlatformSettingsResponseModel -from .get_phone_number_response_model import GetPhoneNumberResponseModel +from .get_phone_number_response import GetPhoneNumberResponse from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs @@ -36,7 +36,7 @@ class GetAgentResponseModel(UncheckedBaseModel): The platform settings of the agent """ - phone_numbers: typing.Optional[typing.List[GetPhoneNumberResponseModel]] = pydantic.Field(default=None) + phone_numbers: typing.Optional[typing.List[GetPhoneNumberResponse]] = pydantic.Field(default=None) """ The phone numbers of the agent """ diff --git a/src/elevenlabs/types/get_agent_response_model_phone_numbers_item.py b/src/elevenlabs/types/get_agent_response_model_phone_numbers_item.py new file mode 100644 index 00000000..92388366 --- /dev/null +++ b/src/elevenlabs/types/get_agent_response_model_phone_numbers_item.py @@ -0,0 +1,55 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.unchecked_base_model import UncheckedBaseModel +import typing +from .phone_number_agent_info import PhoneNumberAgentInfo +from .sip_trunk_config_response_model import SipTrunkConfigResponseModel +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +import typing_extensions +from ..core.unchecked_base_model import UnionMetadata + + +class GetAgentResponseModelPhoneNumbersItem_SipTrunk(UncheckedBaseModel): + provider: typing.Literal["sip_trunk"] = "sip_trunk" + phone_number: str + label: str + phone_number_id: str + assigned_agent: typing.Optional[PhoneNumberAgentInfo] = None + provider_config: typing.Optional[SipTrunkConfigResponseModel] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class GetAgentResponseModelPhoneNumbersItem_Twilio(UncheckedBaseModel): + provider: typing.Literal["twilio"] = "twilio" + phone_number: str + label: str + phone_number_id: str + assigned_agent: typing.Optional[PhoneNumberAgentInfo] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +GetAgentResponseModelPhoneNumbersItem = typing_extensions.Annotated[ + typing.Union[ + GetAgentResponseModelPhoneNumbersItem_SipTrunk, + GetAgentResponseModelPhoneNumbersItem_Twilio, + ], + UnionMetadata(discriminant="provider"), +] diff --git a/src/elevenlabs/types/get_conv_ai_dashboard_settings_response_model_charts_item.py b/src/elevenlabs/types/get_conv_ai_dashboard_settings_response_model_charts_item.py index 9152c4ca..bdbfc337 100644 --- a/src/elevenlabs/types/get_conv_ai_dashboard_settings_response_model_charts_item.py +++ b/src/elevenlabs/types/get_conv_ai_dashboard_settings_response_model_charts_item.py @@ -38,10 +38,26 @@ class Config: extra = pydantic.Extra.allow +class GetConvAiDashboardSettingsResponseModelChartsItem_DataCollection(UncheckedBaseModel): + type: typing.Literal["data_collection"] = "data_collection" + name: str + data_collection_id: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + GetConvAiDashboardSettingsResponseModelChartsItem = typing_extensions.Annotated[ typing.Union[ GetConvAiDashboardSettingsResponseModelChartsItem_CallSuccess, GetConvAiDashboardSettingsResponseModelChartsItem_Criteria, + GetConvAiDashboardSettingsResponseModelChartsItem_DataCollection, ], UnionMetadata(discriminant="type"), ] diff --git a/src/elevenlabs/types/get_conv_ai_settings_response_model.py b/src/elevenlabs/types/get_conv_ai_settings_response_model.py index 05444280..8694b4ea 100644 --- a/src/elevenlabs/types/get_conv_ai_settings_response_model.py +++ b/src/elevenlabs/types/get_conv_ai_settings_response_model.py @@ -13,6 +13,7 @@ class GetConvAiSettingsResponseModel(UncheckedBaseModel): conversation_initiation_client_data_webhook: typing.Optional[ConversationInitiationClientDataWebhook] = None webhooks: typing.Optional[ConvAiWebhooks] = None + rag_retention_period_days: typing.Optional[int] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/elevenlabs/types/get_conversation_response_model.py b/src/elevenlabs/types/get_conversation_response_model.py index a049f515..246b0f90 100644 --- a/src/elevenlabs/types/get_conversation_response_model.py +++ b/src/elevenlabs/types/get_conversation_response_model.py @@ -3,8 +3,8 @@ from ..core.unchecked_base_model import UncheckedBaseModel from .get_conversation_response_model_status import GetConversationResponseModelStatus import typing -from .conversation_history_transcript_common_model import ( - ConversationHistoryTranscriptCommonModel, +from .conversation_history_transcript_common_model_output import ( + ConversationHistoryTranscriptCommonModelOutput, ) from .conversation_history_metadata_common_model import ( ConversationHistoryMetadataCommonModel, @@ -23,7 +23,7 @@ class GetConversationResponseModel(UncheckedBaseModel): agent_id: str conversation_id: str status: GetConversationResponseModelStatus - transcript: typing.List[ConversationHistoryTranscriptCommonModel] + transcript: typing.List[ConversationHistoryTranscriptCommonModelOutput] metadata: ConversationHistoryMetadataCommonModel analysis: typing.Optional[ConversationHistoryAnalysisCommonModel] = None conversation_initiation_client_data: typing.Optional[ConversationInitiationClientDataRequestOutput] = None diff --git a/src/elevenlabs/types/get_phone_number_response.py b/src/elevenlabs/types/get_phone_number_response.py new file mode 100644 index 00000000..dbfa4178 --- /dev/null +++ b/src/elevenlabs/types/get_phone_number_response.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +GetPhoneNumberResponse = typing.Optional[typing.Any] diff --git a/src/elevenlabs/types/get_phone_number_sip_trunk_response_model.py b/src/elevenlabs/types/get_phone_number_sip_trunk_response_model.py new file mode 100644 index 00000000..c5d85b6d --- /dev/null +++ b/src/elevenlabs/types/get_phone_number_sip_trunk_response_model.py @@ -0,0 +1,41 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.unchecked_base_model import UncheckedBaseModel +import pydantic +import typing +from .phone_number_agent_info import PhoneNumberAgentInfo +from .sip_trunk_config_response_model import SipTrunkConfigResponseModel +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class GetPhoneNumberSipTrunkResponseModel(UncheckedBaseModel): + phone_number: str = pydantic.Field() + """ + Phone number + """ + + label: str = pydantic.Field() + """ + Label for the phone number + """ + + phone_number_id: str = pydantic.Field() + """ + The ID of the phone number + """ + + assigned_agent: typing.Optional[PhoneNumberAgentInfo] = pydantic.Field(default=None) + """ + The agent that is assigned to the phone number + """ + + provider_config: typing.Optional[SipTrunkConfigResponseModel] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/elevenlabs/types/get_phone_number_response_model.py b/src/elevenlabs/types/get_phone_number_twilio_response_model.py similarity index 83% rename from src/elevenlabs/types/get_phone_number_response_model.py rename to src/elevenlabs/types/get_phone_number_twilio_response_model.py index b3097436..f7c1d297 100644 --- a/src/elevenlabs/types/get_phone_number_response_model.py +++ b/src/elevenlabs/types/get_phone_number_twilio_response_model.py @@ -2,23 +2,17 @@ from ..core.unchecked_base_model import UncheckedBaseModel import pydantic -from .telephony_provider import TelephonyProvider import typing from .phone_number_agent_info import PhoneNumberAgentInfo from ..core.pydantic_utilities import IS_PYDANTIC_V2 -class GetPhoneNumberResponseModel(UncheckedBaseModel): +class GetPhoneNumberTwilioResponseModel(UncheckedBaseModel): phone_number: str = pydantic.Field() """ Phone number """ - provider: TelephonyProvider = pydantic.Field() - """ - Phone provider - """ - label: str = pydantic.Field() """ Label for the phone number diff --git a/src/elevenlabs/types/initialise_context.py b/src/elevenlabs/types/initialise_context.py new file mode 100644 index 00000000..d80b9f97 --- /dev/null +++ b/src/elevenlabs/types/initialise_context.py @@ -0,0 +1,53 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.unchecked_base_model import UncheckedBaseModel +import pydantic +import typing +from .realtime_voice_settings import RealtimeVoiceSettings +from .generation_config import GenerationConfig +from .pronunciation_dictionary_locator import PronunciationDictionaryLocator +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class InitialiseContext(UncheckedBaseModel): + """ + Payload to initialize or re-initialize a TTS context with specific settings and initial text for multi-stream connections. + """ + + text: str = pydantic.Field() + """ + The initial text to synthesize. Should end with a single space. + """ + + voice_settings: typing.Optional[RealtimeVoiceSettings] = None + generation_config: typing.Optional[GenerationConfig] = None + pronunciation_dictionary_locators: typing.Optional[typing.List[PronunciationDictionaryLocator]] = pydantic.Field( + default=None + ) + """ + Optional list of pronunciation dictionary locators to be used for this context. + """ + + xi_api_key: typing.Optional[str] = pydantic.Field(default=None) + """ + Your ElevenLabs API key. Required if not provided in the WebSocket connection's header or query parameters. This applies to the (re)initialization of this specific context. + """ + + authorization: typing.Optional[str] = pydantic.Field(default=None) + """ + Your authorization bearer token. Required if not provided in the WebSocket connection's header or query parameters. This applies to the (re)initialization of this specific context. + """ + + context_id: typing.Optional[str] = pydantic.Field(default=None) + """ + An identifier for the text-to-speech context. If omitted, a default context ID may be assigned by the server. If provided, this message will create a new context with this ID or re-initialize an existing one with the new settings and text. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/elevenlabs/types/initialize_connection_multi.py b/src/elevenlabs/types/initialize_connection_multi.py new file mode 100644 index 00000000..e792c301 --- /dev/null +++ b/src/elevenlabs/types/initialize_connection_multi.py @@ -0,0 +1,53 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.unchecked_base_model import UncheckedBaseModel +import typing +import pydantic +from .realtime_voice_settings import RealtimeVoiceSettings +from .generation_config import GenerationConfig +from .pronunciation_dictionary_locator import PronunciationDictionaryLocator +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class InitializeConnectionMulti(UncheckedBaseModel): + """ + Payload to initialize a new context in a multi-stream WebSocket connection. + """ + + text: typing.Literal[" "] = pydantic.Field(default=" ") + """ + Must be a single space character to initiate the context. + """ + + voice_settings: typing.Optional[RealtimeVoiceSettings] = None + generation_config: typing.Optional[GenerationConfig] = None + pronunciation_dictionary_locators: typing.Optional[typing.List[PronunciationDictionaryLocator]] = pydantic.Field( + default=None + ) + """ + Optional pronunciation dictionaries for this context. + """ + + xi_api_key: typing.Optional[str] = pydantic.Field(default=None) + """ + Your ElevenLabs API key (if not in header). For this context's first message only. + """ + + authorization: typing.Optional[str] = pydantic.Field(default=None) + """ + Your authorization bearer token (if not in header). For this context's first message only. + """ + + context_id: typing.Optional[str] = pydantic.Field(default=None) + """ + A unique identifier for the first context created in the websocket. If not provided, a default context will be used. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/elevenlabs/types/keep_context_alive.py b/src/elevenlabs/types/keep_context_alive.py new file mode 100644 index 00000000..7cbe0a2f --- /dev/null +++ b/src/elevenlabs/types/keep_context_alive.py @@ -0,0 +1,31 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.unchecked_base_model import UncheckedBaseModel +import typing +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class KeepContextAlive(UncheckedBaseModel): + """ + Payload to keep a specific context alive by resetting its inactivity timeout. Empty text is ignored but resets the clock. + """ + + text: typing.Literal[""] = pydantic.Field(default="") + """ + An empty string. This text is ignored by the server but its presence resets the inactivity timeout for the specified context. + """ + + context_id: str = pydantic.Field() + """ + The identifier of the context to keep alive. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/elevenlabs/types/llm_category_usage.py b/src/elevenlabs/types/llm_category_usage.py index baf8cad9..0ead264f 100644 --- a/src/elevenlabs/types/llm_category_usage.py +++ b/src/elevenlabs/types/llm_category_usage.py @@ -2,14 +2,14 @@ from ..core.unchecked_base_model import UncheckedBaseModel import typing -from .llm_usage import LlmUsage +from .llm_usage_output import LlmUsageOutput from ..core.pydantic_utilities import IS_PYDANTIC_V2 import pydantic class LlmCategoryUsage(UncheckedBaseModel): - irreversible_generation: typing.Optional[LlmUsage] = None - initiated_generation: typing.Optional[LlmUsage] = None + irreversible_generation: typing.Optional[LlmUsageOutput] = None + initiated_generation: typing.Optional[LlmUsageOutput] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/elevenlabs/types/llm_usage.py b/src/elevenlabs/types/llm_usage_input.py similarity index 94% rename from src/elevenlabs/types/llm_usage.py rename to src/elevenlabs/types/llm_usage_input.py index 9c9295b6..07b5b155 100644 --- a/src/elevenlabs/types/llm_usage.py +++ b/src/elevenlabs/types/llm_usage_input.py @@ -7,7 +7,7 @@ import pydantic -class LlmUsage(UncheckedBaseModel): +class LlmUsageInput(UncheckedBaseModel): model_usage: typing.Optional[typing.Dict[str, LlmInputOutputTokensUsage]] = None if IS_PYDANTIC_V2: diff --git a/src/elevenlabs/types/llm_usage_output.py b/src/elevenlabs/types/llm_usage_output.py new file mode 100644 index 00000000..d36cf769 --- /dev/null +++ b/src/elevenlabs/types/llm_usage_output.py @@ -0,0 +1,20 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.unchecked_base_model import UncheckedBaseModel +import typing +from .llm_input_output_tokens_usage import LlmInputOutputTokensUsage +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic + + +class LlmUsageOutput(UncheckedBaseModel): + model_usage: typing.Optional[typing.Dict[str, LlmInputOutputTokensUsage]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/elevenlabs/types/mcp_tool_config_input.py b/src/elevenlabs/types/mcp_tool_config_input.py new file mode 100644 index 00000000..a8b9e71c --- /dev/null +++ b/src/elevenlabs/types/mcp_tool_config_input.py @@ -0,0 +1,46 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.unchecked_base_model import UncheckedBaseModel +from .array_json_schema_property_input import ArrayJsonSchemaPropertyInput +from .object_json_schema_property_input import ObjectJsonSchemaPropertyInput +import typing +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class McpToolConfigInput(UncheckedBaseModel): + """ + A MCP tool is a tool that is used to call a MCP server + """ + + id: typing.Optional[str] = None + name: str + description: str + response_timeout_secs: typing.Optional[int] = pydantic.Field(default=None) + """ + The maximum time in seconds to wait for the tool call to complete. + """ + + parameters: typing.Optional[ObjectJsonSchemaPropertyInput] = pydantic.Field(default=None) + """ + Schema for any parameters the LLM needs to provide to the MCP tool. + """ + + mcp_tool_name: str = pydantic.Field() + """ + The name of the MCP tool to call + """ + + mcp_server_id: str = pydantic.Field() + """ + The id of the MCP server to call + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/elevenlabs/types/mcp_tool_config_output.py b/src/elevenlabs/types/mcp_tool_config_output.py new file mode 100644 index 00000000..57964a2f --- /dev/null +++ b/src/elevenlabs/types/mcp_tool_config_output.py @@ -0,0 +1,46 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.unchecked_base_model import UncheckedBaseModel +from .array_json_schema_property_output import ArrayJsonSchemaPropertyOutput +from .object_json_schema_property_output import ObjectJsonSchemaPropertyOutput +import typing +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class McpToolConfigOutput(UncheckedBaseModel): + """ + A MCP tool is a tool that is used to call a MCP server + """ + + id: typing.Optional[str] = None + name: str + description: str + response_timeout_secs: typing.Optional[int] = pydantic.Field(default=None) + """ + The maximum time in seconds to wait for the tool call to complete. + """ + + parameters: typing.Optional[ObjectJsonSchemaPropertyOutput] = pydantic.Field(default=None) + """ + Schema for any parameters the LLM needs to provide to the MCP tool. + """ + + mcp_tool_name: str = pydantic.Field() + """ + The name of the MCP tool to call + """ + + mcp_server_id: str = pydantic.Field() + """ + The id of the MCP server to call + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/elevenlabs/types/normalized_alignment.py b/src/elevenlabs/types/normalized_alignment.py index f83624ea..080e09b8 100644 --- a/src/elevenlabs/types/normalized_alignment.py +++ b/src/elevenlabs/types/normalized_alignment.py @@ -1,7 +1,9 @@ # This file was auto-generated by Fern from our API Definition. from ..core.unchecked_base_model import UncheckedBaseModel +import typing_extensions import typing +from ..core.serialization import FieldMetadata import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 @@ -11,7 +13,9 @@ class NormalizedAlignment(UncheckedBaseModel): Alignment information for the generated audio given the input normalized text sequence. """ - char_start_times_ms: typing.Optional[typing.List[int]] = pydantic.Field(default=None) + char_start_times_ms: typing_extensions.Annotated[ + typing.Optional[typing.List[int]], FieldMetadata(alias="charStartTimesMs") + ] = pydantic.Field(default=None) """ A list of starting times (in milliseconds) for each character in the normalized text as it corresponds to the audio. For instance, the character 'H' starts at time 0 ms in the audio. @@ -19,7 +23,9 @@ class NormalizedAlignment(UncheckedBaseModel): full audio response. """ - chars_durations_ms: typing.Optional[typing.List[int]] = pydantic.Field(default=None) + chars_durations_ms: typing_extensions.Annotated[ + typing.Optional[typing.List[int]], FieldMetadata(alias="charsDurationsMs") + ] = pydantic.Field(default=None) """ A list of durations (in milliseconds) for each character in the normalized text as it corresponds to the audio. For instance, the character 'H' lasts for 3 ms in the audio. @@ -31,7 +37,7 @@ class NormalizedAlignment(UncheckedBaseModel): """ A list of characters in the normalized text sequence. For instance, the first character is 'H'. Note that this list may contain spaces, punctuation, and other special characters. - The length of this list should be the same as the lengths of `char_start_times_ms` and `chars_durations_ms`. + The length of this list should be the same as the lengths of `charStartTimesMs` and `charsDurationsMs`. """ if IS_PYDANTIC_V2: diff --git a/src/elevenlabs/types/object_json_schema_property_input.py b/src/elevenlabs/types/object_json_schema_property_input.py index 6ee1a21a..4ae2b0cf 100644 --- a/src/elevenlabs/types/object_json_schema_property_input.py +++ b/src/elevenlabs/types/object_json_schema_property_input.py @@ -10,9 +10,9 @@ class ObjectJsonSchemaPropertyInput(UncheckedBaseModel): type: typing.Optional[typing.Literal["object"]] = None - properties: typing.Optional[typing.Dict[str, "ObjectJsonSchemaPropertyInputPropertiesValue"]] = None required: typing.Optional[typing.List[str]] = None description: typing.Optional[str] = None + properties: typing.Optional[typing.Dict[str, "ObjectJsonSchemaPropertyInputPropertiesValue"]] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/elevenlabs/types/object_json_schema_property_output.py b/src/elevenlabs/types/object_json_schema_property_output.py index c378cf0c..fccd366f 100644 --- a/src/elevenlabs/types/object_json_schema_property_output.py +++ b/src/elevenlabs/types/object_json_schema_property_output.py @@ -10,9 +10,9 @@ class ObjectJsonSchemaPropertyOutput(UncheckedBaseModel): type: typing.Optional[typing.Literal["object"]] = None - properties: typing.Optional[typing.Dict[str, "ObjectJsonSchemaPropertyOutputPropertiesValue"]] = None required: typing.Optional[typing.List[str]] = None description: typing.Optional[str] = None + properties: typing.Optional[typing.Dict[str, "ObjectJsonSchemaPropertyOutputPropertiesValue"]] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/elevenlabs/types/outbound_call_recipient_response_model.py b/src/elevenlabs/types/outbound_call_recipient_response_model.py new file mode 100644 index 00000000..192ebf80 --- /dev/null +++ b/src/elevenlabs/types/outbound_call_recipient_response_model.py @@ -0,0 +1,29 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.unchecked_base_model import UncheckedBaseModel +from .batch_call_recipient_status import BatchCallRecipientStatus +import typing +from .conversation_initiation_client_data_internal import ( + ConversationInitiationClientDataInternal, +) +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic + + +class OutboundCallRecipientResponseModel(UncheckedBaseModel): + id: str + phone_number: str + status: BatchCallRecipientStatus + created_at_unix: int + updated_at_unix: int + conversation_id: typing.Optional[str] = None + conversation_initiation_client_data: typing.Optional[ConversationInitiationClientDataInternal] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/elevenlabs/types/privacy_config.py b/src/elevenlabs/types/privacy_config.py index 41fb7d90..36a63e3a 100644 --- a/src/elevenlabs/types/privacy_config.py +++ b/src/elevenlabs/types/privacy_config.py @@ -32,6 +32,11 @@ class PrivacyConfig(UncheckedBaseModel): Whether to apply the privacy settings to existing conversations """ + zero_retention_mode: typing.Optional[bool] = pydantic.Field(default=None) + """ + Whether to enable zero retention mode - no PII data is stored + """ + if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: diff --git a/src/elevenlabs/types/prompt_agent_db_model.py b/src/elevenlabs/types/prompt_agent_db_model.py new file mode 100644 index 00000000..eab7c27a --- /dev/null +++ b/src/elevenlabs/types/prompt_agent_db_model.py @@ -0,0 +1,81 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.unchecked_base_model import UncheckedBaseModel +from .array_json_schema_property_input import ArrayJsonSchemaPropertyInput +from .object_json_schema_property_input import ObjectJsonSchemaPropertyInput +import typing +import pydantic +from .llm import Llm +from .prompt_agent_db_model_tools_item import PromptAgentDbModelToolsItem +from .knowledge_base_locator import KnowledgeBaseLocator +from .custom_llm import CustomLlm +from .rag_config import RagConfig +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class PromptAgentDbModel(UncheckedBaseModel): + prompt: typing.Optional[str] = pydantic.Field(default=None) + """ + The prompt for the agent + """ + + llm: typing.Optional[Llm] = pydantic.Field(default=None) + """ + The LLM to query with the prompt and the chat history + """ + + temperature: typing.Optional[float] = pydantic.Field(default=None) + """ + The temperature for the LLM + """ + + max_tokens: typing.Optional[int] = pydantic.Field(default=None) + """ + If greater than 0, maximum number of tokens the LLM can predict + """ + + tools: typing.Optional[typing.List[PromptAgentDbModelToolsItem]] = pydantic.Field(default=None) + """ + A list of tools that the agent can use over the course of the conversation + """ + + tool_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) + """ + A list of IDs of tools used by the agent + """ + + mcp_server_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None) + """ + A list of MCP server ids to be used by the agent + """ + + knowledge_base: typing.Optional[typing.List[KnowledgeBaseLocator]] = pydantic.Field(default=None) + """ + A list of knowledge bases to be used by the agent + """ + + custom_llm: typing.Optional[CustomLlm] = pydantic.Field(default=None) + """ + Definition for a custom LLM if LLM field is set to 'CUSTOM_LLM' + """ + + ignore_default_personality: typing.Optional[bool] = pydantic.Field(default=None) + """ + Whether to ignore the default personality + """ + + rag: typing.Optional[RagConfig] = pydantic.Field(default=None) + """ + Configuration for RAG + """ + + knowledge_base_document_ids: typing.Optional[typing.List[str]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/elevenlabs/types/prompt_agent_db_model_tools_item.py b/src/elevenlabs/types/prompt_agent_db_model_tools_item.py new file mode 100644 index 00000000..19d83d7d --- /dev/null +++ b/src/elevenlabs/types/prompt_agent_db_model_tools_item.py @@ -0,0 +1,118 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ..core.unchecked_base_model import UncheckedBaseModel +from .array_json_schema_property_input import ArrayJsonSchemaPropertyInput +from .object_json_schema_property_input import ObjectJsonSchemaPropertyInput +import typing +from .dynamic_variables_config import DynamicVariablesConfig +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic +from .system_tool_config_input_params import SystemToolConfigInputParams +from .webhook_tool_api_schema_config_input import WebhookToolApiSchemaConfigInput +import typing_extensions +from ..core.unchecked_base_model import UnionMetadata + + +class PromptAgentDbModelToolsItem_Client(UncheckedBaseModel): + """ + The type of tool + """ + + type: typing.Literal["client"] = "client" + id: typing.Optional[str] = None + name: str + description: str + response_timeout_secs: typing.Optional[int] = None + parameters: typing.Optional[ObjectJsonSchemaPropertyInput] = None + expects_response: typing.Optional[bool] = None + dynamic_variables: typing.Optional[DynamicVariablesConfig] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class PromptAgentDbModelToolsItem_Mcp(UncheckedBaseModel): + """ + The type of tool + """ + + type: typing.Literal["mcp"] = "mcp" + id: typing.Optional[str] = None + name: str + description: str + response_timeout_secs: typing.Optional[int] = None + parameters: typing.Optional[ObjectJsonSchemaPropertyInput] = None + mcp_tool_name: str + mcp_server_id: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class PromptAgentDbModelToolsItem_System(UncheckedBaseModel): + """ + The type of tool + """ + + type: typing.Literal["system"] = "system" + id: typing.Optional[str] = None + name: str + description: str + response_timeout_secs: typing.Optional[int] = None + params: SystemToolConfigInputParams + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +class PromptAgentDbModelToolsItem_Webhook(UncheckedBaseModel): + """ + The type of tool + """ + + type: typing.Literal["webhook"] = "webhook" + id: typing.Optional[str] = None + name: str + description: str + response_timeout_secs: typing.Optional[int] = None + api_schema: WebhookToolApiSchemaConfigInput + dynamic_variables: typing.Optional[DynamicVariablesConfig] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +PromptAgentDbModelToolsItem = typing_extensions.Annotated[ + typing.Union[ + PromptAgentDbModelToolsItem_Client, + PromptAgentDbModelToolsItem_Mcp, + PromptAgentDbModelToolsItem_System, + PromptAgentDbModelToolsItem_Webhook, + ], + UnionMetadata(discriminant="type"), +] diff --git a/src/elevenlabs/types/prompt_agent_input_tools_item.py b/src/elevenlabs/types/prompt_agent_input_tools_item.py index 5b188dc7..9da04cbc 100644 --- a/src/elevenlabs/types/prompt_agent_input_tools_item.py +++ b/src/elevenlabs/types/prompt_agent_input_tools_item.py @@ -23,9 +23,9 @@ class PromptAgentInputToolsItem_Client(UncheckedBaseModel): id: typing.Optional[str] = None name: str description: str + response_timeout_secs: typing.Optional[int] = None parameters: typing.Optional[ObjectJsonSchemaPropertyInput] = None expects_response: typing.Optional[bool] = None - response_timeout_secs: typing.Optional[int] = None dynamic_variables: typing.Optional[DynamicVariablesConfig] = None if IS_PYDANTIC_V2: @@ -38,6 +38,30 @@ class Config: extra = pydantic.Extra.allow +class PromptAgentInputToolsItem_Mcp(UncheckedBaseModel): + """ + The type of tool + """ + + type: typing.Literal["mcp"] = "mcp" + id: typing.Optional[str] = None + name: str + description: str + response_timeout_secs: typing.Optional[int] = None + parameters: typing.Optional[ObjectJsonSchemaPropertyInput] = None + mcp_tool_name: str + mcp_server_id: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + class PromptAgentInputToolsItem_System(UncheckedBaseModel): """ The type of tool @@ -47,6 +71,7 @@ class PromptAgentInputToolsItem_System(UncheckedBaseModel): id: typing.Optional[str] = None name: str description: str + response_timeout_secs: typing.Optional[int] = None params: SystemToolConfigInputParams if IS_PYDANTIC_V2: @@ -68,6 +93,7 @@ class PromptAgentInputToolsItem_Webhook(UncheckedBaseModel): id: typing.Optional[str] = None name: str description: str + response_timeout_secs: typing.Optional[int] = None api_schema: WebhookToolApiSchemaConfigInput dynamic_variables: typing.Optional[DynamicVariablesConfig] = None @@ -84,6 +110,7 @@ class Config: PromptAgentInputToolsItem = typing_extensions.Annotated[ typing.Union[ PromptAgentInputToolsItem_Client, + PromptAgentInputToolsItem_Mcp, PromptAgentInputToolsItem_System, PromptAgentInputToolsItem_Webhook, ], diff --git a/src/elevenlabs/types/prompt_agent_output_tools_item.py b/src/elevenlabs/types/prompt_agent_output_tools_item.py index 3995827b..695fbc45 100644 --- a/src/elevenlabs/types/prompt_agent_output_tools_item.py +++ b/src/elevenlabs/types/prompt_agent_output_tools_item.py @@ -23,9 +23,9 @@ class PromptAgentOutputToolsItem_Client(UncheckedBaseModel): id: typing.Optional[str] = None name: str description: str + response_timeout_secs: typing.Optional[int] = None parameters: typing.Optional[ObjectJsonSchemaPropertyOutput] = None expects_response: typing.Optional[bool] = None - response_timeout_secs: typing.Optional[int] = None dynamic_variables: typing.Optional[DynamicVariablesConfig] = None if IS_PYDANTIC_V2: @@ -38,6 +38,30 @@ class Config: extra = pydantic.Extra.allow +class PromptAgentOutputToolsItem_Mcp(UncheckedBaseModel): + """ + The type of tool + """ + + type: typing.Literal["mcp"] = "mcp" + id: typing.Optional[str] = None + name: str + description: str + response_timeout_secs: typing.Optional[int] = None + parameters: typing.Optional[ObjectJsonSchemaPropertyOutput] = None + mcp_tool_name: str + mcp_server_id: str + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + class PromptAgentOutputToolsItem_System(UncheckedBaseModel): """ The type of tool @@ -47,6 +71,7 @@ class PromptAgentOutputToolsItem_System(UncheckedBaseModel): id: typing.Optional[str] = None name: str description: str + response_timeout_secs: typing.Optional[int] = None params: SystemToolConfigOutputParams if IS_PYDANTIC_V2: @@ -68,6 +93,7 @@ class PromptAgentOutputToolsItem_Webhook(UncheckedBaseModel): id: typing.Optional[str] = None name: str description: str + response_timeout_secs: typing.Optional[int] = None api_schema: WebhookToolApiSchemaConfigOutput dynamic_variables: typing.Optional[DynamicVariablesConfig] = None @@ -84,6 +110,7 @@ class Config: PromptAgentOutputToolsItem = typing_extensions.Annotated[ typing.Union[ PromptAgentOutputToolsItem_Client, + PromptAgentOutputToolsItem_Mcp, PromptAgentOutputToolsItem_System, PromptAgentOutputToolsItem_Webhook, ], diff --git a/src/elevenlabs/types/pronunciation_dictionary_version_locator.py b/src/elevenlabs/types/pronunciation_dictionary_version_locator.py index 637d8de4..55fff7fe 100644 --- a/src/elevenlabs/types/pronunciation_dictionary_version_locator.py +++ b/src/elevenlabs/types/pronunciation_dictionary_version_locator.py @@ -1,14 +1,21 @@ # This file was auto-generated by Fern from our API Definition. from ..core.unchecked_base_model import UncheckedBaseModel +import pydantic import typing from ..core.pydantic_utilities import IS_PYDANTIC_V2 -import pydantic class PronunciationDictionaryVersionLocator(UncheckedBaseModel): - pronunciation_dictionary_id: str - version_id: typing.Optional[str] = None + pronunciation_dictionary_id: str = pydantic.Field() + """ + The ID of the pronunciation dictionary. + """ + + version_id: typing.Optional[str] = pydantic.Field(default=None) + """ + The ID of the version of the pronunciation dictionary. If not provided, the latest version will be used. + """ if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/elevenlabs/types/send_text_multi.py b/src/elevenlabs/types/send_text_multi.py new file mode 100644 index 00000000..78a1ba05 --- /dev/null +++ b/src/elevenlabs/types/send_text_multi.py @@ -0,0 +1,36 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.unchecked_base_model import UncheckedBaseModel +import pydantic +import typing +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class SendTextMulti(UncheckedBaseModel): + """ + Payload to send text for synthesis to an existing context. + """ + + text: str = pydantic.Field() + """ + Text to synthesize. Should end with a single space. + """ + + context_id: typing.Optional[str] = pydantic.Field(default=None) + """ + The target context_id for this text. + """ + + flush: typing.Optional[bool] = pydantic.Field(default=None) + """ + If true, flushes the audio buffer for the specified context. If false, the text will be appended to the buffer to be generated. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/elevenlabs/types/similar_voice.py b/src/elevenlabs/types/similar_voice.py new file mode 100644 index 00000000..70207e86 --- /dev/null +++ b/src/elevenlabs/types/similar_voice.py @@ -0,0 +1,24 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.unchecked_base_model import UncheckedBaseModel +from .similar_voice_category import SimilarVoiceCategory +import typing +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic + + +class SimilarVoice(UncheckedBaseModel): + voice_id: str + name: str + category: SimilarVoiceCategory + description: typing.Optional[str] = None + preview_url: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/elevenlabs/types/similar_voice_category.py b/src/elevenlabs/types/similar_voice_category.py new file mode 100644 index 00000000..f7e79602 --- /dev/null +++ b/src/elevenlabs/types/similar_voice_category.py @@ -0,0 +1,8 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +SimilarVoiceCategory = typing.Union[ + typing.Literal["premade", "cloned", "generated", "professional", "famous"], + typing.Any, +] diff --git a/src/elevenlabs/types/similar_voices_for_speaker_response.py b/src/elevenlabs/types/similar_voices_for_speaker_response.py new file mode 100644 index 00000000..a14a09c8 --- /dev/null +++ b/src/elevenlabs/types/similar_voices_for_speaker_response.py @@ -0,0 +1,20 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.unchecked_base_model import UncheckedBaseModel +import typing +from .similar_voice import SimilarVoice +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic + + +class SimilarVoicesForSpeakerResponse(UncheckedBaseModel): + voices: typing.List[SimilarVoice] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/elevenlabs/types/sip_media_encryption_enum.py b/src/elevenlabs/types/sip_media_encryption_enum.py new file mode 100644 index 00000000..e5b2691b --- /dev/null +++ b/src/elevenlabs/types/sip_media_encryption_enum.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +SipMediaEncryptionEnum = typing.Union[typing.Literal["disabled", "allowed", "required"], typing.Any] diff --git a/src/elevenlabs/types/sip_trunk_config_response_model.py b/src/elevenlabs/types/sip_trunk_config_response_model.py new file mode 100644 index 00000000..27322cb4 --- /dev/null +++ b/src/elevenlabs/types/sip_trunk_config_response_model.py @@ -0,0 +1,58 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.unchecked_base_model import UncheckedBaseModel +import pydantic +from .sip_trunk_transport_enum import SipTrunkTransportEnum +from .sip_media_encryption_enum import SipMediaEncryptionEnum +import typing +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class SipTrunkConfigResponseModel(UncheckedBaseModel): + """ + SIP Trunk configuration details for a phone number + """ + + address: str = pydantic.Field() + """ + Hostname or IP the SIP INVITE is sent to + """ + + transport: SipTrunkTransportEnum = pydantic.Field() + """ + Protocol to use for SIP transport + """ + + media_encryption: SipMediaEncryptionEnum = pydantic.Field() + """ + Whether or not to encrypt media (data layer). + """ + + headers: typing.Optional[typing.Dict[str, str]] = pydantic.Field(default=None) + """ + SIP headers for INVITE request + """ + + has_auth_credentials: bool = pydantic.Field() + """ + Whether authentication credentials are configured + """ + + username: typing.Optional[str] = pydantic.Field(default=None) + """ + SIP trunk username (if available) + """ + + has_outbound_trunk: typing.Optional[bool] = pydantic.Field(default=None) + """ + Whether a LiveKit SIP outbound trunk is configured + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/elevenlabs/types/sip_trunk_outbound_call_response.py b/src/elevenlabs/types/sip_trunk_outbound_call_response.py new file mode 100644 index 00000000..dad551ac --- /dev/null +++ b/src/elevenlabs/types/sip_trunk_outbound_call_response.py @@ -0,0 +1,21 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.unchecked_base_model import UncheckedBaseModel +import typing +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic + + +class SipTrunkOutboundCallResponse(UncheckedBaseModel): + success: bool + message: str + sip_call_id: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/elevenlabs/types/sip_trunk_transport_enum.py b/src/elevenlabs/types/sip_trunk_transport_enum.py new file mode 100644 index 00000000..02f4ff15 --- /dev/null +++ b/src/elevenlabs/types/sip_trunk_transport_enum.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +SipTrunkTransportEnum = typing.Union[typing.Literal["auto", "udp", "tcp", "tls"], typing.Any] diff --git a/src/elevenlabs/types/speaker_track.py b/src/elevenlabs/types/speaker_track.py index 57dbd5eb..9b2ab867 100644 --- a/src/elevenlabs/types/speaker_track.py +++ b/src/elevenlabs/types/speaker_track.py @@ -11,6 +11,7 @@ class SpeakerTrack(UncheckedBaseModel): id: str media_ref: DubbingMediaReference speaker_name: str + voices: typing.Dict[str, str] segments: typing.List[str] if IS_PYDANTIC_V2: diff --git a/src/elevenlabs/types/speaker_updated_response.py b/src/elevenlabs/types/speaker_updated_response.py new file mode 100644 index 00000000..8cf7d098 --- /dev/null +++ b/src/elevenlabs/types/speaker_updated_response.py @@ -0,0 +1,19 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.unchecked_base_model import UncheckedBaseModel +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing +import pydantic + + +class SpeakerUpdatedResponse(UncheckedBaseModel): + version: int + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/elevenlabs/types/speech_history_item_response.py b/src/elevenlabs/types/speech_history_item_response.py index f985e5c4..ecc7c346 100644 --- a/src/elevenlabs/types/speech_history_item_response.py +++ b/src/elevenlabs/types/speech_history_item_response.py @@ -88,7 +88,7 @@ class SpeechHistoryItemResponse(UncheckedBaseModel): source: typing.Optional[SpeechHistoryItemResponseModelSource] = pydantic.Field(default=None) """ - The source of the history item. Either TTS (text to speech), STS (speech to text), AN (audio native), Projects, Dubbing or PlayAPI. + The source of the history item. Either TTS (text to speech), STS (speech to text), AN (audio native), Projects, Dubbing, PlayAPI, PD (pronunciation dictionary) or ConvAI (conversational AI). """ alignments: typing.Optional[HistoryAlignmentsResponseModel] = pydantic.Field(default=None) diff --git a/src/elevenlabs/types/speech_history_item_response_model_source.py b/src/elevenlabs/types/speech_history_item_response_model_source.py index e65d114d..747b6643 100644 --- a/src/elevenlabs/types/speech_history_item_response_model_source.py +++ b/src/elevenlabs/types/speech_history_item_response_model_source.py @@ -3,5 +3,6 @@ import typing SpeechHistoryItemResponseModelSource = typing.Union[ - typing.Literal["TTS", "STS", "Projects", "AN", "Dubbing", "PlayAPI"], typing.Any + typing.Literal["TTS", "STS", "Projects", "PD", "AN", "Dubbing", "PlayAPI", "ConvAI"], + typing.Any, ] diff --git a/src/elevenlabs/types/speech_to_text_word_response_model.py b/src/elevenlabs/types/speech_to_text_word_response_model.py index 5de12fcc..b0a83e0e 100644 --- a/src/elevenlabs/types/speech_to_text_word_response_model.py +++ b/src/elevenlabs/types/speech_to_text_word_response_model.py @@ -38,6 +38,11 @@ class SpeechToTextWordResponseModel(UncheckedBaseModel): Unique identifier for the speaker of this word. """ + logprob: float = pydantic.Field() + """ + The log of the probability with which this word was predicted. Logprobs are in range [-infinity, 0], higher logprobs indicate a higher confidence the model has in its predictions. + """ + characters: typing.Optional[typing.List[SpeechToTextCharacterResponseModel]] = pydantic.Field(default=None) """ The characters that make up the word and their timing information. diff --git a/src/elevenlabs/types/stream_input_query_parameters.py b/src/elevenlabs/types/stream_input_query_parameters.py new file mode 100644 index 00000000..cefaea4a --- /dev/null +++ b/src/elevenlabs/types/stream_input_query_parameters.py @@ -0,0 +1,73 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.unchecked_base_model import UncheckedBaseModel +import typing +import pydantic +from .stream_input_query_parameters_optimize_streaming_latency import ( + StreamInputQueryParametersOptimizeStreamingLatency, +) +from .text_to_speech_output_format_enum import TextToSpeechOutputFormatEnum +from .text_to_speech_apply_text_normalization_enum import ( + TextToSpeechApplyTextNormalizationEnum, +) +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class StreamInputQueryParameters(UncheckedBaseModel): + model_id: typing.Optional[str] = pydantic.Field(default=None) + """ + The model ID to use + """ + + language_code: typing.Optional[str] = pydantic.Field(default=None) + """ + The ISO 639-1 language code (for Turbo v2.5 and Flash v2.5 models only) + """ + + enable_logging: typing.Optional[str] = pydantic.Field(default=None) + """ + Whether to enable logging of the request + """ + + enable_ssml_parsing: typing.Optional[bool] = pydantic.Field(default=None) + """ + Whether to enable SSML parsing + """ + + optimize_streaming_latency: typing.Optional[StreamInputQueryParametersOptimizeStreamingLatency] = pydantic.Field( + default=None + ) + """ + Latency optimization level (deprecated) + """ + + output_format: typing.Optional[TextToSpeechOutputFormatEnum] = None + inactivity_timeout: typing.Optional[float] = pydantic.Field(default=None) + """ + Timeout for inactivity before connection is closed + """ + + sync_alignment: typing.Optional[bool] = pydantic.Field(default=None) + """ + Whether to include timing data with every audio chunk + """ + + auto_mode: typing.Optional[bool] = pydantic.Field(default=None) + """ + This parameter focuses on reducing the latency by disabling the chunk schedule and all buffers. It is only recommended when sending full sentences or phrases, sending partial phrases will result in highly reduced quality. By default it's set to false. + """ + + apply_text_normalization: typing.Optional[TextToSpeechApplyTextNormalizationEnum] = None + seed: typing.Optional[int] = pydantic.Field(default=None) + """ + If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed. Must be an integer between 0 and 4294967295. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/elevenlabs/types/stream_input_query_parameters_optimize_streaming_latency.py b/src/elevenlabs/types/stream_input_query_parameters_optimize_streaming_latency.py new file mode 100644 index 00000000..7465b75b --- /dev/null +++ b/src/elevenlabs/types/stream_input_query_parameters_optimize_streaming_latency.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +StreamInputQueryParametersOptimizeStreamingLatency = typing.Union[typing.Literal["0", "1", "2", "3", "4"], typing.Any] diff --git a/src/elevenlabs/types/system_tool_config_input.py b/src/elevenlabs/types/system_tool_config_input.py index 5247d35c..92bcf902 100644 --- a/src/elevenlabs/types/system_tool_config_input.py +++ b/src/elevenlabs/types/system_tool_config_input.py @@ -2,9 +2,9 @@ from ..core.unchecked_base_model import UncheckedBaseModel import typing +import pydantic from .system_tool_config_input_params import SystemToolConfigInputParams from ..core.pydantic_utilities import IS_PYDANTIC_V2 -import pydantic class SystemToolConfigInput(UncheckedBaseModel): @@ -15,6 +15,11 @@ class SystemToolConfigInput(UncheckedBaseModel): id: typing.Optional[str] = None name: str description: str + response_timeout_secs: typing.Optional[int] = pydantic.Field(default=None) + """ + The maximum time in seconds to wait for the tool call to complete. + """ + params: SystemToolConfigInputParams if IS_PYDANTIC_V2: diff --git a/src/elevenlabs/types/system_tool_config_output.py b/src/elevenlabs/types/system_tool_config_output.py index 50a0244f..2316f86c 100644 --- a/src/elevenlabs/types/system_tool_config_output.py +++ b/src/elevenlabs/types/system_tool_config_output.py @@ -2,9 +2,9 @@ from ..core.unchecked_base_model import UncheckedBaseModel import typing +import pydantic from .system_tool_config_output_params import SystemToolConfigOutputParams from ..core.pydantic_utilities import IS_PYDANTIC_V2 -import pydantic class SystemToolConfigOutput(UncheckedBaseModel): @@ -15,6 +15,11 @@ class SystemToolConfigOutput(UncheckedBaseModel): id: typing.Optional[str] = None name: str description: str + response_timeout_secs: typing.Optional[int] = pydantic.Field(default=None) + """ + The maximum time in seconds to wait for the tool call to complete. + """ + params: SystemToolConfigOutputParams if IS_PYDANTIC_V2: diff --git a/src/elevenlabs/types/text_to_speech_apply_text_normalization_enum.py b/src/elevenlabs/types/text_to_speech_apply_text_normalization_enum.py new file mode 100644 index 00000000..19cabebf --- /dev/null +++ b/src/elevenlabs/types/text_to_speech_apply_text_normalization_enum.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +TextToSpeechApplyTextNormalizationEnum = typing.Union[typing.Literal["auto", "on", "off"], typing.Any] diff --git a/src/elevenlabs/types/text_to_speech_output_format_enum.py b/src/elevenlabs/types/text_to_speech_output_format_enum.py new file mode 100644 index 00000000..192e40fd --- /dev/null +++ b/src/elevenlabs/types/text_to_speech_output_format_enum.py @@ -0,0 +1,27 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +TextToSpeechOutputFormatEnum = typing.Union[ + typing.Literal[ + "mp3_22050_32", + "mp3_44100_32", + "mp3_44100_64", + "mp3_44100_96", + "mp3_44100_128", + "mp3_44100_192", + "pcm_8000", + "pcm_16000", + "pcm_22050", + "pcm_24000", + "pcm_44100", + "ulaw_8000", + "alaw_8000", + "opus_48000_32", + "opus_48000_64", + "opus_48000_96", + "opus_48000_128", + "opus_48000_192", + ], + typing.Any, +] diff --git a/src/elevenlabs/types/tool_mock_config.py b/src/elevenlabs/types/tool_mock_config.py new file mode 100644 index 00000000..26f68fd2 --- /dev/null +++ b/src/elevenlabs/types/tool_mock_config.py @@ -0,0 +1,20 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.unchecked_base_model import UncheckedBaseModel +import typing +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import pydantic + + +class ToolMockConfig(UncheckedBaseModel): + default_return_value: typing.Optional[str] = None + default_is_error: typing.Optional[bool] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/elevenlabs/types/voice_settings.py b/src/elevenlabs/types/voice_settings.py index 15e26cf9..c880d667 100644 --- a/src/elevenlabs/types/voice_settings.py +++ b/src/elevenlabs/types/voice_settings.py @@ -29,7 +29,7 @@ class VoiceSettings(UncheckedBaseModel): speed: typing.Optional[float] = pydantic.Field(default=None) """ - Controls the speed of the generated speech. Values range from 0.7 to 1.2, with 1.0 being the default speed. Lower values create slower, more deliberate speech while higher values produce faster-paced speech. Extreme values can impact the quality of the generated speech. + Adjusts the speed of the voice. A value of 1.0 is the default speed, while values less than 1.0 slow down the speech, and values greater than 1.0 speed it up. """ if IS_PYDANTIC_V2: diff --git a/src/elevenlabs/types/webhook_tool_config_input.py b/src/elevenlabs/types/webhook_tool_config_input.py index ed38d3c5..917e03d1 100644 --- a/src/elevenlabs/types/webhook_tool_config_input.py +++ b/src/elevenlabs/types/webhook_tool_config_input.py @@ -4,8 +4,8 @@ from .array_json_schema_property_input import ArrayJsonSchemaPropertyInput from .object_json_schema_property_input import ObjectJsonSchemaPropertyInput import typing -from .webhook_tool_api_schema_config_input import WebhookToolApiSchemaConfigInput import pydantic +from .webhook_tool_api_schema_config_input import WebhookToolApiSchemaConfigInput from .dynamic_variables_config import DynamicVariablesConfig from ..core.pydantic_utilities import IS_PYDANTIC_V2 @@ -18,6 +18,11 @@ class WebhookToolConfigInput(UncheckedBaseModel): id: typing.Optional[str] = None name: str description: str + response_timeout_secs: typing.Optional[int] = pydantic.Field(default=None) + """ + The maximum time in seconds to wait for the tool call to complete. Must be between 5 and 120 seconds (inclusive). + """ + api_schema: WebhookToolApiSchemaConfigInput = pydantic.Field() """ The schema for the outgoing webhoook, including parameters and URL specification diff --git a/src/elevenlabs/types/webhook_tool_config_output.py b/src/elevenlabs/types/webhook_tool_config_output.py index 4b92b33c..9fae15d3 100644 --- a/src/elevenlabs/types/webhook_tool_config_output.py +++ b/src/elevenlabs/types/webhook_tool_config_output.py @@ -4,8 +4,8 @@ from .array_json_schema_property_output import ArrayJsonSchemaPropertyOutput from .object_json_schema_property_output import ObjectJsonSchemaPropertyOutput import typing -from .webhook_tool_api_schema_config_output import WebhookToolApiSchemaConfigOutput import pydantic +from .webhook_tool_api_schema_config_output import WebhookToolApiSchemaConfigOutput from .dynamic_variables_config import DynamicVariablesConfig from ..core.pydantic_utilities import IS_PYDANTIC_V2 @@ -18,6 +18,11 @@ class WebhookToolConfigOutput(UncheckedBaseModel): id: typing.Optional[str] = None name: str description: str + response_timeout_secs: typing.Optional[int] = pydantic.Field(default=None) + """ + The maximum time in seconds to wait for the tool call to complete. Must be between 5 and 120 seconds (inclusive). + """ + api_schema: WebhookToolApiSchemaConfigOutput = pydantic.Field() """ The schema for the outgoing webhoook, including parameters and URL specification diff --git a/src/elevenlabs/types/websocket_tts_client_message_multi.py b/src/elevenlabs/types/websocket_tts_client_message_multi.py new file mode 100644 index 00000000..7d0020cc --- /dev/null +++ b/src/elevenlabs/types/websocket_tts_client_message_multi.py @@ -0,0 +1,83 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.unchecked_base_model import UncheckedBaseModel +import typing +import pydantic +from .realtime_voice_settings import RealtimeVoiceSettings +from .generation_config import GenerationConfig +import typing_extensions +from ..core.serialization import FieldMetadata +from .pronunciation_dictionary_locator import PronunciationDictionaryLocator +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class WebsocketTtsClientMessageMulti(UncheckedBaseModel): + """ + Message sent from the client to the multi-context TTS WebSocket. + """ + + text: typing.Optional[str] = pydantic.Field(default=None) + """ + Text to be synthesized. + For the first message establishing a new context (identified by `context_id`, or a default context if `context_id` is absent), this should be a single space character (' '). + For subsequent messages to an active context, this is the text to synthesize. + This field can be null or an empty string if the message is primarily for control (e.g., using `flush`, `close_context`, or `close_socket`). + """ + + voice_settings: typing.Optional[RealtimeVoiceSettings] = pydantic.Field(default=None) + """ + Voice settings. Can only be provided in the first message for a given context_id (or first message overall if context_id is not used/default). + """ + + generation_config: typing.Optional[GenerationConfig] = pydantic.Field(default=None) + """ + Generation config. Can only be provided in the first message for a given context_id (or first message overall if context_id is not used/default). + """ + + xi_api_key: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="xi-api-key")] = pydantic.Field( + default=None + ) + """ + Your ElevenLabs API key. Can only be provided in the first message for a given context_id if not present in the header. + """ + + authorization: typing.Optional[str] = pydantic.Field(default=None) + """ + Your authorization bearer token. Can only be provided in the first message for a given context_id if not present in the header. + """ + + flush: typing.Optional[bool] = pydantic.Field(default=None) + """ + If true, flushes the audio buffer and returns the remaining audio for the specified `context_id`. + """ + + pronunciation_dictionary_locators: typing.Optional[typing.List[PronunciationDictionaryLocator]] = pydantic.Field( + default=None + ) + """ + Optional list of pronunciation dictionary locators. Can only be provided in the first message for a given context_id. + """ + + context_id: typing.Optional[str] = pydantic.Field(default=None) + """ + An identifier for the text-to-speech context. Allows managing multiple independent audio generation streams over a single WebSocket connection. If omitted, a default context is used. + """ + + close_context: typing.Optional[bool] = pydantic.Field(default=None) + """ + If true, closes the specified `context_id`. No further audio will be generated for this context. The `text` field is ignored. + """ + + close_socket: typing.Optional[bool] = pydantic.Field(default=None) + """ + If true, flushes all contexts and closes the entire WebSocket connection. The `text` and `context_id` fields are ignored. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/elevenlabs/types/websocket_tts_server_message_multi.py b/src/elevenlabs/types/websocket_tts_server_message_multi.py new file mode 100644 index 00000000..f51f2289 --- /dev/null +++ b/src/elevenlabs/types/websocket_tts_server_message_multi.py @@ -0,0 +1,46 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.unchecked_base_model import UncheckedBaseModel +import typing +import pydantic +import typing_extensions +from .normalized_alignment import NormalizedAlignment +from ..core.serialization import FieldMetadata +from .alignment import Alignment +from ..core.pydantic_utilities import IS_PYDANTIC_V2 + + +class WebsocketTtsServerMessageMulti(UncheckedBaseModel): + """ + Message sent from the server to the client for the multi-context TTS WebSocket. + """ + + audio: typing.Optional[str] = pydantic.Field(default=None) + """ + A generated partial audio chunk, encoded using the selected output_format (e.g., MP3 as a base64 string). + """ + + is_final: typing.Optional[bool] = pydantic.Field(default=None) + """ + If true, indicates that this is the final message for the specified contextId. This is sent when a context is closed. `audio` will be null or empty. + """ + + normalized_alignment: typing_extensions.Annotated[ + typing.Optional[NormalizedAlignment], FieldMetadata(alias="normalizedAlignment") + ] = None + alignment: typing.Optional[Alignment] = None + context_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="contextId")] = pydantic.Field( + default=None + ) + """ + The context identifier to which this message pertains. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/elevenlabs/types/workspace_resource_type.py b/src/elevenlabs/types/workspace_resource_type.py index bae79063..c79cd089 100644 --- a/src/elevenlabs/types/workspace_resource_type.py +++ b/src/elevenlabs/types/workspace_resource_type.py @@ -16,6 +16,7 @@ "convai_secrets", "music_latent", "convai_phone_numbers", + "convai_mcps", "convai_batch_calls", ], typing.Any, diff --git a/src/elevenlabs/usage/client.py b/src/elevenlabs/usage/client.py index ebbb0fff..d87b94bd 100644 --- a/src/elevenlabs/usage/client.py +++ b/src/elevenlabs/usage/client.py @@ -31,7 +31,7 @@ def get_characters_usage_metrics( request_options: typing.Optional[RequestOptions] = None, ) -> UsageCharactersResponseModel: """ - Returns the credit usage metrics for the current user or the entire workspace they are part of. The response will return a time axis with unix timestamps for each day and daily usage along that axis. The usage will be broken down by the specified breakdown type. For example, breakdown type "voice" will return the usage of each voice along the time axis. + Returns the usage metrics for the current user or the entire workspace they are part of. The response provides a time axis based on the specified aggregation interval (default: day), with usage values for each interval along that axis. Usage is broken down by the selected breakdown type. For example, breakdown type "voice" will return the usage of each voice for each interval along the time axis. Parameters ---------- @@ -128,7 +128,7 @@ async def get_characters_usage_metrics( request_options: typing.Optional[RequestOptions] = None, ) -> UsageCharactersResponseModel: """ - Returns the credit usage metrics for the current user or the entire workspace they are part of. The response will return a time axis with unix timestamps for each day and daily usage along that axis. The usage will be broken down by the specified breakdown type. For example, breakdown type "voice" will return the usage of each voice along the time axis. + Returns the usage metrics for the current user or the entire workspace they are part of. The response provides a time axis based on the specified aggregation interval (default: day), with usage values for each interval along that axis. Usage is broken down by the selected breakdown type. For example, breakdown type "voice" will return the usage of each voice for each interval along the time axis. Parameters ---------- diff --git a/src/elevenlabs/v_1_text_to_speech_voice_id_multi_stream_input/__init__.py b/src/elevenlabs/v_1_text_to_speech_voice_id_multi_stream_input/__init__.py new file mode 100644 index 00000000..8b09356a --- /dev/null +++ b/src/elevenlabs/v_1_text_to_speech_voice_id_multi_stream_input/__init__.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .types import ReceiveMessageMulti, SendMessageMulti, TextToSpeechApplyTextNormalization, TextToSpeechOutputFormat + +__all__ = ["ReceiveMessageMulti", "SendMessageMulti", "TextToSpeechApplyTextNormalization", "TextToSpeechOutputFormat"] diff --git a/src/elevenlabs/v_1_text_to_speech_voice_id_multi_stream_input/types/__init__.py b/src/elevenlabs/v_1_text_to_speech_voice_id_multi_stream_input/types/__init__.py new file mode 100644 index 00000000..c75ab8d2 --- /dev/null +++ b/src/elevenlabs/v_1_text_to_speech_voice_id_multi_stream_input/types/__init__.py @@ -0,0 +1,8 @@ +# This file was auto-generated by Fern from our API Definition. + +from .receive_message_multi import ReceiveMessageMulti +from .send_message_multi import SendMessageMulti +from .text_to_speech_apply_text_normalization import TextToSpeechApplyTextNormalization +from .text_to_speech_output_format import TextToSpeechOutputFormat + +__all__ = ["ReceiveMessageMulti", "SendMessageMulti", "TextToSpeechApplyTextNormalization", "TextToSpeechOutputFormat"] diff --git a/src/elevenlabs/v_1_text_to_speech_voice_id_multi_stream_input/types/receive_message_multi.py b/src/elevenlabs/v_1_text_to_speech_voice_id_multi_stream_input/types/receive_message_multi.py new file mode 100644 index 00000000..8b8832fd --- /dev/null +++ b/src/elevenlabs/v_1_text_to_speech_voice_id_multi_stream_input/types/receive_message_multi.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from ...types.audio_output_multi import AudioOutputMulti +from ...types.final_output_multi import FinalOutputMulti + +ReceiveMessageMulti = typing.Union[AudioOutputMulti, FinalOutputMulti] diff --git a/src/elevenlabs/v_1_text_to_speech_voice_id_multi_stream_input/types/send_message_multi.py b/src/elevenlabs/v_1_text_to_speech_voice_id_multi_stream_input/types/send_message_multi.py new file mode 100644 index 00000000..dc1b93a9 --- /dev/null +++ b/src/elevenlabs/v_1_text_to_speech_voice_id_multi_stream_input/types/send_message_multi.py @@ -0,0 +1,20 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from ...types.initialize_connection_multi import InitializeConnectionMulti +from ...types.initialise_context import InitialiseContext +from ...types.send_text_multi import SendTextMulti +from ...types.flush_context import FlushContext +from ...types.close_context import CloseContext +from ...types.close_socket import CloseSocket +from ...types.keep_context_alive import KeepContextAlive + +SendMessageMulti = typing.Union[ + InitializeConnectionMulti, + InitialiseContext, + SendTextMulti, + FlushContext, + CloseContext, + CloseSocket, + KeepContextAlive, +] diff --git a/src/elevenlabs/v_1_text_to_speech_voice_id_stream_input/types/text_to_speech_apply_text_normalization.py b/src/elevenlabs/v_1_text_to_speech_voice_id_multi_stream_input/types/text_to_speech_apply_text_normalization.py similarity index 100% rename from src/elevenlabs/v_1_text_to_speech_voice_id_stream_input/types/text_to_speech_apply_text_normalization.py rename to src/elevenlabs/v_1_text_to_speech_voice_id_multi_stream_input/types/text_to_speech_apply_text_normalization.py diff --git a/src/elevenlabs/v_1_text_to_speech_voice_id_stream_input/types/text_to_speech_output_format.py b/src/elevenlabs/v_1_text_to_speech_voice_id_multi_stream_input/types/text_to_speech_output_format.py similarity index 100% rename from src/elevenlabs/v_1_text_to_speech_voice_id_stream_input/types/text_to_speech_output_format.py rename to src/elevenlabs/v_1_text_to_speech_voice_id_multi_stream_input/types/text_to_speech_output_format.py diff --git a/src/elevenlabs/v_1_text_to_speech_voice_id_stream_input/__init__.py b/src/elevenlabs/v_1_text_to_speech_voice_id_stream_input/__init__.py index a2f48af1..c36b4613 100644 --- a/src/elevenlabs/v_1_text_to_speech_voice_id_stream_input/__init__.py +++ b/src/elevenlabs/v_1_text_to_speech_voice_id_stream_input/__init__.py @@ -1,17 +1,5 @@ # This file was auto-generated by Fern from our API Definition. -from .types import ( - ReceiveMessage, - SendMessage, - TextToSpeechApplyTextNormalization, - TextToSpeechOptimizeStreamingLatency, - TextToSpeechOutputFormat, -) +from .types import ReceiveMessage, SendMessage -__all__ = [ - "ReceiveMessage", - "SendMessage", - "TextToSpeechApplyTextNormalization", - "TextToSpeechOptimizeStreamingLatency", - "TextToSpeechOutputFormat", -] +__all__ = ["ReceiveMessage", "SendMessage"] diff --git a/src/elevenlabs/v_1_text_to_speech_voice_id_stream_input/types/__init__.py b/src/elevenlabs/v_1_text_to_speech_voice_id_stream_input/types/__init__.py index 152b1c3a..853384c2 100644 --- a/src/elevenlabs/v_1_text_to_speech_voice_id_stream_input/types/__init__.py +++ b/src/elevenlabs/v_1_text_to_speech_voice_id_stream_input/types/__init__.py @@ -2,14 +2,5 @@ from .receive_message import ReceiveMessage from .send_message import SendMessage -from .text_to_speech_apply_text_normalization import TextToSpeechApplyTextNormalization -from .text_to_speech_optimize_streaming_latency import TextToSpeechOptimizeStreamingLatency -from .text_to_speech_output_format import TextToSpeechOutputFormat -__all__ = [ - "ReceiveMessage", - "SendMessage", - "TextToSpeechApplyTextNormalization", - "TextToSpeechOptimizeStreamingLatency", - "TextToSpeechOutputFormat", -] +__all__ = ["ReceiveMessage", "SendMessage"] diff --git a/src/elevenlabs/v_1_text_to_speech_voice_id_stream_input/types/text_to_speech_optimize_streaming_latency.py b/src/elevenlabs/v_1_text_to_speech_voice_id_stream_input/types/text_to_speech_optimize_streaming_latency.py deleted file mode 100644 index 01938a28..00000000 --- a/src/elevenlabs/v_1_text_to_speech_voice_id_stream_input/types/text_to_speech_optimize_streaming_latency.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -TextToSpeechOptimizeStreamingLatency = typing.Union[typing.Literal["0", "1", "2", "3", "4"], typing.Any] diff --git a/src/elevenlabs/voices/client.py b/src/elevenlabs/voices/client.py index 408de9c4..7f12c489 100644 --- a/src/elevenlabs/voices/client.py +++ b/src/elevenlabs/voices/client.py @@ -23,7 +23,6 @@ from ..types.add_voice_response_model import AddVoiceResponseModel from .types.voices_get_shared_request_category import VoicesGetSharedRequestCategory from ..types.get_library_voices_response import GetLibraryVoicesResponse -from ..types.profile_page_response_model import ProfilePageResponseModel from ..core.client_wrapper import AsyncClientWrapper from .pvc.client import AsyncPvcClient @@ -795,6 +794,7 @@ def get_shared( descriptives: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, featured: typing.Optional[bool] = None, min_notice_period_days: typing.Optional[int] = None, + include_custom_rates: typing.Optional[bool] = None, reader_app_enabled: typing.Optional[bool] = None, owner_id: typing.Optional[str] = None, sort: typing.Optional[str] = None, @@ -842,6 +842,9 @@ def get_shared( min_notice_period_days : typing.Optional[int] Filter voices with a minimum notice period of the given number of days. + include_custom_rates : typing.Optional[bool] + Include/exclude voices with custom rates + reader_app_enabled : typing.Optional[bool] Filter voices that are enabled for the reader app @@ -890,6 +893,7 @@ def get_shared( "descriptives": descriptives, "featured": featured, "min_notice_period_days": min_notice_period_days, + "include_custom_rates": include_custom_rates, "reader_app_enabled": reader_app_enabled, "owner_id": owner_id, "sort": sort, @@ -998,66 +1002,6 @@ def get_similar_library_voices( raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def get_a_profile_page( - self, handle: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> ProfilePageResponseModel: - """ - Gets a profile page based on a handle - - Parameters - ---------- - handle : str - Handle for a VA's profile page - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - ProfilePageResponseModel - Successful Response - - Examples - -------- - from elevenlabs import ElevenLabs - - client = ElevenLabs( - api_key="YOUR_API_KEY", - ) - client.voices.get_a_profile_page( - handle="talexgeorge", - ) - """ - _response = self._client_wrapper.httpx_client.request( - f"profile/{jsonable_encoder(handle)}", - base_url=self._client_wrapper.get_environment().base, - method="GET", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return typing.cast( - ProfilePageResponseModel, - construct_type( - type_=ProfilePageResponseModel, # type: ignore - object_=_response.json(), - ), - ) - if _response.status_code == 422: - raise UnprocessableEntityError( - typing.cast( - HttpValidationError, - construct_type( - type_=HttpValidationError, # type: ignore - object_=_response.json(), - ), - ) - ) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - class AsyncVoicesClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): @@ -1905,6 +1849,7 @@ async def get_shared( descriptives: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, featured: typing.Optional[bool] = None, min_notice_period_days: typing.Optional[int] = None, + include_custom_rates: typing.Optional[bool] = None, reader_app_enabled: typing.Optional[bool] = None, owner_id: typing.Optional[str] = None, sort: typing.Optional[str] = None, @@ -1952,6 +1897,9 @@ async def get_shared( min_notice_period_days : typing.Optional[int] Filter voices with a minimum notice period of the given number of days. + include_custom_rates : typing.Optional[bool] + Include/exclude voices with custom rates + reader_app_enabled : typing.Optional[bool] Filter voices that are enabled for the reader app @@ -2008,6 +1956,7 @@ async def main() -> None: "descriptives": descriptives, "featured": featured, "min_notice_period_days": min_notice_period_days, + "include_custom_rates": include_custom_rates, "reader_app_enabled": reader_app_enabled, "owner_id": owner_id, "sort": sort, @@ -2123,71 +2072,3 @@ async def main() -> None: except JSONDecodeError: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - - async def get_a_profile_page( - self, handle: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> ProfilePageResponseModel: - """ - Gets a profile page based on a handle - - Parameters - ---------- - handle : str - Handle for a VA's profile page - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - ProfilePageResponseModel - Successful Response - - Examples - -------- - import asyncio - - from elevenlabs import AsyncElevenLabs - - client = AsyncElevenLabs( - api_key="YOUR_API_KEY", - ) - - - async def main() -> None: - await client.voices.get_a_profile_page( - handle="talexgeorge", - ) - - - asyncio.run(main()) - """ - _response = await self._client_wrapper.httpx_client.request( - f"profile/{jsonable_encoder(handle)}", - base_url=self._client_wrapper.get_environment().base, - method="GET", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return typing.cast( - ProfilePageResponseModel, - construct_type( - type_=ProfilePageResponseModel, # type: ignore - object_=_response.json(), - ), - ) - if _response.status_code == 422: - raise UnprocessableEntityError( - typing.cast( - HttpValidationError, - construct_type( - type_=HttpValidationError, # type: ignore - object_=_response.json(), - ), - ) - ) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json)