telnyx 6.41.0 → 6.42.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +41 -0
- package/client.d.mts +2 -2
- package/client.d.mts.map +1 -1
- package/client.d.ts +2 -2
- package/client.d.ts.map +1 -1
- package/client.js +11 -0
- package/client.js.map +1 -1
- package/client.mjs +11 -0
- package/client.mjs.map +1 -1
- package/core/EventEmitter.d.mts +11 -0
- package/core/EventEmitter.d.mts.map +1 -1
- package/core/EventEmitter.d.ts +11 -0
- package/core/EventEmitter.d.ts.map +1 -1
- package/core/EventEmitter.js +15 -1
- package/core/EventEmitter.js.map +1 -1
- package/core/EventEmitter.mjs +13 -0
- package/core/EventEmitter.mjs.map +1 -1
- package/core/pagination.d.mts.map +1 -1
- package/core/pagination.d.ts.map +1 -1
- package/internal/detect-platform.js +1 -1
- package/internal/detect-platform.js.map +1 -1
- package/internal/detect-platform.mjs +1 -1
- package/internal/detect-platform.mjs.map +1 -1
- package/internal/types.d.mts +6 -6
- package/internal/types.d.mts.map +1 -1
- package/internal/types.d.ts +6 -6
- package/internal/types.d.ts.map +1 -1
- package/internal/utils/env.js +2 -2
- package/internal/utils/env.js.map +1 -1
- package/internal/utils/env.mjs +2 -2
- package/internal/utils/env.mjs.map +1 -1
- package/internal/ws-adapter-browser.d.mts +34 -0
- package/internal/ws-adapter-browser.d.mts.map +1 -0
- package/internal/ws-adapter-browser.d.ts +34 -0
- package/internal/ws-adapter-browser.d.ts.map +1 -0
- package/internal/ws-adapter-browser.js +88 -0
- package/internal/ws-adapter-browser.js.map +1 -0
- package/internal/ws-adapter-browser.mjs +84 -0
- package/internal/ws-adapter-browser.mjs.map +1 -0
- package/internal/ws-adapter-node.d.mts +27 -0
- package/internal/ws-adapter-node.d.mts.map +1 -0
- package/internal/ws-adapter-node.d.ts +27 -0
- package/internal/ws-adapter-node.d.ts.map +1 -0
- package/internal/ws-adapter-node.js +90 -0
- package/internal/ws-adapter-node.js.map +1 -0
- package/internal/ws-adapter-node.mjs +86 -0
- package/internal/ws-adapter-node.mjs.map +1 -0
- package/internal/ws-adapter.d.mts +24 -0
- package/internal/ws-adapter.d.mts.map +1 -0
- package/internal/ws-adapter.d.ts +24 -0
- package/internal/ws-adapter.d.ts.map +1 -0
- package/internal/ws-adapter.js +11 -0
- package/internal/ws-adapter.js.map +1 -0
- package/internal/ws-adapter.mjs +8 -0
- package/internal/ws-adapter.mjs.map +1 -0
- package/internal/ws.d.mts +80 -0
- package/internal/ws.d.mts.map +1 -0
- package/internal/ws.d.ts +80 -0
- package/internal/ws.d.ts.map +1 -0
- package/internal/ws.js +153 -0
- package/internal/ws.js.map +1 -0
- package/internal/ws.mjs +147 -0
- package/internal/ws.mjs.map +1 -0
- package/lib/text-to-speech-ws-base.d.mts +106 -0
- package/lib/text-to-speech-ws-base.d.mts.map +1 -0
- package/lib/text-to-speech-ws-base.d.ts +106 -0
- package/lib/text-to-speech-ws-base.d.ts.map +1 -0
- package/lib/text-to-speech-ws-base.js +475 -0
- package/lib/text-to-speech-ws-base.js.map +1 -0
- package/lib/text-to-speech-ws-base.mjs +471 -0
- package/lib/text-to-speech-ws-base.mjs.map +1 -0
- package/lib/text-to-speech-ws-internal.d.mts +71 -0
- package/lib/text-to-speech-ws-internal.d.mts.map +1 -0
- package/lib/text-to-speech-ws-internal.d.ts +71 -0
- package/lib/text-to-speech-ws-internal.d.ts.map +1 -0
- package/lib/text-to-speech-ws-internal.js +47 -0
- package/lib/text-to-speech-ws-internal.js.map +1 -0
- package/lib/text-to-speech-ws-internal.mjs +41 -0
- package/lib/text-to-speech-ws-internal.mjs.map +1 -0
- package/lib/text-to-speech-ws.d.mts +13 -0
- package/lib/text-to-speech-ws.d.mts.map +1 -0
- package/lib/text-to-speech-ws.d.ts +13 -0
- package/lib/text-to-speech-ws.d.ts.map +1 -0
- package/lib/text-to-speech-ws.js +30 -0
- package/lib/text-to-speech-ws.js.map +1 -0
- package/lib/text-to-speech-ws.mjs +25 -0
- package/lib/text-to-speech-ws.mjs.map +1 -0
- package/lib/webhooks.d.mts +6 -0
- package/lib/webhooks.d.mts.map +1 -1
- package/lib/webhooks.d.ts +6 -0
- package/lib/webhooks.d.ts.map +1 -1
- package/lib/webhooks.js +16 -0
- package/lib/webhooks.js.map +1 -1
- package/lib/webhooks.mjs +14 -0
- package/lib/webhooks.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/ai/assistants/assistants.d.mts +901 -51
- package/resources/ai/assistants/assistants.d.mts.map +1 -1
- package/resources/ai/assistants/assistants.d.ts +901 -51
- package/resources/ai/assistants/assistants.d.ts.map +1 -1
- package/resources/ai/assistants/assistants.js +0 -1
- package/resources/ai/assistants/assistants.js.map +1 -1
- package/resources/ai/assistants/assistants.mjs +0 -1
- package/resources/ai/assistants/assistants.mjs.map +1 -1
- package/resources/ai/assistants/versions.d.mts +563 -25
- package/resources/ai/assistants/versions.d.mts.map +1 -1
- package/resources/ai/assistants/versions.d.ts +563 -25
- package/resources/ai/assistants/versions.d.ts.map +1 -1
- package/resources/ai/conversations/conversations.d.mts +2 -2
- package/resources/ai/conversations/conversations.d.mts.map +1 -1
- package/resources/ai/conversations/conversations.d.ts +2 -2
- package/resources/ai/conversations/conversations.d.ts.map +1 -1
- package/resources/ai/conversations/conversations.js.map +1 -1
- package/resources/ai/conversations/conversations.mjs +1 -1
- package/resources/ai/conversations/conversations.mjs.map +1 -1
- package/resources/ai/conversations/index.d.mts +1 -1
- package/resources/ai/conversations/index.d.mts.map +1 -1
- package/resources/ai/conversations/index.d.ts +1 -1
- package/resources/ai/conversations/index.d.ts.map +1 -1
- package/resources/ai/conversations/index.js.map +1 -1
- package/resources/ai/conversations/index.mjs +1 -1
- package/resources/ai/conversations/index.mjs.map +1 -1
- package/resources/ai/conversations/messages.d.mts +46 -48
- package/resources/ai/conversations/messages.d.mts.map +1 -1
- package/resources/ai/conversations/messages.d.ts +46 -48
- package/resources/ai/conversations/messages.d.ts.map +1 -1
- package/resources/ai/conversations/messages.js +9 -6
- package/resources/ai/conversations/messages.js.map +1 -1
- package/resources/ai/conversations/messages.mjs +9 -6
- package/resources/ai/conversations/messages.mjs.map +1 -1
- package/resources/calls/actions.d.mts +114 -6
- package/resources/calls/actions.d.mts.map +1 -1
- package/resources/calls/actions.d.ts +114 -6
- package/resources/calls/actions.d.ts.map +1 -1
- package/resources/calls/actions.js +4 -0
- package/resources/calls/actions.js.map +1 -1
- package/resources/calls/actions.mjs +4 -0
- package/resources/calls/actions.mjs.map +1 -1
- package/resources/calls/calls.d.mts +168 -8
- package/resources/calls/calls.d.mts.map +1 -1
- package/resources/calls/calls.d.ts +168 -8
- package/resources/calls/calls.d.ts.map +1 -1
- package/resources/calls/calls.js +4 -0
- package/resources/calls/calls.js.map +1 -1
- package/resources/calls/calls.mjs +4 -0
- package/resources/calls/calls.mjs.map +1 -1
- package/resources/index.d.mts +2 -3
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +2 -3
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +2 -7
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -2
- package/resources/index.mjs.map +1 -1
- package/resources/inexplicit-number-orders.d.mts.map +1 -1
- package/resources/inexplicit-number-orders.d.ts.map +1 -1
- package/resources/messages/messages.d.mts +4 -0
- package/resources/messages/messages.d.mts.map +1 -1
- package/resources/messages/messages.d.ts +4 -0
- package/resources/messages/messages.d.ts.map +1 -1
- package/resources/messages/messages.js.map +1 -1
- package/resources/messages/messages.mjs.map +1 -1
- package/resources/networks/networks.d.mts.map +1 -1
- package/resources/networks/networks.d.ts.map +1 -1
- package/resources/networks/networks.js.map +1 -1
- package/resources/networks/networks.mjs.map +1 -1
- package/resources/session-analysis/session-analysis.d.mts +3 -13
- package/resources/session-analysis/session-analysis.d.mts.map +1 -1
- package/resources/session-analysis/session-analysis.d.ts +3 -13
- package/resources/session-analysis/session-analysis.d.ts.map +1 -1
- package/resources/session-analysis/session-analysis.js.map +1 -1
- package/resources/session-analysis/session-analysis.mjs.map +1 -1
- package/resources/texml/accounts/calls/calls.d.mts +45 -0
- package/resources/texml/accounts/calls/calls.d.mts.map +1 -1
- package/resources/texml/accounts/calls/calls.d.ts +45 -0
- package/resources/texml/accounts/calls/calls.d.ts.map +1 -1
- package/resources/texml/accounts/calls/calls.js.map +1 -1
- package/resources/texml/accounts/calls/calls.mjs.map +1 -1
- package/resources/text-to-speech/index.d.mts +2 -1
- package/resources/text-to-speech/index.d.mts.map +1 -1
- package/resources/text-to-speech/index.d.ts +2 -1
- package/resources/text-to-speech/index.d.ts.map +1 -1
- package/resources/text-to-speech/index.js.map +1 -1
- package/resources/text-to-speech/index.mjs.map +1 -1
- package/resources/text-to-speech/internal-base.d.mts +1 -48
- package/resources/text-to-speech/internal-base.d.mts.map +1 -1
- package/resources/text-to-speech/internal-base.d.ts +1 -48
- package/resources/text-to-speech/internal-base.d.ts.map +1 -1
- package/resources/text-to-speech/internal-base.js +5 -48
- package/resources/text-to-speech/internal-base.js.map +1 -1
- package/resources/text-to-speech/internal-base.mjs +1 -44
- package/resources/text-to-speech/internal-base.mjs.map +1 -1
- package/resources/text-to-speech/text-to-speech.d.mts +28 -3
- package/resources/text-to-speech/text-to-speech.d.mts.map +1 -1
- package/resources/text-to-speech/text-to-speech.d.ts +28 -3
- package/resources/text-to-speech/text-to-speech.d.ts.map +1 -1
- package/resources/text-to-speech/text-to-speech.js +1 -1
- package/resources/text-to-speech/text-to-speech.mjs +1 -1
- package/resources/text-to-speech/ws-base.d.mts +2 -0
- package/resources/text-to-speech/ws-base.d.mts.map +1 -0
- package/resources/text-to-speech/ws-base.d.ts +2 -0
- package/resources/text-to-speech/ws-base.d.ts.map +1 -0
- package/resources/text-to-speech/ws-base.js +7 -0
- package/resources/text-to-speech/ws-base.js.map +1 -0
- package/resources/text-to-speech/ws-base.mjs +3 -0
- package/resources/text-to-speech/ws-base.mjs.map +1 -0
- package/resources/text-to-speech/ws.d.mts +2 -41
- package/resources/text-to-speech/ws.d.mts.map +1 -1
- package/resources/text-to-speech/ws.d.ts +2 -41
- package/resources/text-to-speech/ws.d.ts.map +1 -1
- package/resources/text-to-speech/ws.js +2 -182
- package/resources/text-to-speech/ws.js.map +1 -1
- package/resources/text-to-speech/ws.mjs +1 -180
- package/resources/text-to-speech/ws.mjs.map +1 -1
- package/resources/verify-profiles.d.mts +97 -121
- package/resources/verify-profiles.d.mts.map +1 -1
- package/resources/verify-profiles.d.ts +97 -121
- package/resources/verify-profiles.d.ts.map +1 -1
- package/resources/virtual-cross-connects.d.mts.map +1 -1
- package/resources/virtual-cross-connects.d.ts.map +1 -1
- package/resources/webhooks.d.mts +642 -7
- package/resources/webhooks.d.mts.map +1 -1
- package/resources/webhooks.d.ts +642 -7
- package/resources/webhooks.d.ts.map +1 -1
- package/resources/webhooks.js +4 -10
- package/resources/webhooks.js.map +1 -1
- package/resources/webhooks.mjs +5 -11
- package/resources/webhooks.mjs.map +1 -1
- package/resources/whatsapp/phone-numbers/profile/profile.d.mts +5 -0
- package/resources/whatsapp/phone-numbers/profile/profile.d.mts.map +1 -1
- package/resources/whatsapp/phone-numbers/profile/profile.d.ts +5 -0
- package/resources/whatsapp/phone-numbers/profile/profile.d.ts.map +1 -1
- package/resources/whatsapp/phone-numbers/profile/profile.js.map +1 -1
- package/resources/whatsapp/phone-numbers/profile/profile.mjs.map +1 -1
- package/resources/wireguard-interfaces.d.mts.map +1 -1
- package/resources/wireguard-interfaces.d.ts.map +1 -1
- package/src/client.ts +22 -0
- package/src/core/EventEmitter.ts +16 -0
- package/src/core/pagination.ts +3 -3
- package/src/internal/detect-platform.ts +1 -1
- package/src/internal/types.ts +6 -8
- package/src/internal/utils/env.ts +2 -2
- package/src/internal/ws-adapter-browser.ts +123 -0
- package/src/internal/ws-adapter-node.ts +105 -0
- package/src/internal/ws-adapter.ts +30 -0
- package/src/internal/ws.ts +193 -0
- package/src/lib/text-to-speech-ws-base.ts +618 -0
- package/src/lib/text-to-speech-ws-internal.ts +111 -0
- package/src/lib/text-to-speech-ws.ts +40 -0
- package/src/lib/webhooks.ts +27 -0
- package/src/resources/ai/assistants/assistants.ts +1025 -51
- package/src/resources/ai/assistants/versions.ts +639 -25
- package/src/resources/ai/conversations/conversations.ts +12 -2
- package/src/resources/ai/conversations/index.ts +6 -1
- package/src/resources/ai/conversations/messages.ts +67 -54
- package/src/resources/calls/actions.ts +184 -4
- package/src/resources/calls/calls.ts +191 -4
- package/src/resources/index.ts +6 -12
- package/src/resources/inexplicit-number-orders.ts +2 -1
- package/src/resources/messages/messages.ts +5 -0
- package/src/resources/networks/networks.ts +2 -1
- package/src/resources/session-analysis/session-analysis.ts +3 -16
- package/src/resources/texml/accounts/calls/calls.ts +54 -0
- package/src/resources/text-to-speech/index.ts +2 -1
- package/src/resources/text-to-speech/internal-base.ts +6 -95
- package/src/resources/text-to-speech/text-to-speech.ts +33 -3
- package/src/resources/text-to-speech/ws-base.ts +7 -0
- package/src/resources/text-to-speech/ws.ts +2 -201
- package/src/resources/verify-profiles.ts +109 -142
- package/src/resources/virtual-cross-connects.ts +2 -1
- package/src/resources/webhooks.ts +886 -45
- package/src/resources/whatsapp/phone-numbers/profile/profile.ts +7 -0
- package/src/resources/wireguard-interfaces.ts +2 -1
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -33,7 +33,6 @@ export declare class Assistants extends APIResource {
|
|
|
33
33
|
* const inferenceEmbedding =
|
|
34
34
|
* await client.ai.assistants.create({
|
|
35
35
|
* instructions: 'instructions',
|
|
36
|
-
* model: 'model',
|
|
37
36
|
* name: 'name',
|
|
38
37
|
* });
|
|
39
38
|
* ```
|
|
@@ -607,9 +606,11 @@ export interface InferenceEmbedding {
|
|
|
607
606
|
*/
|
|
608
607
|
instructions: string;
|
|
609
608
|
/**
|
|
610
|
-
* ID of the model to use. You can use the
|
|
609
|
+
* ID of the model to use when `external_llm` is not set. You can use the
|
|
611
610
|
* [Get models API](https://developers.telnyx.com/api-reference/chat/get-available-models)
|
|
612
|
-
* to see
|
|
611
|
+
* to see available models. If `external_llm` is provided, the assistant uses
|
|
612
|
+
* `external_llm` instead of this field. If neither `model` nor `external_llm` is
|
|
613
|
+
* provided, Telnyx applies the default model.
|
|
613
614
|
*/
|
|
614
615
|
model: string;
|
|
615
616
|
name: string;
|
|
@@ -621,13 +622,26 @@ export interface InferenceEmbedding {
|
|
|
621
622
|
[key: string]: unknown;
|
|
622
623
|
};
|
|
623
624
|
/**
|
|
624
|
-
*
|
|
625
|
-
*
|
|
626
|
-
*
|
|
627
|
-
*
|
|
625
|
+
* Timeout in milliseconds for the dynamic variables webhook. Must be between 1 and
|
|
626
|
+
* 10000 ms. If the webhook does not respond within this timeout, the call proceeds
|
|
627
|
+
* with default values. See the
|
|
628
|
+
* [dynamic variables guide](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables).
|
|
629
|
+
*/
|
|
630
|
+
dynamic_variables_webhook_timeout_ms?: number;
|
|
631
|
+
/**
|
|
632
|
+
* If `dynamic_variables_webhook_url` is set, Telnyx sends a POST request to this
|
|
633
|
+
* URL at the start of the conversation to resolve dynamic variables. **Gotcha:**
|
|
634
|
+
* the webhook response must wrap variables under a top-level `dynamic_variables`
|
|
635
|
+
* object, e.g. `{"dynamic_variables": {"customer_name": "Jane"}}`. Returning a
|
|
636
|
+
* flat object will be ignored and variables will fall back to their defaults. See
|
|
637
|
+
* the
|
|
638
|
+
* [dynamic variables guide](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables)
|
|
639
|
+
* for the full request/response format and timeout behavior.
|
|
628
640
|
*/
|
|
629
641
|
dynamic_variables_webhook_url?: string;
|
|
630
642
|
enabled_features?: Array<EnabledFeatures>;
|
|
643
|
+
external_llm?: InferenceEmbedding.ExternalLlm;
|
|
644
|
+
fallback_config?: InferenceEmbedding.FallbackConfig;
|
|
631
645
|
/**
|
|
632
646
|
* Text that the assistant will use to start the conversation. This may be
|
|
633
647
|
* templated with
|
|
@@ -640,29 +654,290 @@ export interface InferenceEmbedding {
|
|
|
640
654
|
import_metadata?: ImportMetadata;
|
|
641
655
|
insight_settings?: InsightSettings;
|
|
642
656
|
/**
|
|
643
|
-
*
|
|
644
|
-
*
|
|
657
|
+
* Connected integrations attached to the assistant. The catalog of available
|
|
658
|
+
* integrations is at `/ai/integrations`; the user's connected integrations are at
|
|
659
|
+
* `/ai/integrations/connections`. Each item references a catalog integration by
|
|
660
|
+
* `integration_id`.
|
|
661
|
+
*/
|
|
662
|
+
integrations?: Array<InferenceEmbedding.Integration>;
|
|
663
|
+
/**
|
|
664
|
+
* Settings for interruptions and how the assistant decides the user has finished
|
|
665
|
+
* speaking. These timings are most relevant when using non turn-taking
|
|
666
|
+
* transcription models. For turn-taking models like `deepgram/flux`, end-of-turn
|
|
667
|
+
* behavior is controlled by the transcription end-of-turn settings under
|
|
668
|
+
* `transcription.settings` (`eot_threshold`, `eot_timeout_ms`,
|
|
669
|
+
* `eager_eot_threshold`).
|
|
670
|
+
*/
|
|
671
|
+
interruption_settings?: InferenceEmbedding.InterruptionSettings;
|
|
672
|
+
/**
|
|
673
|
+
* This is only needed when using third-party inference providers selected by
|
|
674
|
+
* `model`. The `identifier` for an integration secret
|
|
645
675
|
* [/v2/integration_secrets](https://developers.telnyx.com/api-reference/integration-secrets/create-a-secret)
|
|
646
|
-
* that refers to your LLM provider's API key.
|
|
647
|
-
*
|
|
676
|
+
* that refers to your LLM provider's API key. For bring-your-own endpoint
|
|
677
|
+
* authentication, use `external_llm.llm_api_key_ref` instead. Warning: Free plans
|
|
678
|
+
* are unlikely to work with this integration.
|
|
648
679
|
*/
|
|
649
680
|
llm_api_key_ref?: string;
|
|
681
|
+
/**
|
|
682
|
+
* MCP servers attached to the assistant. Create MCP servers with
|
|
683
|
+
* `/ai/mcp_servers`, then reference them by `id` here.
|
|
684
|
+
*/
|
|
685
|
+
mcp_servers?: Array<InferenceEmbedding.McpServer>;
|
|
650
686
|
messaging_settings?: MessagingSettings;
|
|
651
687
|
observability_settings?: Observability;
|
|
688
|
+
/**
|
|
689
|
+
* Configuration for post-conversation processing. When enabled, the assistant
|
|
690
|
+
* receives one additional LLM turn after the conversation ends, allowing it to
|
|
691
|
+
* execute tool calls such as logging to a CRM or sending a summary. The assistant
|
|
692
|
+
* can execute multiple parallel or sequential tools during this phase.
|
|
693
|
+
* Telephony-control tools (e.g. hangup, transfer) are unavailable
|
|
694
|
+
* post-conversation. Beta feature.
|
|
695
|
+
*/
|
|
696
|
+
post_conversation_settings?: InferenceEmbedding.PostConversationSettings;
|
|
652
697
|
privacy_settings?: PrivacySettings;
|
|
698
|
+
/**
|
|
699
|
+
* IDs of missions related to this assistant.
|
|
700
|
+
*/
|
|
701
|
+
related_mission_ids?: Array<string>;
|
|
702
|
+
/**
|
|
703
|
+
* Tags associated with the assistant. Tags can also be managed with the assistant
|
|
704
|
+
* tag endpoints.
|
|
705
|
+
*/
|
|
706
|
+
tags?: Array<string>;
|
|
653
707
|
telephony_settings?: TelephonySettings;
|
|
654
708
|
/**
|
|
655
|
-
*
|
|
656
|
-
*
|
|
709
|
+
* Deprecated for new integrations. Inline tool definitions available to the
|
|
710
|
+
* assistant. Prefer `tool_ids` to attach shared tools created with the AI Tools
|
|
711
|
+
* endpoints.
|
|
657
712
|
*/
|
|
658
713
|
tools?: Array<AssistantTool>;
|
|
659
714
|
transcription?: TranscriptionSettings;
|
|
715
|
+
/**
|
|
716
|
+
* Timestamp when this assistant version was created.
|
|
717
|
+
*/
|
|
718
|
+
version_created_at?: string;
|
|
719
|
+
/**
|
|
720
|
+
* Identifier for the assistant version returned by version-aware assistant
|
|
721
|
+
* endpoints.
|
|
722
|
+
*/
|
|
723
|
+
version_id?: string;
|
|
724
|
+
/**
|
|
725
|
+
* Human-readable name for the assistant version.
|
|
726
|
+
*/
|
|
727
|
+
version_name?: string;
|
|
660
728
|
voice_settings?: VoiceSettings;
|
|
661
729
|
/**
|
|
662
730
|
* Configuration settings for the assistant's web widget.
|
|
663
731
|
*/
|
|
664
732
|
widget_settings?: WidgetSettings;
|
|
665
733
|
}
|
|
734
|
+
export declare namespace InferenceEmbedding {
|
|
735
|
+
interface ExternalLlm {
|
|
736
|
+
/**
|
|
737
|
+
* Base URL for the external LLM endpoint.
|
|
738
|
+
*/
|
|
739
|
+
base_url: string;
|
|
740
|
+
/**
|
|
741
|
+
* Model identifier to use with the external LLM endpoint.
|
|
742
|
+
*/
|
|
743
|
+
model: string;
|
|
744
|
+
/**
|
|
745
|
+
* Authentication method used when connecting to the external LLM endpoint.
|
|
746
|
+
*/
|
|
747
|
+
authentication_method?: 'token' | 'certificate';
|
|
748
|
+
/**
|
|
749
|
+
* Integration secret identifier for the client certificate used with certificate
|
|
750
|
+
* authentication.
|
|
751
|
+
*/
|
|
752
|
+
certificate_ref?: string;
|
|
753
|
+
/**
|
|
754
|
+
* When `true`, Telnyx forwards the assistant's dynamic variables to the external
|
|
755
|
+
* LLM endpoint as a top-level `extra_metadata` object on the chat completion
|
|
756
|
+
* request body. Defaults to `false`. Example payload sent to the external
|
|
757
|
+
* endpoint:
|
|
758
|
+
* `{"extra_metadata": {"customer_name": "Jane", "account_id": "acct_789", "telnyx_agent_target": "+13125550100", "telnyx_end_user_target": "+13125550123"}}`.
|
|
759
|
+
* Distinct from OpenAI's native `metadata` field, which has its own size and type
|
|
760
|
+
* limits.
|
|
761
|
+
*/
|
|
762
|
+
forward_metadata?: boolean;
|
|
763
|
+
/**
|
|
764
|
+
* Integration secret identifier for the external LLM API key.
|
|
765
|
+
*/
|
|
766
|
+
llm_api_key_ref?: string;
|
|
767
|
+
/**
|
|
768
|
+
* URL used to retrieve an access token when certificate authentication is enabled.
|
|
769
|
+
*/
|
|
770
|
+
token_retrieval_url?: string;
|
|
771
|
+
}
|
|
772
|
+
interface FallbackConfig {
|
|
773
|
+
external_llm?: FallbackConfig.ExternalLlm;
|
|
774
|
+
/**
|
|
775
|
+
* Integration secret identifier for the fallback model API key.
|
|
776
|
+
*/
|
|
777
|
+
llm_api_key_ref?: string;
|
|
778
|
+
/**
|
|
779
|
+
* Fallback Telnyx-hosted model to use when the primary LLM provider is
|
|
780
|
+
* unavailable.
|
|
781
|
+
*/
|
|
782
|
+
model?: string;
|
|
783
|
+
}
|
|
784
|
+
namespace FallbackConfig {
|
|
785
|
+
interface ExternalLlm {
|
|
786
|
+
/**
|
|
787
|
+
* Base URL for the external LLM endpoint.
|
|
788
|
+
*/
|
|
789
|
+
base_url: string;
|
|
790
|
+
/**
|
|
791
|
+
* Model identifier to use with the external LLM endpoint.
|
|
792
|
+
*/
|
|
793
|
+
model: string;
|
|
794
|
+
/**
|
|
795
|
+
* Authentication method used when connecting to the external LLM endpoint.
|
|
796
|
+
*/
|
|
797
|
+
authentication_method?: 'token' | 'certificate';
|
|
798
|
+
/**
|
|
799
|
+
* Integration secret identifier for the client certificate used with certificate
|
|
800
|
+
* authentication.
|
|
801
|
+
*/
|
|
802
|
+
certificate_ref?: string;
|
|
803
|
+
/**
|
|
804
|
+
* When `true`, Telnyx forwards the assistant's dynamic variables to the external
|
|
805
|
+
* LLM endpoint as a top-level `extra_metadata` object on the chat completion
|
|
806
|
+
* request body. Defaults to `false`. Example payload sent to the external
|
|
807
|
+
* endpoint:
|
|
808
|
+
* `{"extra_metadata": {"customer_name": "Jane", "account_id": "acct_789", "telnyx_agent_target": "+13125550100", "telnyx_end_user_target": "+13125550123"}}`.
|
|
809
|
+
* Distinct from OpenAI's native `metadata` field, which has its own size and type
|
|
810
|
+
* limits.
|
|
811
|
+
*/
|
|
812
|
+
forward_metadata?: boolean;
|
|
813
|
+
/**
|
|
814
|
+
* Integration secret identifier for the external LLM API key.
|
|
815
|
+
*/
|
|
816
|
+
llm_api_key_ref?: string;
|
|
817
|
+
/**
|
|
818
|
+
* URL used to retrieve an access token when certificate authentication is enabled.
|
|
819
|
+
*/
|
|
820
|
+
token_retrieval_url?: string;
|
|
821
|
+
}
|
|
822
|
+
}
|
|
823
|
+
/**
|
|
824
|
+
* Reference to a connected integration attached to an assistant. Discover
|
|
825
|
+
* available integrations with `/ai/integrations` and connected integrations with
|
|
826
|
+
* `/ai/integrations/connections`.
|
|
827
|
+
*/
|
|
828
|
+
interface Integration {
|
|
829
|
+
/**
|
|
830
|
+
* Catalog integration ID to attach. This is the `id` from the integrations catalog
|
|
831
|
+
* at `/ai/integrations` (the same value also appears as `integration_id` on
|
|
832
|
+
* entries returned by `/ai/integrations/connections`). It is **not** the
|
|
833
|
+
* connection-level `id` from `/ai/integrations/connections`.
|
|
834
|
+
*/
|
|
835
|
+
integration_id: string;
|
|
836
|
+
/**
|
|
837
|
+
* Optional per-assistant allowlist of integration tool names. When omitted or
|
|
838
|
+
* empty, all tools allowed by the connected integration are available to the
|
|
839
|
+
* assistant.
|
|
840
|
+
*/
|
|
841
|
+
allowed_list?: Array<string>;
|
|
842
|
+
}
|
|
843
|
+
/**
|
|
844
|
+
* Settings for interruptions and how the assistant decides the user has finished
|
|
845
|
+
* speaking. These timings are most relevant when using non turn-taking
|
|
846
|
+
* transcription models. For turn-taking models like `deepgram/flux`, end-of-turn
|
|
847
|
+
* behavior is controlled by the transcription end-of-turn settings under
|
|
848
|
+
* `transcription.settings` (`eot_threshold`, `eot_timeout_ms`,
|
|
849
|
+
* `eager_eot_threshold`).
|
|
850
|
+
*/
|
|
851
|
+
interface InterruptionSettings {
|
|
852
|
+
/**
|
|
853
|
+
* Whether users can interrupt the assistant while it is speaking.
|
|
854
|
+
*/
|
|
855
|
+
enable?: boolean;
|
|
856
|
+
/**
|
|
857
|
+
* Controls when the assistant starts speaking after the user stops. These
|
|
858
|
+
* thresholds primarily apply to non turn-taking transcription models. For
|
|
859
|
+
* turn-taking models like `deepgram/flux`, end-of-turn detection is driven by the
|
|
860
|
+
* transcription end-of-turn settings under `transcription.settings` instead.
|
|
861
|
+
*/
|
|
862
|
+
start_speaking_plan?: InterruptionSettings.StartSpeakingPlan;
|
|
863
|
+
}
|
|
864
|
+
namespace InterruptionSettings {
|
|
865
|
+
/**
|
|
866
|
+
* Controls when the assistant starts speaking after the user stops. These
|
|
867
|
+
* thresholds primarily apply to non turn-taking transcription models. For
|
|
868
|
+
* turn-taking models like `deepgram/flux`, end-of-turn detection is driven by the
|
|
869
|
+
* transcription end-of-turn settings under `transcription.settings` instead.
|
|
870
|
+
*/
|
|
871
|
+
interface StartSpeakingPlan {
|
|
872
|
+
/**
|
|
873
|
+
* Endpointing thresholds used to decide when the user has finished speaking.
|
|
874
|
+
* Applies to non turn-taking transcription models. For `deepgram/flux`, use
|
|
875
|
+
* `transcription.settings.eot_threshold` / `eot_timeout_ms` /
|
|
876
|
+
* `eager_eot_threshold`.
|
|
877
|
+
*/
|
|
878
|
+
transcription_endpointing_plan?: StartSpeakingPlan.TranscriptionEndpointingPlan;
|
|
879
|
+
/**
|
|
880
|
+
* Minimum seconds to wait before the assistant starts speaking.
|
|
881
|
+
*/
|
|
882
|
+
wait_seconds?: number;
|
|
883
|
+
}
|
|
884
|
+
namespace StartSpeakingPlan {
|
|
885
|
+
/**
|
|
886
|
+
* Endpointing thresholds used to decide when the user has finished speaking.
|
|
887
|
+
* Applies to non turn-taking transcription models. For `deepgram/flux`, use
|
|
888
|
+
* `transcription.settings.eot_threshold` / `eot_timeout_ms` /
|
|
889
|
+
* `eager_eot_threshold`.
|
|
890
|
+
*/
|
|
891
|
+
interface TranscriptionEndpointingPlan {
|
|
892
|
+
/**
|
|
893
|
+
* Seconds to wait after the transcript ends without punctuation.
|
|
894
|
+
*/
|
|
895
|
+
on_no_punctuation_seconds?: number;
|
|
896
|
+
/**
|
|
897
|
+
* Seconds to wait after the transcript ends with a number.
|
|
898
|
+
*/
|
|
899
|
+
on_number_seconds?: number;
|
|
900
|
+
/**
|
|
901
|
+
* Seconds to wait after the transcript ends with punctuation.
|
|
902
|
+
*/
|
|
903
|
+
on_punctuation_seconds?: number;
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
}
|
|
907
|
+
/**
|
|
908
|
+
* Reference to an MCP server attached to an assistant. Create and manage MCP
|
|
909
|
+
* servers with the `/ai/mcp_servers` endpoints, then attach them to assistants by
|
|
910
|
+
* ID.
|
|
911
|
+
*/
|
|
912
|
+
interface McpServer {
|
|
913
|
+
/**
|
|
914
|
+
* ID of the MCP server to attach. This must be the `id` of an MCP server returned
|
|
915
|
+
* by the `/ai/mcp_servers` endpoints.
|
|
916
|
+
*/
|
|
917
|
+
id: string;
|
|
918
|
+
/**
|
|
919
|
+
* Optional per-assistant allowlist of MCP tool names. When omitted, the assistant
|
|
920
|
+
* uses the MCP server's configured `allowed_tools`.
|
|
921
|
+
*/
|
|
922
|
+
allowed_tools?: Array<string>;
|
|
923
|
+
}
|
|
924
|
+
/**
|
|
925
|
+
* Configuration for post-conversation processing. When enabled, the assistant
|
|
926
|
+
* receives one additional LLM turn after the conversation ends, allowing it to
|
|
927
|
+
* execute tool calls such as logging to a CRM or sending a summary. The assistant
|
|
928
|
+
* can execute multiple parallel or sequential tools during this phase.
|
|
929
|
+
* Telephony-control tools (e.g. hangup, transfer) are unavailable
|
|
930
|
+
* post-conversation. Beta feature.
|
|
931
|
+
*/
|
|
932
|
+
interface PostConversationSettings {
|
|
933
|
+
/**
|
|
934
|
+
* Whether post-conversation processing is enabled. When true, the assistant will
|
|
935
|
+
* be invoked after the conversation ends to perform any final tool calls. Defaults
|
|
936
|
+
* to false.
|
|
937
|
+
*/
|
|
938
|
+
enabled?: boolean;
|
|
939
|
+
}
|
|
940
|
+
}
|
|
666
941
|
export interface InferenceEmbeddingWebhookToolParams {
|
|
667
942
|
type: 'webhook';
|
|
668
943
|
webhook: InferenceEmbeddingWebhookToolParams.Webhook;
|
|
@@ -901,6 +1176,12 @@ export interface TelephonySettings {
|
|
|
901
1176
|
* transferred to a human representative).
|
|
902
1177
|
*/
|
|
903
1178
|
time_limit_secs?: number;
|
|
1179
|
+
/**
|
|
1180
|
+
* Duration in seconds of end user silence before the assistant checks in on the
|
|
1181
|
+
* user. When this limit is reached the assistant will prompt the user to respond.
|
|
1182
|
+
* This is distinct from user_idle_timeout_secs which stops the assistant entirely.
|
|
1183
|
+
*/
|
|
1184
|
+
user_idle_reply_secs?: number;
|
|
904
1185
|
/**
|
|
905
1186
|
* Maximum duration in seconds of end user silence on the call. When this limit is
|
|
906
1187
|
* reached the assistant will be stopped. This limit does not apply to portions of
|
|
@@ -1007,22 +1288,34 @@ export declare namespace TelephonySettings {
|
|
|
1007
1288
|
}
|
|
1008
1289
|
export interface TranscriptionSettings {
|
|
1009
1290
|
/**
|
|
1010
|
-
*
|
|
1011
|
-
*
|
|
1291
|
+
* Integration secret identifier for the transcription provider API key. Currently
|
|
1292
|
+
* used for Azure transcription regions that require a customer-provided API key.
|
|
1293
|
+
*/
|
|
1294
|
+
api_key_ref?: string;
|
|
1295
|
+
/**
|
|
1296
|
+
* The language of the audio to be transcribed. If not set, or if set to `auto`,
|
|
1297
|
+
* supported models will automatically detect the language. For `deepgram/flux`,
|
|
1298
|
+
* supported values are: `auto` (Telnyx language detection controls the language
|
|
1299
|
+
* hint), `multi` (no language hint), and language-specific hints `en`, `es`, `fr`,
|
|
1300
|
+
* `de`, `hi`, `ru`, `pt`, `ja`, `it`, and `nl`.
|
|
1012
1301
|
*/
|
|
1013
1302
|
language?: string;
|
|
1014
1303
|
/**
|
|
1015
|
-
* The speech to text model to be used by the voice assistant. All
|
|
1016
|
-
*
|
|
1304
|
+
* The speech to text model to be used by the voice assistant. All Deepgram models
|
|
1305
|
+
* are run on-premise.
|
|
1017
1306
|
*
|
|
1018
|
-
* - `deepgram/flux` is optimized for turn-taking
|
|
1019
|
-
* - `deepgram/nova-3` is
|
|
1020
|
-
*
|
|
1307
|
+
* - `deepgram/flux` is optimized for turn-taking with multilingual language hints.
|
|
1308
|
+
* - `deepgram/nova-3` is multilingual with automatic language detection.
|
|
1309
|
+
* - `deepgram/nova-2` is Deepgram's previous-generation multilingual model.
|
|
1310
|
+
* - `azure/fast` is a multilingual Azure transcription model.
|
|
1311
|
+
* - `assemblyai/universal-streaming` is a multilingual streaming model with
|
|
1312
|
+
* configurable turn detection.
|
|
1313
|
+
* - `xai/grok-stt` is a multilingual Grok STT model.
|
|
1021
1314
|
*/
|
|
1022
|
-
model?: 'deepgram/flux' | 'deepgram/nova-3' | 'deepgram/nova-2' | 'azure/fast' | 'distil-whisper/distil-large-v2' | 'openai/whisper-large-v3-turbo';
|
|
1315
|
+
model?: 'deepgram/flux' | 'deepgram/nova-3' | 'deepgram/nova-2' | 'azure/fast' | 'assemblyai/universal-streaming' | 'xai/grok-stt' | 'distil-whisper/distil-large-v2' | 'openai/whisper-large-v3-turbo';
|
|
1023
1316
|
/**
|
|
1024
1317
|
* Region on third party cloud providers (currently Azure) if using one of their
|
|
1025
|
-
* models
|
|
1318
|
+
* models. Some regions require `api_key_ref`.
|
|
1026
1319
|
*/
|
|
1027
1320
|
region?: string;
|
|
1028
1321
|
settings?: TranscriptionSettingsConfig;
|
|
@@ -1034,6 +1327,12 @@ export interface TranscriptionSettingsConfig {
|
|
|
1034
1327
|
* eot_threshold effectively disables eager end of turn.
|
|
1035
1328
|
*/
|
|
1036
1329
|
eager_eot_threshold?: number;
|
|
1330
|
+
/**
|
|
1331
|
+
* Available only for assemblyai/universal-streaming. Confidence level required to
|
|
1332
|
+
* trigger an end of turn. Higher values require more certainty before ending a
|
|
1333
|
+
* turn.
|
|
1334
|
+
*/
|
|
1335
|
+
end_of_turn_confidence_threshold?: number;
|
|
1037
1336
|
/**
|
|
1038
1337
|
* Available only for deepgram/flux. Confidence required to trigger an end of turn.
|
|
1039
1338
|
* Higher values = more reliable turn detection but slightly increased latency.
|
|
@@ -1044,6 +1343,23 @@ export interface TranscriptionSettingsConfig {
|
|
|
1044
1343
|
* an end of turn, regardless of confidence.
|
|
1045
1344
|
*/
|
|
1046
1345
|
eot_timeout_ms?: number;
|
|
1346
|
+
/**
|
|
1347
|
+
* Available only for deepgram/nova-3 and deepgram/flux. A comma-separated list of
|
|
1348
|
+
* key terms to boost for recognition during transcription. Helps improve accuracy
|
|
1349
|
+
* for domain-specific terminology, proper nouns, or uncommon words.
|
|
1350
|
+
*/
|
|
1351
|
+
keyterm?: string;
|
|
1352
|
+
/**
|
|
1353
|
+
* Available only for assemblyai/universal-streaming. Maximum duration of silence
|
|
1354
|
+
* in milliseconds before forcing an end of turn.
|
|
1355
|
+
*/
|
|
1356
|
+
max_turn_silence?: number;
|
|
1357
|
+
/**
|
|
1358
|
+
* Available only for assemblyai/universal-streaming. Minimum duration of silence
|
|
1359
|
+
* in milliseconds before a turn can end. Must be less than or equal to
|
|
1360
|
+
* max_turn_silence.
|
|
1361
|
+
*/
|
|
1362
|
+
min_turn_silence?: number;
|
|
1047
1363
|
numerals?: boolean;
|
|
1048
1364
|
smart_format?: boolean;
|
|
1049
1365
|
}
|
|
@@ -1084,7 +1400,11 @@ export interface VoiceSettings {
|
|
|
1084
1400
|
* key as an integration secret under the `api_key_ref` field. See
|
|
1085
1401
|
* [integration secrets documentation](https://developers.telnyx.com/api-reference/integration-secrets/create-a-secret)
|
|
1086
1402
|
* for details. For Telnyx voices, use `Telnyx.<model_id>.<voice_id>` (e.g.
|
|
1087
|
-
* Telnyx.KokoroTTS.af_heart)
|
|
1403
|
+
* Telnyx.KokoroTTS.af_heart). The voice portion of the identifier supports
|
|
1404
|
+
* [dynamic variables](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables)
|
|
1405
|
+
* using mustache syntax (e.g. `Telnyx.Ultra.{{voice_id}}`). The variable is
|
|
1406
|
+
* resolved at call time from your dynamic variables webhook, allowing you to
|
|
1407
|
+
* select the voice dynamically per call.
|
|
1088
1408
|
*/
|
|
1089
1409
|
voice: string;
|
|
1090
1410
|
/**
|
|
@@ -1376,12 +1696,6 @@ export interface AssistantCreateParams {
|
|
|
1376
1696
|
* [dynamic variables](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables)
|
|
1377
1697
|
*/
|
|
1378
1698
|
instructions: string;
|
|
1379
|
-
/**
|
|
1380
|
-
* ID of the model to use. You can use the
|
|
1381
|
-
* [Get models API](https://developers.telnyx.com/api-reference/chat/get-available-models)
|
|
1382
|
-
* to see all of your available models,
|
|
1383
|
-
*/
|
|
1384
|
-
model: string;
|
|
1385
1699
|
name: string;
|
|
1386
1700
|
description?: string;
|
|
1387
1701
|
/**
|
|
@@ -1391,13 +1705,26 @@ export interface AssistantCreateParams {
|
|
|
1391
1705
|
[key: string]: unknown;
|
|
1392
1706
|
};
|
|
1393
1707
|
/**
|
|
1394
|
-
*
|
|
1395
|
-
*
|
|
1396
|
-
*
|
|
1397
|
-
*
|
|
1708
|
+
* Timeout in milliseconds for the dynamic variables webhook. Must be between 1 and
|
|
1709
|
+
* 10000 ms. If the webhook does not respond within this timeout, the call proceeds
|
|
1710
|
+
* with default values. See the
|
|
1711
|
+
* [dynamic variables guide](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables).
|
|
1712
|
+
*/
|
|
1713
|
+
dynamic_variables_webhook_timeout_ms?: number;
|
|
1714
|
+
/**
|
|
1715
|
+
* If `dynamic_variables_webhook_url` is set, Telnyx sends a POST request to this
|
|
1716
|
+
* URL at the start of the conversation to resolve dynamic variables. **Gotcha:**
|
|
1717
|
+
* the webhook response must wrap variables under a top-level `dynamic_variables`
|
|
1718
|
+
* object, e.g. `{"dynamic_variables": {"customer_name": "Jane"}}`. Returning a
|
|
1719
|
+
* flat object will be ignored and variables will fall back to their defaults. See
|
|
1720
|
+
* the
|
|
1721
|
+
* [dynamic variables guide](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables)
|
|
1722
|
+
* for the full request/response format and timeout behavior.
|
|
1398
1723
|
*/
|
|
1399
1724
|
dynamic_variables_webhook_url?: string;
|
|
1400
1725
|
enabled_features?: Array<EnabledFeatures>;
|
|
1726
|
+
external_llm?: AssistantCreateParams.ExternalLlm;
|
|
1727
|
+
fallback_config?: AssistantCreateParams.FallbackConfig;
|
|
1401
1728
|
/**
|
|
1402
1729
|
* Text that the assistant will use to start the conversation. This may be
|
|
1403
1730
|
* templated with
|
|
@@ -1409,21 +1736,70 @@ export interface AssistantCreateParams {
|
|
|
1409
1736
|
greeting?: string;
|
|
1410
1737
|
insight_settings?: InsightSettings;
|
|
1411
1738
|
/**
|
|
1412
|
-
*
|
|
1413
|
-
*
|
|
1739
|
+
* Connected integrations attached to the assistant. The catalog of available
|
|
1740
|
+
* integrations is at `/ai/integrations`; the user's connected integrations are at
|
|
1741
|
+
* `/ai/integrations/connections`. Each item references a catalog integration by
|
|
1742
|
+
* `integration_id`.
|
|
1743
|
+
*/
|
|
1744
|
+
integrations?: Array<AssistantCreateParams.Integration>;
|
|
1745
|
+
/**
|
|
1746
|
+
* Settings for interruptions and how the assistant decides the user has finished
|
|
1747
|
+
* speaking. These timings are most relevant when using non turn-taking
|
|
1748
|
+
* transcription models. For turn-taking models like `deepgram/flux`, end-of-turn
|
|
1749
|
+
* behavior is controlled by the transcription end-of-turn settings under
|
|
1750
|
+
* `transcription.settings` (`eot_threshold`, `eot_timeout_ms`,
|
|
1751
|
+
* `eager_eot_threshold`).
|
|
1752
|
+
*/
|
|
1753
|
+
interruption_settings?: AssistantCreateParams.InterruptionSettings;
|
|
1754
|
+
/**
|
|
1755
|
+
* This is only needed when using third-party inference providers selected by
|
|
1756
|
+
* `model`. The `identifier` for an integration secret
|
|
1414
1757
|
* [/v2/integration_secrets](https://developers.telnyx.com/api-reference/integration-secrets/create-a-secret)
|
|
1415
|
-
* that refers to your LLM provider's API key.
|
|
1416
|
-
*
|
|
1758
|
+
* that refers to your LLM provider's API key. For bring-your-own endpoint
|
|
1759
|
+
* authentication, use `external_llm.llm_api_key_ref` instead. Warning: Free plans
|
|
1760
|
+
* are unlikely to work with this integration.
|
|
1417
1761
|
*/
|
|
1418
1762
|
llm_api_key_ref?: string;
|
|
1763
|
+
/**
|
|
1764
|
+
* MCP servers attached to the assistant. Create MCP servers with
|
|
1765
|
+
* `/ai/mcp_servers`, then reference them by `id` here.
|
|
1766
|
+
*/
|
|
1767
|
+
mcp_servers?: Array<AssistantCreateParams.McpServer>;
|
|
1419
1768
|
messaging_settings?: MessagingSettings;
|
|
1769
|
+
/**
|
|
1770
|
+
* ID of the model to use when `external_llm` is not set. You can use the
|
|
1771
|
+
* [Get models API](https://developers.telnyx.com/api-reference/chat/get-available-models)
|
|
1772
|
+
* to see available models. If `external_llm` is provided, the assistant uses
|
|
1773
|
+
* `external_llm` instead of this field. If neither `model` nor `external_llm` is
|
|
1774
|
+
* provided, Telnyx applies the default model.
|
|
1775
|
+
*/
|
|
1776
|
+
model?: string;
|
|
1420
1777
|
observability_settings?: ObservabilityReq;
|
|
1778
|
+
/**
|
|
1779
|
+
* Configuration for post-conversation processing. When enabled, the assistant
|
|
1780
|
+
* receives one additional LLM turn after the conversation ends, allowing it to
|
|
1781
|
+
* execute tool calls such as logging to a CRM or sending a summary. The assistant
|
|
1782
|
+
* can execute multiple parallel or sequential tools during this phase.
|
|
1783
|
+
* Telephony-control tools (e.g. hangup, transfer) are unavailable
|
|
1784
|
+
* post-conversation. Beta feature.
|
|
1785
|
+
*/
|
|
1786
|
+
post_conversation_settings?: AssistantCreateParams.PostConversationSettings;
|
|
1421
1787
|
privacy_settings?: PrivacySettings;
|
|
1788
|
+
/**
|
|
1789
|
+
* Tags associated with the assistant. Tags can also be managed with the assistant
|
|
1790
|
+
* tag endpoints.
|
|
1791
|
+
*/
|
|
1792
|
+
tags?: Array<string>;
|
|
1422
1793
|
telephony_settings?: TelephonySettings;
|
|
1794
|
+
/**
|
|
1795
|
+
* IDs of shared tools to attach to the assistant. New integrations should prefer
|
|
1796
|
+
* `tool_ids` over inline `tools`.
|
|
1797
|
+
*/
|
|
1423
1798
|
tool_ids?: Array<string>;
|
|
1424
1799
|
/**
|
|
1425
|
-
*
|
|
1426
|
-
*
|
|
1800
|
+
* Deprecated for new integrations. Inline tool definitions available to the
|
|
1801
|
+
* assistant. Prefer `tool_ids` to attach shared tools created with the AI Tools
|
|
1802
|
+
* endpoints.
|
|
1427
1803
|
*/
|
|
1428
1804
|
tools?: Array<AssistantTool>;
|
|
1429
1805
|
transcription?: TranscriptionSettings;
|
|
@@ -1433,6 +1809,213 @@ export interface AssistantCreateParams {
|
|
|
1433
1809
|
*/
|
|
1434
1810
|
widget_settings?: WidgetSettings;
|
|
1435
1811
|
}
|
|
1812
|
+
export declare namespace AssistantCreateParams {
|
|
1813
|
+
interface ExternalLlm {
|
|
1814
|
+
/**
|
|
1815
|
+
* Base URL for the external LLM endpoint.
|
|
1816
|
+
*/
|
|
1817
|
+
base_url: string;
|
|
1818
|
+
/**
|
|
1819
|
+
* Model identifier to use with the external LLM endpoint.
|
|
1820
|
+
*/
|
|
1821
|
+
model: string;
|
|
1822
|
+
/**
|
|
1823
|
+
* Authentication method used when connecting to the external LLM endpoint.
|
|
1824
|
+
*/
|
|
1825
|
+
authentication_method?: 'token' | 'certificate';
|
|
1826
|
+
/**
|
|
1827
|
+
* Integration secret identifier for the client certificate used with certificate
|
|
1828
|
+
* authentication.
|
|
1829
|
+
*/
|
|
1830
|
+
certificate_ref?: string;
|
|
1831
|
+
/**
|
|
1832
|
+
* When `true`, Telnyx forwards the assistant's dynamic variables to the external
|
|
1833
|
+
* LLM endpoint as a top-level `extra_metadata` object on the chat completion
|
|
1834
|
+
* request body. Defaults to `false`. Example payload sent to the external
|
|
1835
|
+
* endpoint:
|
|
1836
|
+
* `{"extra_metadata": {"customer_name": "Jane", "account_id": "acct_789", "telnyx_agent_target": "+13125550100", "telnyx_end_user_target": "+13125550123"}}`.
|
|
1837
|
+
* Distinct from OpenAI's native `metadata` field, which has its own size and type
|
|
1838
|
+
* limits.
|
|
1839
|
+
*/
|
|
1840
|
+
forward_metadata?: boolean;
|
|
1841
|
+
/**
|
|
1842
|
+
* Integration secret identifier for the external LLM API key.
|
|
1843
|
+
*/
|
|
1844
|
+
llm_api_key_ref?: string;
|
|
1845
|
+
/**
|
|
1846
|
+
* URL used to retrieve an access token when certificate authentication is enabled.
|
|
1847
|
+
*/
|
|
1848
|
+
token_retrieval_url?: string;
|
|
1849
|
+
}
|
|
1850
|
+
interface FallbackConfig {
|
|
1851
|
+
external_llm?: FallbackConfig.ExternalLlm;
|
|
1852
|
+
/**
|
|
1853
|
+
* Integration secret identifier for the fallback model API key.
|
|
1854
|
+
*/
|
|
1855
|
+
llm_api_key_ref?: string;
|
|
1856
|
+
/**
|
|
1857
|
+
* Fallback Telnyx-hosted model to use when the primary LLM provider is
|
|
1858
|
+
* unavailable.
|
|
1859
|
+
*/
|
|
1860
|
+
model?: string;
|
|
1861
|
+
}
|
|
1862
|
+
namespace FallbackConfig {
|
|
1863
|
+
interface ExternalLlm {
|
|
1864
|
+
/**
|
|
1865
|
+
* Base URL for the external LLM endpoint.
|
|
1866
|
+
*/
|
|
1867
|
+
base_url: string;
|
|
1868
|
+
/**
|
|
1869
|
+
* Model identifier to use with the external LLM endpoint.
|
|
1870
|
+
*/
|
|
1871
|
+
model: string;
|
|
1872
|
+
/**
|
|
1873
|
+
* Authentication method used when connecting to the external LLM endpoint.
|
|
1874
|
+
*/
|
|
1875
|
+
authentication_method?: 'token' | 'certificate';
|
|
1876
|
+
/**
|
|
1877
|
+
* Integration secret identifier for the client certificate used with certificate
|
|
1878
|
+
* authentication.
|
|
1879
|
+
*/
|
|
1880
|
+
certificate_ref?: string;
|
|
1881
|
+
/**
|
|
1882
|
+
* When `true`, Telnyx forwards the assistant's dynamic variables to the external
|
|
1883
|
+
* LLM endpoint as a top-level `extra_metadata` object on the chat completion
|
|
1884
|
+
* request body. Defaults to `false`. Example payload sent to the external
|
|
1885
|
+
* endpoint:
|
|
1886
|
+
* `{"extra_metadata": {"customer_name": "Jane", "account_id": "acct_789", "telnyx_agent_target": "+13125550100", "telnyx_end_user_target": "+13125550123"}}`.
|
|
1887
|
+
* Distinct from OpenAI's native `metadata` field, which has its own size and type
|
|
1888
|
+
* limits.
|
|
1889
|
+
*/
|
|
1890
|
+
forward_metadata?: boolean;
|
|
1891
|
+
/**
|
|
1892
|
+
* Integration secret identifier for the external LLM API key.
|
|
1893
|
+
*/
|
|
1894
|
+
llm_api_key_ref?: string;
|
|
1895
|
+
/**
|
|
1896
|
+
* URL used to retrieve an access token when certificate authentication is enabled.
|
|
1897
|
+
*/
|
|
1898
|
+
token_retrieval_url?: string;
|
|
1899
|
+
}
|
|
1900
|
+
}
|
|
1901
|
+
/**
|
|
1902
|
+
* Reference to a connected integration attached to an assistant. Discover
|
|
1903
|
+
* available integrations with `/ai/integrations` and connected integrations with
|
|
1904
|
+
* `/ai/integrations/connections`.
|
|
1905
|
+
*/
|
|
1906
|
+
interface Integration {
|
|
1907
|
+
/**
|
|
1908
|
+
* Catalog integration ID to attach. This is the `id` from the integrations catalog
|
|
1909
|
+
* at `/ai/integrations` (the same value also appears as `integration_id` on
|
|
1910
|
+
* entries returned by `/ai/integrations/connections`). It is **not** the
|
|
1911
|
+
* connection-level `id` from `/ai/integrations/connections`.
|
|
1912
|
+
*/
|
|
1913
|
+
integration_id: string;
|
|
1914
|
+
/**
|
|
1915
|
+
* Optional per-assistant allowlist of integration tool names. When omitted or
|
|
1916
|
+
* empty, all tools allowed by the connected integration are available to the
|
|
1917
|
+
* assistant.
|
|
1918
|
+
*/
|
|
1919
|
+
allowed_list?: Array<string>;
|
|
1920
|
+
}
|
|
1921
|
+
/**
|
|
1922
|
+
* Settings for interruptions and how the assistant decides the user has finished
|
|
1923
|
+
* speaking. These timings are most relevant when using non turn-taking
|
|
1924
|
+
* transcription models. For turn-taking models like `deepgram/flux`, end-of-turn
|
|
1925
|
+
* behavior is controlled by the transcription end-of-turn settings under
|
|
1926
|
+
* `transcription.settings` (`eot_threshold`, `eot_timeout_ms`,
|
|
1927
|
+
* `eager_eot_threshold`).
|
|
1928
|
+
*/
|
|
1929
|
+
interface InterruptionSettings {
|
|
1930
|
+
/**
|
|
1931
|
+
* Whether users can interrupt the assistant while it is speaking.
|
|
1932
|
+
*/
|
|
1933
|
+
enable?: boolean;
|
|
1934
|
+
/**
|
|
1935
|
+
* Controls when the assistant starts speaking after the user stops. These
|
|
1936
|
+
* thresholds primarily apply to non turn-taking transcription models. For
|
|
1937
|
+
* turn-taking models like `deepgram/flux`, end-of-turn detection is driven by the
|
|
1938
|
+
* transcription end-of-turn settings under `transcription.settings` instead.
|
|
1939
|
+
*/
|
|
1940
|
+
start_speaking_plan?: InterruptionSettings.StartSpeakingPlan;
|
|
1941
|
+
}
|
|
1942
|
+
namespace InterruptionSettings {
|
|
1943
|
+
/**
|
|
1944
|
+
* Controls when the assistant starts speaking after the user stops. These
|
|
1945
|
+
* thresholds primarily apply to non turn-taking transcription models. For
|
|
1946
|
+
* turn-taking models like `deepgram/flux`, end-of-turn detection is driven by the
|
|
1947
|
+
* transcription end-of-turn settings under `transcription.settings` instead.
|
|
1948
|
+
*/
|
|
1949
|
+
interface StartSpeakingPlan {
|
|
1950
|
+
/**
|
|
1951
|
+
* Endpointing thresholds used to decide when the user has finished speaking.
|
|
1952
|
+
* Applies to non turn-taking transcription models. For `deepgram/flux`, use
|
|
1953
|
+
* `transcription.settings.eot_threshold` / `eot_timeout_ms` /
|
|
1954
|
+
* `eager_eot_threshold`.
|
|
1955
|
+
*/
|
|
1956
|
+
transcription_endpointing_plan?: StartSpeakingPlan.TranscriptionEndpointingPlan;
|
|
1957
|
+
/**
|
|
1958
|
+
* Minimum seconds to wait before the assistant starts speaking.
|
|
1959
|
+
*/
|
|
1960
|
+
wait_seconds?: number;
|
|
1961
|
+
}
|
|
1962
|
+
namespace StartSpeakingPlan {
|
|
1963
|
+
/**
|
|
1964
|
+
* Endpointing thresholds used to decide when the user has finished speaking.
|
|
1965
|
+
* Applies to non turn-taking transcription models. For `deepgram/flux`, use
|
|
1966
|
+
* `transcription.settings.eot_threshold` / `eot_timeout_ms` /
|
|
1967
|
+
* `eager_eot_threshold`.
|
|
1968
|
+
*/
|
|
1969
|
+
interface TranscriptionEndpointingPlan {
|
|
1970
|
+
/**
|
|
1971
|
+
* Seconds to wait after the transcript ends without punctuation.
|
|
1972
|
+
*/
|
|
1973
|
+
on_no_punctuation_seconds?: number;
|
|
1974
|
+
/**
|
|
1975
|
+
* Seconds to wait after the transcript ends with a number.
|
|
1976
|
+
*/
|
|
1977
|
+
on_number_seconds?: number;
|
|
1978
|
+
/**
|
|
1979
|
+
* Seconds to wait after the transcript ends with punctuation.
|
|
1980
|
+
*/
|
|
1981
|
+
on_punctuation_seconds?: number;
|
|
1982
|
+
}
|
|
1983
|
+
}
|
|
1984
|
+
}
|
|
1985
|
+
/**
|
|
1986
|
+
* Reference to an MCP server attached to an assistant. Create and manage MCP
|
|
1987
|
+
* servers with the `/ai/mcp_servers` endpoints, then attach them to assistants by
|
|
1988
|
+
* ID.
|
|
1989
|
+
*/
|
|
1990
|
+
interface McpServer {
|
|
1991
|
+
/**
|
|
1992
|
+
* ID of the MCP server to attach. This must be the `id` of an MCP server returned
|
|
1993
|
+
* by the `/ai/mcp_servers` endpoints.
|
|
1994
|
+
*/
|
|
1995
|
+
id: string;
|
|
1996
|
+
/**
|
|
1997
|
+
* Optional per-assistant allowlist of MCP tool names. When omitted, the assistant
|
|
1998
|
+
* uses the MCP server's configured `allowed_tools`.
|
|
1999
|
+
*/
|
|
2000
|
+
allowed_tools?: Array<string>;
|
|
2001
|
+
}
|
|
2002
|
+
/**
|
|
2003
|
+
* Configuration for post-conversation processing. When enabled, the assistant
|
|
2004
|
+
* receives one additional LLM turn after the conversation ends, allowing it to
|
|
2005
|
+
* execute tool calls such as logging to a CRM or sending a summary. The assistant
|
|
2006
|
+
* can execute multiple parallel or sequential tools during this phase.
|
|
2007
|
+
* Telephony-control tools (e.g. hangup, transfer) are unavailable
|
|
2008
|
+
* post-conversation. Beta feature.
|
|
2009
|
+
*/
|
|
2010
|
+
interface PostConversationSettings {
|
|
2011
|
+
/**
|
|
2012
|
+
* Whether post-conversation processing is enabled. When true, the assistant will
|
|
2013
|
+
* be invoked after the conversation ends to perform any final tool calls. Defaults
|
|
2014
|
+
* to false.
|
|
2015
|
+
*/
|
|
2016
|
+
enabled?: boolean;
|
|
2017
|
+
}
|
|
2018
|
+
}
|
|
1436
2019
|
export interface AssistantRetrieveParams {
|
|
1437
2020
|
call_control_id?: string;
|
|
1438
2021
|
fetch_dynamic_variables_from_webhook?: boolean;
|
|
@@ -1448,13 +2031,26 @@ export interface AssistantUpdateParams {
|
|
|
1448
2031
|
[key: string]: unknown;
|
|
1449
2032
|
};
|
|
1450
2033
|
/**
|
|
1451
|
-
*
|
|
1452
|
-
*
|
|
1453
|
-
*
|
|
1454
|
-
*
|
|
2034
|
+
* Timeout in milliseconds for the dynamic variables webhook. Must be between 1 and
|
|
2035
|
+
* 10000 ms. If the webhook does not respond within this timeout, the call proceeds
|
|
2036
|
+
* with default values. See the
|
|
2037
|
+
* [dynamic variables guide](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables).
|
|
2038
|
+
*/
|
|
2039
|
+
dynamic_variables_webhook_timeout_ms?: number;
|
|
2040
|
+
/**
|
|
2041
|
+
* If `dynamic_variables_webhook_url` is set, Telnyx sends a POST request to this
|
|
2042
|
+
* URL at the start of the conversation to resolve dynamic variables. **Gotcha:**
|
|
2043
|
+
* the webhook response must wrap variables under a top-level `dynamic_variables`
|
|
2044
|
+
* object, e.g. `{"dynamic_variables": {"customer_name": "Jane"}}`. Returning a
|
|
2045
|
+
* flat object will be ignored and variables will fall back to their defaults. See
|
|
2046
|
+
* the
|
|
2047
|
+
* [dynamic variables guide](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables)
|
|
2048
|
+
* for the full request/response format and timeout behavior.
|
|
1455
2049
|
*/
|
|
1456
2050
|
dynamic_variables_webhook_url?: string;
|
|
1457
2051
|
enabled_features?: Array<EnabledFeatures>;
|
|
2052
|
+
external_llm?: AssistantUpdateParams.ExternalLlm;
|
|
2053
|
+
fallback_config?: AssistantUpdateParams.FallbackConfig;
|
|
1458
2054
|
/**
|
|
1459
2055
|
* Text that the assistant will use to start the conversation. This may be
|
|
1460
2056
|
* templated with
|
|
@@ -1471,42 +2067,296 @@ export interface AssistantUpdateParams {
|
|
|
1471
2067
|
*/
|
|
1472
2068
|
instructions?: string;
|
|
1473
2069
|
/**
|
|
1474
|
-
*
|
|
1475
|
-
*
|
|
2070
|
+
* Connected integrations attached to the assistant. The catalog of available
|
|
2071
|
+
* integrations is at `/ai/integrations`; the user's connected integrations are at
|
|
2072
|
+
* `/ai/integrations/connections`. Each item references a catalog integration by
|
|
2073
|
+
* `integration_id`.
|
|
2074
|
+
*/
|
|
2075
|
+
integrations?: Array<AssistantUpdateParams.Integration>;
|
|
2076
|
+
/**
|
|
2077
|
+
* Settings for interruptions and how the assistant decides the user has finished
|
|
2078
|
+
* speaking. These timings are most relevant when using non turn-taking
|
|
2079
|
+
* transcription models. For turn-taking models like `deepgram/flux`, end-of-turn
|
|
2080
|
+
* behavior is controlled by the transcription end-of-turn settings under
|
|
2081
|
+
* `transcription.settings` (`eot_threshold`, `eot_timeout_ms`,
|
|
2082
|
+
* `eager_eot_threshold`).
|
|
2083
|
+
*/
|
|
2084
|
+
interruption_settings?: AssistantUpdateParams.InterruptionSettings;
|
|
2085
|
+
/**
|
|
2086
|
+
* This is only needed when using third-party inference providers selected by
|
|
2087
|
+
* `model`. The `identifier` for an integration secret
|
|
1476
2088
|
* [/v2/integration_secrets](https://developers.telnyx.com/api-reference/integration-secrets/create-a-secret)
|
|
1477
|
-
* that refers to your LLM provider's API key.
|
|
1478
|
-
*
|
|
2089
|
+
* that refers to your LLM provider's API key. For bring-your-own endpoint
|
|
2090
|
+
* authentication, use `external_llm.llm_api_key_ref` instead. Warning: Free plans
|
|
2091
|
+
* are unlikely to work with this integration.
|
|
1479
2092
|
*/
|
|
1480
2093
|
llm_api_key_ref?: string;
|
|
2094
|
+
/**
|
|
2095
|
+
* MCP servers attached to the assistant. Create MCP servers with
|
|
2096
|
+
* `/ai/mcp_servers`, then reference them by `id` here.
|
|
2097
|
+
*/
|
|
2098
|
+
mcp_servers?: Array<AssistantUpdateParams.McpServer>;
|
|
1481
2099
|
messaging_settings?: MessagingSettings;
|
|
1482
2100
|
/**
|
|
1483
|
-
* ID of the model to use. You can use the
|
|
2101
|
+
* ID of the model to use when `external_llm` is not set. You can use the
|
|
1484
2102
|
* [Get models API](https://developers.telnyx.com/api-reference/chat/get-available-models)
|
|
1485
|
-
* to see
|
|
2103
|
+
* to see available models. If `external_llm` is provided, the assistant uses
|
|
2104
|
+
* `external_llm` instead of this field. If neither `model` nor `external_llm` is
|
|
2105
|
+
* provided, Telnyx applies the default model.
|
|
1486
2106
|
*/
|
|
1487
2107
|
model?: string;
|
|
1488
2108
|
name?: string;
|
|
1489
2109
|
observability_settings?: ObservabilityReq;
|
|
2110
|
+
/**
|
|
2111
|
+
* Configuration for post-conversation processing. When enabled, the assistant
|
|
2112
|
+
* receives one additional LLM turn after the conversation ends, allowing it to
|
|
2113
|
+
* execute tool calls such as logging to a CRM or sending a summary. The assistant
|
|
2114
|
+
* can execute multiple parallel or sequential tools during this phase.
|
|
2115
|
+
* Telephony-control tools (e.g. hangup, transfer) are unavailable
|
|
2116
|
+
* post-conversation. Beta feature.
|
|
2117
|
+
*/
|
|
2118
|
+
post_conversation_settings?: AssistantUpdateParams.PostConversationSettings;
|
|
1490
2119
|
privacy_settings?: PrivacySettings;
|
|
1491
2120
|
/**
|
|
1492
2121
|
* Indicates whether the assistant should be promoted to the main version. Defaults
|
|
1493
2122
|
* to true.
|
|
1494
2123
|
*/
|
|
1495
2124
|
promote_to_main?: boolean;
|
|
2125
|
+
/**
|
|
2126
|
+
* Tags associated with the assistant. Tags can also be managed with the assistant
|
|
2127
|
+
* tag endpoints.
|
|
2128
|
+
*/
|
|
2129
|
+
tags?: Array<string>;
|
|
1496
2130
|
telephony_settings?: TelephonySettings;
|
|
2131
|
+
/**
|
|
2132
|
+
* IDs of shared tools to attach to the assistant. New integrations should prefer
|
|
2133
|
+
* `tool_ids` over inline `tools`.
|
|
2134
|
+
*/
|
|
1497
2135
|
tool_ids?: Array<string>;
|
|
1498
2136
|
/**
|
|
1499
|
-
*
|
|
1500
|
-
*
|
|
2137
|
+
* Deprecated for new integrations. Inline tool definitions available to the
|
|
2138
|
+
* assistant. Prefer `tool_ids` to attach shared tools created with the AI Tools
|
|
2139
|
+
* endpoints.
|
|
1501
2140
|
*/
|
|
1502
2141
|
tools?: Array<AssistantTool>;
|
|
1503
2142
|
transcription?: TranscriptionSettings;
|
|
2143
|
+
/**
|
|
2144
|
+
* Human-readable name for the assistant version.
|
|
2145
|
+
*/
|
|
2146
|
+
version_name?: string;
|
|
1504
2147
|
voice_settings?: VoiceSettings;
|
|
1505
2148
|
/**
|
|
1506
2149
|
* Configuration settings for the assistant's web widget.
|
|
1507
2150
|
*/
|
|
1508
2151
|
widget_settings?: WidgetSettings;
|
|
1509
2152
|
}
|
|
2153
|
+
export declare namespace AssistantUpdateParams {
|
|
2154
|
+
interface ExternalLlm {
|
|
2155
|
+
/**
|
|
2156
|
+
* Base URL for the external LLM endpoint.
|
|
2157
|
+
*/
|
|
2158
|
+
base_url: string;
|
|
2159
|
+
/**
|
|
2160
|
+
* Model identifier to use with the external LLM endpoint.
|
|
2161
|
+
*/
|
|
2162
|
+
model: string;
|
|
2163
|
+
/**
|
|
2164
|
+
* Authentication method used when connecting to the external LLM endpoint.
|
|
2165
|
+
*/
|
|
2166
|
+
authentication_method?: 'token' | 'certificate';
|
|
2167
|
+
/**
|
|
2168
|
+
* Integration secret identifier for the client certificate used with certificate
|
|
2169
|
+
* authentication.
|
|
2170
|
+
*/
|
|
2171
|
+
certificate_ref?: string;
|
|
2172
|
+
/**
|
|
2173
|
+
* When `true`, Telnyx forwards the assistant's dynamic variables to the external
|
|
2174
|
+
* LLM endpoint as a top-level `extra_metadata` object on the chat completion
|
|
2175
|
+
* request body. Defaults to `false`. Example payload sent to the external
|
|
2176
|
+
* endpoint:
|
|
2177
|
+
* `{"extra_metadata": {"customer_name": "Jane", "account_id": "acct_789", "telnyx_agent_target": "+13125550100", "telnyx_end_user_target": "+13125550123"}}`.
|
|
2178
|
+
* Distinct from OpenAI's native `metadata` field, which has its own size and type
|
|
2179
|
+
* limits.
|
|
2180
|
+
*/
|
|
2181
|
+
forward_metadata?: boolean;
|
|
2182
|
+
/**
|
|
2183
|
+
* Integration secret identifier for the external LLM API key.
|
|
2184
|
+
*/
|
|
2185
|
+
llm_api_key_ref?: string;
|
|
2186
|
+
/**
|
|
2187
|
+
* URL used to retrieve an access token when certificate authentication is enabled.
|
|
2188
|
+
*/
|
|
2189
|
+
token_retrieval_url?: string;
|
|
2190
|
+
}
|
|
2191
|
+
interface FallbackConfig {
|
|
2192
|
+
external_llm?: FallbackConfig.ExternalLlm;
|
|
2193
|
+
/**
|
|
2194
|
+
* Integration secret identifier for the fallback model API key.
|
|
2195
|
+
*/
|
|
2196
|
+
llm_api_key_ref?: string;
|
|
2197
|
+
/**
|
|
2198
|
+
* Fallback Telnyx-hosted model to use when the primary LLM provider is
|
|
2199
|
+
* unavailable.
|
|
2200
|
+
*/
|
|
2201
|
+
model?: string;
|
|
2202
|
+
}
|
|
2203
|
+
namespace FallbackConfig {
|
|
2204
|
+
interface ExternalLlm {
|
|
2205
|
+
/**
|
|
2206
|
+
* Base URL for the external LLM endpoint.
|
|
2207
|
+
*/
|
|
2208
|
+
base_url: string;
|
|
2209
|
+
/**
|
|
2210
|
+
* Model identifier to use with the external LLM endpoint.
|
|
2211
|
+
*/
|
|
2212
|
+
model: string;
|
|
2213
|
+
/**
|
|
2214
|
+
* Authentication method used when connecting to the external LLM endpoint.
|
|
2215
|
+
*/
|
|
2216
|
+
authentication_method?: 'token' | 'certificate';
|
|
2217
|
+
/**
|
|
2218
|
+
* Integration secret identifier for the client certificate used with certificate
|
|
2219
|
+
* authentication.
|
|
2220
|
+
*/
|
|
2221
|
+
certificate_ref?: string;
|
|
2222
|
+
/**
|
|
2223
|
+
* When `true`, Telnyx forwards the assistant's dynamic variables to the external
|
|
2224
|
+
* LLM endpoint as a top-level `extra_metadata` object on the chat completion
|
|
2225
|
+
* request body. Defaults to `false`. Example payload sent to the external
|
|
2226
|
+
* endpoint:
|
|
2227
|
+
* `{"extra_metadata": {"customer_name": "Jane", "account_id": "acct_789", "telnyx_agent_target": "+13125550100", "telnyx_end_user_target": "+13125550123"}}`.
|
|
2228
|
+
* Distinct from OpenAI's native `metadata` field, which has its own size and type
|
|
2229
|
+
* limits.
|
|
2230
|
+
*/
|
|
2231
|
+
forward_metadata?: boolean;
|
|
2232
|
+
/**
|
|
2233
|
+
* Integration secret identifier for the external LLM API key.
|
|
2234
|
+
*/
|
|
2235
|
+
llm_api_key_ref?: string;
|
|
2236
|
+
/**
|
|
2237
|
+
* URL used to retrieve an access token when certificate authentication is enabled.
|
|
2238
|
+
*/
|
|
2239
|
+
token_retrieval_url?: string;
|
|
2240
|
+
}
|
|
2241
|
+
}
|
|
2242
|
+
/**
|
|
2243
|
+
* Reference to a connected integration attached to an assistant. Discover
|
|
2244
|
+
* available integrations with `/ai/integrations` and connected integrations with
|
|
2245
|
+
* `/ai/integrations/connections`.
|
|
2246
|
+
*/
|
|
2247
|
+
interface Integration {
|
|
2248
|
+
/**
|
|
2249
|
+
* Catalog integration ID to attach. This is the `id` from the integrations catalog
|
|
2250
|
+
* at `/ai/integrations` (the same value also appears as `integration_id` on
|
|
2251
|
+
* entries returned by `/ai/integrations/connections`). It is **not** the
|
|
2252
|
+
* connection-level `id` from `/ai/integrations/connections`.
|
|
2253
|
+
*/
|
|
2254
|
+
integration_id: string;
|
|
2255
|
+
/**
|
|
2256
|
+
* Optional per-assistant allowlist of integration tool names. When omitted or
|
|
2257
|
+
* empty, all tools allowed by the connected integration are available to the
|
|
2258
|
+
* assistant.
|
|
2259
|
+
*/
|
|
2260
|
+
allowed_list?: Array<string>;
|
|
2261
|
+
}
|
|
2262
|
+
/**
|
|
2263
|
+
* Settings for interruptions and how the assistant decides the user has finished
|
|
2264
|
+
* speaking. These timings are most relevant when using non turn-taking
|
|
2265
|
+
* transcription models. For turn-taking models like `deepgram/flux`, end-of-turn
|
|
2266
|
+
* behavior is controlled by the transcription end-of-turn settings under
|
|
2267
|
+
* `transcription.settings` (`eot_threshold`, `eot_timeout_ms`,
|
|
2268
|
+
* `eager_eot_threshold`).
|
|
2269
|
+
*/
|
|
2270
|
+
interface InterruptionSettings {
|
|
2271
|
+
/**
|
|
2272
|
+
* Whether users can interrupt the assistant while it is speaking.
|
|
2273
|
+
*/
|
|
2274
|
+
enable?: boolean;
|
|
2275
|
+
/**
|
|
2276
|
+
* Controls when the assistant starts speaking after the user stops. These
|
|
2277
|
+
* thresholds primarily apply to non turn-taking transcription models. For
|
|
2278
|
+
* turn-taking models like `deepgram/flux`, end-of-turn detection is driven by the
|
|
2279
|
+
* transcription end-of-turn settings under `transcription.settings` instead.
|
|
2280
|
+
*/
|
|
2281
|
+
start_speaking_plan?: InterruptionSettings.StartSpeakingPlan;
|
|
2282
|
+
}
|
|
2283
|
+
namespace InterruptionSettings {
|
|
2284
|
+
/**
|
|
2285
|
+
* Controls when the assistant starts speaking after the user stops. These
|
|
2286
|
+
* thresholds primarily apply to non turn-taking transcription models. For
|
|
2287
|
+
* turn-taking models like `deepgram/flux`, end-of-turn detection is driven by the
|
|
2288
|
+
* transcription end-of-turn settings under `transcription.settings` instead.
|
|
2289
|
+
*/
|
|
2290
|
+
interface StartSpeakingPlan {
|
|
2291
|
+
/**
|
|
2292
|
+
* Endpointing thresholds used to decide when the user has finished speaking.
|
|
2293
|
+
* Applies to non turn-taking transcription models. For `deepgram/flux`, use
|
|
2294
|
+
* `transcription.settings.eot_threshold` / `eot_timeout_ms` /
|
|
2295
|
+
* `eager_eot_threshold`.
|
|
2296
|
+
*/
|
|
2297
|
+
transcription_endpointing_plan?: StartSpeakingPlan.TranscriptionEndpointingPlan;
|
|
2298
|
+
/**
|
|
2299
|
+
* Minimum seconds to wait before the assistant starts speaking.
|
|
2300
|
+
*/
|
|
2301
|
+
wait_seconds?: number;
|
|
2302
|
+
}
|
|
2303
|
+
namespace StartSpeakingPlan {
|
|
2304
|
+
/**
|
|
2305
|
+
* Endpointing thresholds used to decide when the user has finished speaking.
|
|
2306
|
+
* Applies to non turn-taking transcription models. For `deepgram/flux`, use
|
|
2307
|
+
* `transcription.settings.eot_threshold` / `eot_timeout_ms` /
|
|
2308
|
+
* `eager_eot_threshold`.
|
|
2309
|
+
*/
|
|
2310
|
+
interface TranscriptionEndpointingPlan {
|
|
2311
|
+
/**
|
|
2312
|
+
* Seconds to wait after the transcript ends without punctuation.
|
|
2313
|
+
*/
|
|
2314
|
+
on_no_punctuation_seconds?: number;
|
|
2315
|
+
/**
|
|
2316
|
+
* Seconds to wait after the transcript ends with a number.
|
|
2317
|
+
*/
|
|
2318
|
+
on_number_seconds?: number;
|
|
2319
|
+
/**
|
|
2320
|
+
* Seconds to wait after the transcript ends with punctuation.
|
|
2321
|
+
*/
|
|
2322
|
+
on_punctuation_seconds?: number;
|
|
2323
|
+
}
|
|
2324
|
+
}
|
|
2325
|
+
}
|
|
2326
|
+
/**
|
|
2327
|
+
* Reference to an MCP server attached to an assistant. Create and manage MCP
|
|
2328
|
+
* servers with the `/ai/mcp_servers` endpoints, then attach them to assistants by
|
|
2329
|
+
* ID.
|
|
2330
|
+
*/
|
|
2331
|
+
interface McpServer {
|
|
2332
|
+
/**
|
|
2333
|
+
* ID of the MCP server to attach. This must be the `id` of an MCP server returned
|
|
2334
|
+
* by the `/ai/mcp_servers` endpoints.
|
|
2335
|
+
*/
|
|
2336
|
+
id: string;
|
|
2337
|
+
/**
|
|
2338
|
+
* Optional per-assistant allowlist of MCP tool names. When omitted, the assistant
|
|
2339
|
+
* uses the MCP server's configured `allowed_tools`.
|
|
2340
|
+
*/
|
|
2341
|
+
allowed_tools?: Array<string>;
|
|
2342
|
+
}
|
|
2343
|
+
/**
|
|
2344
|
+
* Configuration for post-conversation processing. When enabled, the assistant
|
|
2345
|
+
* receives one additional LLM turn after the conversation ends, allowing it to
|
|
2346
|
+
* execute tool calls such as logging to a CRM or sending a summary. The assistant
|
|
2347
|
+
* can execute multiple parallel or sequential tools during this phase.
|
|
2348
|
+
* Telephony-control tools (e.g. hangup, transfer) are unavailable
|
|
2349
|
+
* post-conversation. Beta feature.
|
|
2350
|
+
*/
|
|
2351
|
+
interface PostConversationSettings {
|
|
2352
|
+
/**
|
|
2353
|
+
* Whether post-conversation processing is enabled. When true, the assistant will
|
|
2354
|
+
* be invoked after the conversation ends to perform any final tool calls. Defaults
|
|
2355
|
+
* to false.
|
|
2356
|
+
*/
|
|
2357
|
+
enabled?: boolean;
|
|
2358
|
+
}
|
|
2359
|
+
}
|
|
1510
2360
|
export interface AssistantChatParams {
|
|
1511
2361
|
/**
|
|
1512
2362
|
* The message content sent by the client to the assistant
|