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
|
@@ -88,7 +88,6 @@ export class Assistants extends APIResource {
|
|
|
88
88
|
* const inferenceEmbedding =
|
|
89
89
|
* await client.ai.assistants.create({
|
|
90
90
|
* instructions: 'instructions',
|
|
91
|
-
* model: 'model',
|
|
92
91
|
* name: 'name',
|
|
93
92
|
* });
|
|
94
93
|
* ```
|
|
@@ -808,9 +807,11 @@ export interface InferenceEmbedding {
|
|
|
808
807
|
instructions: string;
|
|
809
808
|
|
|
810
809
|
/**
|
|
811
|
-
* ID of the model to use. You can use the
|
|
810
|
+
* ID of the model to use when `external_llm` is not set. You can use the
|
|
812
811
|
* [Get models API](https://developers.telnyx.com/api-reference/chat/get-available-models)
|
|
813
|
-
* to see
|
|
812
|
+
* to see available models. If `external_llm` is provided, the assistant uses
|
|
813
|
+
* `external_llm` instead of this field. If neither `model` nor `external_llm` is
|
|
814
|
+
* provided, Telnyx applies the default model.
|
|
814
815
|
*/
|
|
815
816
|
model: string;
|
|
816
817
|
|
|
@@ -824,15 +825,31 @@ export interface InferenceEmbedding {
|
|
|
824
825
|
dynamic_variables?: { [key: string]: unknown };
|
|
825
826
|
|
|
826
827
|
/**
|
|
827
|
-
*
|
|
828
|
-
*
|
|
829
|
-
*
|
|
830
|
-
*
|
|
828
|
+
* Timeout in milliseconds for the dynamic variables webhook. Must be between 1 and
|
|
829
|
+
* 10000 ms. If the webhook does not respond within this timeout, the call proceeds
|
|
830
|
+
* with default values. See the
|
|
831
|
+
* [dynamic variables guide](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables).
|
|
832
|
+
*/
|
|
833
|
+
dynamic_variables_webhook_timeout_ms?: number;
|
|
834
|
+
|
|
835
|
+
/**
|
|
836
|
+
* If `dynamic_variables_webhook_url` is set, Telnyx sends a POST request to this
|
|
837
|
+
* URL at the start of the conversation to resolve dynamic variables. **Gotcha:**
|
|
838
|
+
* the webhook response must wrap variables under a top-level `dynamic_variables`
|
|
839
|
+
* object, e.g. `{"dynamic_variables": {"customer_name": "Jane"}}`. Returning a
|
|
840
|
+
* flat object will be ignored and variables will fall back to their defaults. See
|
|
841
|
+
* the
|
|
842
|
+
* [dynamic variables guide](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables)
|
|
843
|
+
* for the full request/response format and timeout behavior.
|
|
831
844
|
*/
|
|
832
845
|
dynamic_variables_webhook_url?: string;
|
|
833
846
|
|
|
834
847
|
enabled_features?: Array<EnabledFeatures>;
|
|
835
848
|
|
|
849
|
+
external_llm?: InferenceEmbedding.ExternalLlm;
|
|
850
|
+
|
|
851
|
+
fallback_config?: InferenceEmbedding.FallbackConfig;
|
|
852
|
+
|
|
836
853
|
/**
|
|
837
854
|
* Text that the assistant will use to start the conversation. This may be
|
|
838
855
|
* templated with
|
|
@@ -848,30 +865,93 @@ export interface InferenceEmbedding {
|
|
|
848
865
|
insight_settings?: InsightSettings;
|
|
849
866
|
|
|
850
867
|
/**
|
|
851
|
-
*
|
|
852
|
-
*
|
|
868
|
+
* Connected integrations attached to the assistant. The catalog of available
|
|
869
|
+
* integrations is at `/ai/integrations`; the user's connected integrations are at
|
|
870
|
+
* `/ai/integrations/connections`. Each item references a catalog integration by
|
|
871
|
+
* `integration_id`.
|
|
872
|
+
*/
|
|
873
|
+
integrations?: Array<InferenceEmbedding.Integration>;
|
|
874
|
+
|
|
875
|
+
/**
|
|
876
|
+
* Settings for interruptions and how the assistant decides the user has finished
|
|
877
|
+
* speaking. These timings are most relevant when using non turn-taking
|
|
878
|
+
* transcription models. For turn-taking models like `deepgram/flux`, end-of-turn
|
|
879
|
+
* behavior is controlled by the transcription end-of-turn settings under
|
|
880
|
+
* `transcription.settings` (`eot_threshold`, `eot_timeout_ms`,
|
|
881
|
+
* `eager_eot_threshold`).
|
|
882
|
+
*/
|
|
883
|
+
interruption_settings?: InferenceEmbedding.InterruptionSettings;
|
|
884
|
+
|
|
885
|
+
/**
|
|
886
|
+
* This is only needed when using third-party inference providers selected by
|
|
887
|
+
* `model`. The `identifier` for an integration secret
|
|
853
888
|
* [/v2/integration_secrets](https://developers.telnyx.com/api-reference/integration-secrets/create-a-secret)
|
|
854
|
-
* that refers to your LLM provider's API key.
|
|
855
|
-
*
|
|
889
|
+
* that refers to your LLM provider's API key. For bring-your-own endpoint
|
|
890
|
+
* authentication, use `external_llm.llm_api_key_ref` instead. Warning: Free plans
|
|
891
|
+
* are unlikely to work with this integration.
|
|
856
892
|
*/
|
|
857
893
|
llm_api_key_ref?: string;
|
|
858
894
|
|
|
895
|
+
/**
|
|
896
|
+
* MCP servers attached to the assistant. Create MCP servers with
|
|
897
|
+
* `/ai/mcp_servers`, then reference them by `id` here.
|
|
898
|
+
*/
|
|
899
|
+
mcp_servers?: Array<InferenceEmbedding.McpServer>;
|
|
900
|
+
|
|
859
901
|
messaging_settings?: MessagingSettings;
|
|
860
902
|
|
|
861
903
|
observability_settings?: Observability;
|
|
862
904
|
|
|
905
|
+
/**
|
|
906
|
+
* Configuration for post-conversation processing. When enabled, the assistant
|
|
907
|
+
* receives one additional LLM turn after the conversation ends, allowing it to
|
|
908
|
+
* execute tool calls such as logging to a CRM or sending a summary. The assistant
|
|
909
|
+
* can execute multiple parallel or sequential tools during this phase.
|
|
910
|
+
* Telephony-control tools (e.g. hangup, transfer) are unavailable
|
|
911
|
+
* post-conversation. Beta feature.
|
|
912
|
+
*/
|
|
913
|
+
post_conversation_settings?: InferenceEmbedding.PostConversationSettings;
|
|
914
|
+
|
|
863
915
|
privacy_settings?: PrivacySettings;
|
|
864
916
|
|
|
917
|
+
/**
|
|
918
|
+
* IDs of missions related to this assistant.
|
|
919
|
+
*/
|
|
920
|
+
related_mission_ids?: Array<string>;
|
|
921
|
+
|
|
922
|
+
/**
|
|
923
|
+
* Tags associated with the assistant. Tags can also be managed with the assistant
|
|
924
|
+
* tag endpoints.
|
|
925
|
+
*/
|
|
926
|
+
tags?: Array<string>;
|
|
927
|
+
|
|
865
928
|
telephony_settings?: TelephonySettings;
|
|
866
929
|
|
|
867
930
|
/**
|
|
868
|
-
*
|
|
869
|
-
*
|
|
931
|
+
* Deprecated for new integrations. Inline tool definitions available to the
|
|
932
|
+
* assistant. Prefer `tool_ids` to attach shared tools created with the AI Tools
|
|
933
|
+
* endpoints.
|
|
870
934
|
*/
|
|
871
935
|
tools?: Array<AssistantTool>;
|
|
872
936
|
|
|
873
937
|
transcription?: TranscriptionSettings;
|
|
874
938
|
|
|
939
|
+
/**
|
|
940
|
+
* Timestamp when this assistant version was created.
|
|
941
|
+
*/
|
|
942
|
+
version_created_at?: string;
|
|
943
|
+
|
|
944
|
+
/**
|
|
945
|
+
* Identifier for the assistant version returned by version-aware assistant
|
|
946
|
+
* endpoints.
|
|
947
|
+
*/
|
|
948
|
+
version_id?: string;
|
|
949
|
+
|
|
950
|
+
/**
|
|
951
|
+
* Human-readable name for the assistant version.
|
|
952
|
+
*/
|
|
953
|
+
version_name?: string;
|
|
954
|
+
|
|
875
955
|
voice_settings?: VoiceSettings;
|
|
876
956
|
|
|
877
957
|
/**
|
|
@@ -880,6 +960,242 @@ export interface InferenceEmbedding {
|
|
|
880
960
|
widget_settings?: WidgetSettings;
|
|
881
961
|
}
|
|
882
962
|
|
|
963
|
+
export namespace InferenceEmbedding {
|
|
964
|
+
export interface ExternalLlm {
|
|
965
|
+
/**
|
|
966
|
+
* Base URL for the external LLM endpoint.
|
|
967
|
+
*/
|
|
968
|
+
base_url: string;
|
|
969
|
+
|
|
970
|
+
/**
|
|
971
|
+
* Model identifier to use with the external LLM endpoint.
|
|
972
|
+
*/
|
|
973
|
+
model: string;
|
|
974
|
+
|
|
975
|
+
/**
|
|
976
|
+
* Authentication method used when connecting to the external LLM endpoint.
|
|
977
|
+
*/
|
|
978
|
+
authentication_method?: 'token' | 'certificate';
|
|
979
|
+
|
|
980
|
+
/**
|
|
981
|
+
* Integration secret identifier for the client certificate used with certificate
|
|
982
|
+
* authentication.
|
|
983
|
+
*/
|
|
984
|
+
certificate_ref?: string;
|
|
985
|
+
|
|
986
|
+
/**
|
|
987
|
+
* When `true`, Telnyx forwards the assistant's dynamic variables to the external
|
|
988
|
+
* LLM endpoint as a top-level `extra_metadata` object on the chat completion
|
|
989
|
+
* request body. Defaults to `false`. Example payload sent to the external
|
|
990
|
+
* endpoint:
|
|
991
|
+
* `{"extra_metadata": {"customer_name": "Jane", "account_id": "acct_789", "telnyx_agent_target": "+13125550100", "telnyx_end_user_target": "+13125550123"}}`.
|
|
992
|
+
* Distinct from OpenAI's native `metadata` field, which has its own size and type
|
|
993
|
+
* limits.
|
|
994
|
+
*/
|
|
995
|
+
forward_metadata?: boolean;
|
|
996
|
+
|
|
997
|
+
/**
|
|
998
|
+
* Integration secret identifier for the external LLM API key.
|
|
999
|
+
*/
|
|
1000
|
+
llm_api_key_ref?: string;
|
|
1001
|
+
|
|
1002
|
+
/**
|
|
1003
|
+
* URL used to retrieve an access token when certificate authentication is enabled.
|
|
1004
|
+
*/
|
|
1005
|
+
token_retrieval_url?: string;
|
|
1006
|
+
}
|
|
1007
|
+
|
|
1008
|
+
export interface FallbackConfig {
|
|
1009
|
+
external_llm?: FallbackConfig.ExternalLlm;
|
|
1010
|
+
|
|
1011
|
+
/**
|
|
1012
|
+
* Integration secret identifier for the fallback model API key.
|
|
1013
|
+
*/
|
|
1014
|
+
llm_api_key_ref?: string;
|
|
1015
|
+
|
|
1016
|
+
/**
|
|
1017
|
+
* Fallback Telnyx-hosted model to use when the primary LLM provider is
|
|
1018
|
+
* unavailable.
|
|
1019
|
+
*/
|
|
1020
|
+
model?: string;
|
|
1021
|
+
}
|
|
1022
|
+
|
|
1023
|
+
export namespace FallbackConfig {
|
|
1024
|
+
export interface ExternalLlm {
|
|
1025
|
+
/**
|
|
1026
|
+
* Base URL for the external LLM endpoint.
|
|
1027
|
+
*/
|
|
1028
|
+
base_url: string;
|
|
1029
|
+
|
|
1030
|
+
/**
|
|
1031
|
+
* Model identifier to use with the external LLM endpoint.
|
|
1032
|
+
*/
|
|
1033
|
+
model: string;
|
|
1034
|
+
|
|
1035
|
+
/**
|
|
1036
|
+
* Authentication method used when connecting to the external LLM endpoint.
|
|
1037
|
+
*/
|
|
1038
|
+
authentication_method?: 'token' | 'certificate';
|
|
1039
|
+
|
|
1040
|
+
/**
|
|
1041
|
+
* Integration secret identifier for the client certificate used with certificate
|
|
1042
|
+
* authentication.
|
|
1043
|
+
*/
|
|
1044
|
+
certificate_ref?: string;
|
|
1045
|
+
|
|
1046
|
+
/**
|
|
1047
|
+
* When `true`, Telnyx forwards the assistant's dynamic variables to the external
|
|
1048
|
+
* LLM endpoint as a top-level `extra_metadata` object on the chat completion
|
|
1049
|
+
* request body. Defaults to `false`. Example payload sent to the external
|
|
1050
|
+
* endpoint:
|
|
1051
|
+
* `{"extra_metadata": {"customer_name": "Jane", "account_id": "acct_789", "telnyx_agent_target": "+13125550100", "telnyx_end_user_target": "+13125550123"}}`.
|
|
1052
|
+
* Distinct from OpenAI's native `metadata` field, which has its own size and type
|
|
1053
|
+
* limits.
|
|
1054
|
+
*/
|
|
1055
|
+
forward_metadata?: boolean;
|
|
1056
|
+
|
|
1057
|
+
/**
|
|
1058
|
+
* Integration secret identifier for the external LLM API key.
|
|
1059
|
+
*/
|
|
1060
|
+
llm_api_key_ref?: string;
|
|
1061
|
+
|
|
1062
|
+
/**
|
|
1063
|
+
* URL used to retrieve an access token when certificate authentication is enabled.
|
|
1064
|
+
*/
|
|
1065
|
+
token_retrieval_url?: string;
|
|
1066
|
+
}
|
|
1067
|
+
}
|
|
1068
|
+
|
|
1069
|
+
/**
|
|
1070
|
+
* Reference to a connected integration attached to an assistant. Discover
|
|
1071
|
+
* available integrations with `/ai/integrations` and connected integrations with
|
|
1072
|
+
* `/ai/integrations/connections`.
|
|
1073
|
+
*/
|
|
1074
|
+
export interface Integration {
|
|
1075
|
+
/**
|
|
1076
|
+
* Catalog integration ID to attach. This is the `id` from the integrations catalog
|
|
1077
|
+
* at `/ai/integrations` (the same value also appears as `integration_id` on
|
|
1078
|
+
* entries returned by `/ai/integrations/connections`). It is **not** the
|
|
1079
|
+
* connection-level `id` from `/ai/integrations/connections`.
|
|
1080
|
+
*/
|
|
1081
|
+
integration_id: string;
|
|
1082
|
+
|
|
1083
|
+
/**
|
|
1084
|
+
* Optional per-assistant allowlist of integration tool names. When omitted or
|
|
1085
|
+
* empty, all tools allowed by the connected integration are available to the
|
|
1086
|
+
* assistant.
|
|
1087
|
+
*/
|
|
1088
|
+
allowed_list?: Array<string>;
|
|
1089
|
+
}
|
|
1090
|
+
|
|
1091
|
+
/**
|
|
1092
|
+
* Settings for interruptions and how the assistant decides the user has finished
|
|
1093
|
+
* speaking. These timings are most relevant when using non turn-taking
|
|
1094
|
+
* transcription models. For turn-taking models like `deepgram/flux`, end-of-turn
|
|
1095
|
+
* behavior is controlled by the transcription end-of-turn settings under
|
|
1096
|
+
* `transcription.settings` (`eot_threshold`, `eot_timeout_ms`,
|
|
1097
|
+
* `eager_eot_threshold`).
|
|
1098
|
+
*/
|
|
1099
|
+
export interface InterruptionSettings {
|
|
1100
|
+
/**
|
|
1101
|
+
* Whether users can interrupt the assistant while it is speaking.
|
|
1102
|
+
*/
|
|
1103
|
+
enable?: boolean;
|
|
1104
|
+
|
|
1105
|
+
/**
|
|
1106
|
+
* Controls when the assistant starts speaking after the user stops. These
|
|
1107
|
+
* thresholds primarily apply to non turn-taking transcription models. For
|
|
1108
|
+
* turn-taking models like `deepgram/flux`, end-of-turn detection is driven by the
|
|
1109
|
+
* transcription end-of-turn settings under `transcription.settings` instead.
|
|
1110
|
+
*/
|
|
1111
|
+
start_speaking_plan?: InterruptionSettings.StartSpeakingPlan;
|
|
1112
|
+
}
|
|
1113
|
+
|
|
1114
|
+
export namespace InterruptionSettings {
|
|
1115
|
+
/**
|
|
1116
|
+
* Controls when the assistant starts speaking after the user stops. These
|
|
1117
|
+
* thresholds primarily apply to non turn-taking transcription models. For
|
|
1118
|
+
* turn-taking models like `deepgram/flux`, end-of-turn detection is driven by the
|
|
1119
|
+
* transcription end-of-turn settings under `transcription.settings` instead.
|
|
1120
|
+
*/
|
|
1121
|
+
export interface StartSpeakingPlan {
|
|
1122
|
+
/**
|
|
1123
|
+
* Endpointing thresholds used to decide when the user has finished speaking.
|
|
1124
|
+
* Applies to non turn-taking transcription models. For `deepgram/flux`, use
|
|
1125
|
+
* `transcription.settings.eot_threshold` / `eot_timeout_ms` /
|
|
1126
|
+
* `eager_eot_threshold`.
|
|
1127
|
+
*/
|
|
1128
|
+
transcription_endpointing_plan?: StartSpeakingPlan.TranscriptionEndpointingPlan;
|
|
1129
|
+
|
|
1130
|
+
/**
|
|
1131
|
+
* Minimum seconds to wait before the assistant starts speaking.
|
|
1132
|
+
*/
|
|
1133
|
+
wait_seconds?: number;
|
|
1134
|
+
}
|
|
1135
|
+
|
|
1136
|
+
export namespace StartSpeakingPlan {
|
|
1137
|
+
/**
|
|
1138
|
+
* Endpointing thresholds used to decide when the user has finished speaking.
|
|
1139
|
+
* Applies to non turn-taking transcription models. For `deepgram/flux`, use
|
|
1140
|
+
* `transcription.settings.eot_threshold` / `eot_timeout_ms` /
|
|
1141
|
+
* `eager_eot_threshold`.
|
|
1142
|
+
*/
|
|
1143
|
+
export interface TranscriptionEndpointingPlan {
|
|
1144
|
+
/**
|
|
1145
|
+
* Seconds to wait after the transcript ends without punctuation.
|
|
1146
|
+
*/
|
|
1147
|
+
on_no_punctuation_seconds?: number;
|
|
1148
|
+
|
|
1149
|
+
/**
|
|
1150
|
+
* Seconds to wait after the transcript ends with a number.
|
|
1151
|
+
*/
|
|
1152
|
+
on_number_seconds?: number;
|
|
1153
|
+
|
|
1154
|
+
/**
|
|
1155
|
+
* Seconds to wait after the transcript ends with punctuation.
|
|
1156
|
+
*/
|
|
1157
|
+
on_punctuation_seconds?: number;
|
|
1158
|
+
}
|
|
1159
|
+
}
|
|
1160
|
+
}
|
|
1161
|
+
|
|
1162
|
+
/**
|
|
1163
|
+
* Reference to an MCP server attached to an assistant. Create and manage MCP
|
|
1164
|
+
* servers with the `/ai/mcp_servers` endpoints, then attach them to assistants by
|
|
1165
|
+
* ID.
|
|
1166
|
+
*/
|
|
1167
|
+
export interface McpServer {
|
|
1168
|
+
/**
|
|
1169
|
+
* ID of the MCP server to attach. This must be the `id` of an MCP server returned
|
|
1170
|
+
* by the `/ai/mcp_servers` endpoints.
|
|
1171
|
+
*/
|
|
1172
|
+
id: string;
|
|
1173
|
+
|
|
1174
|
+
/**
|
|
1175
|
+
* Optional per-assistant allowlist of MCP tool names. When omitted, the assistant
|
|
1176
|
+
* uses the MCP server's configured `allowed_tools`.
|
|
1177
|
+
*/
|
|
1178
|
+
allowed_tools?: Array<string>;
|
|
1179
|
+
}
|
|
1180
|
+
|
|
1181
|
+
/**
|
|
1182
|
+
* Configuration for post-conversation processing. When enabled, the assistant
|
|
1183
|
+
* receives one additional LLM turn after the conversation ends, allowing it to
|
|
1184
|
+
* execute tool calls such as logging to a CRM or sending a summary. The assistant
|
|
1185
|
+
* can execute multiple parallel or sequential tools during this phase.
|
|
1186
|
+
* Telephony-control tools (e.g. hangup, transfer) are unavailable
|
|
1187
|
+
* post-conversation. Beta feature.
|
|
1188
|
+
*/
|
|
1189
|
+
export interface PostConversationSettings {
|
|
1190
|
+
/**
|
|
1191
|
+
* Whether post-conversation processing is enabled. When true, the assistant will
|
|
1192
|
+
* be invoked after the conversation ends to perform any final tool calls. Defaults
|
|
1193
|
+
* to false.
|
|
1194
|
+
*/
|
|
1195
|
+
enabled?: boolean;
|
|
1196
|
+
}
|
|
1197
|
+
}
|
|
1198
|
+
|
|
883
1199
|
export interface InferenceEmbeddingWebhookToolParams {
|
|
884
1200
|
type: 'webhook';
|
|
885
1201
|
|
|
@@ -1159,6 +1475,13 @@ export interface TelephonySettings {
|
|
|
1159
1475
|
*/
|
|
1160
1476
|
time_limit_secs?: number;
|
|
1161
1477
|
|
|
1478
|
+
/**
|
|
1479
|
+
* Duration in seconds of end user silence before the assistant checks in on the
|
|
1480
|
+
* user. When this limit is reached the assistant will prompt the user to respond.
|
|
1481
|
+
* This is distinct from user_idle_timeout_secs which stops the assistant entirely.
|
|
1482
|
+
*/
|
|
1483
|
+
user_idle_reply_secs?: number;
|
|
1484
|
+
|
|
1162
1485
|
/**
|
|
1163
1486
|
* Maximum duration in seconds of end user silence on the call. When this limit is
|
|
1164
1487
|
* reached the assistant will be stopped. This limit does not apply to portions of
|
|
@@ -1278,30 +1601,45 @@ export namespace TelephonySettings {
|
|
|
1278
1601
|
|
|
1279
1602
|
export interface TranscriptionSettings {
|
|
1280
1603
|
/**
|
|
1281
|
-
*
|
|
1282
|
-
*
|
|
1604
|
+
* Integration secret identifier for the transcription provider API key. Currently
|
|
1605
|
+
* used for Azure transcription regions that require a customer-provided API key.
|
|
1606
|
+
*/
|
|
1607
|
+
api_key_ref?: string;
|
|
1608
|
+
|
|
1609
|
+
/**
|
|
1610
|
+
* The language of the audio to be transcribed. If not set, or if set to `auto`,
|
|
1611
|
+
* supported models will automatically detect the language. For `deepgram/flux`,
|
|
1612
|
+
* supported values are: `auto` (Telnyx language detection controls the language
|
|
1613
|
+
* hint), `multi` (no language hint), and language-specific hints `en`, `es`, `fr`,
|
|
1614
|
+
* `de`, `hi`, `ru`, `pt`, `ja`, `it`, and `nl`.
|
|
1283
1615
|
*/
|
|
1284
1616
|
language?: string;
|
|
1285
1617
|
|
|
1286
1618
|
/**
|
|
1287
|
-
* The speech to text model to be used by the voice assistant. All
|
|
1288
|
-
*
|
|
1619
|
+
* The speech to text model to be used by the voice assistant. All Deepgram models
|
|
1620
|
+
* are run on-premise.
|
|
1289
1621
|
*
|
|
1290
|
-
* - `deepgram/flux` is optimized for turn-taking
|
|
1291
|
-
* - `deepgram/nova-3` is
|
|
1292
|
-
*
|
|
1622
|
+
* - `deepgram/flux` is optimized for turn-taking with multilingual language hints.
|
|
1623
|
+
* - `deepgram/nova-3` is multilingual with automatic language detection.
|
|
1624
|
+
* - `deepgram/nova-2` is Deepgram's previous-generation multilingual model.
|
|
1625
|
+
* - `azure/fast` is a multilingual Azure transcription model.
|
|
1626
|
+
* - `assemblyai/universal-streaming` is a multilingual streaming model with
|
|
1627
|
+
* configurable turn detection.
|
|
1628
|
+
* - `xai/grok-stt` is a multilingual Grok STT model.
|
|
1293
1629
|
*/
|
|
1294
1630
|
model?:
|
|
1295
1631
|
| 'deepgram/flux'
|
|
1296
1632
|
| 'deepgram/nova-3'
|
|
1297
1633
|
| 'deepgram/nova-2'
|
|
1298
1634
|
| 'azure/fast'
|
|
1635
|
+
| 'assemblyai/universal-streaming'
|
|
1636
|
+
| 'xai/grok-stt'
|
|
1299
1637
|
| 'distil-whisper/distil-large-v2'
|
|
1300
1638
|
| 'openai/whisper-large-v3-turbo';
|
|
1301
1639
|
|
|
1302
1640
|
/**
|
|
1303
1641
|
* Region on third party cloud providers (currently Azure) if using one of their
|
|
1304
|
-
* models
|
|
1642
|
+
* models. Some regions require `api_key_ref`.
|
|
1305
1643
|
*/
|
|
1306
1644
|
region?: string;
|
|
1307
1645
|
|
|
@@ -1316,6 +1654,13 @@ export interface TranscriptionSettingsConfig {
|
|
|
1316
1654
|
*/
|
|
1317
1655
|
eager_eot_threshold?: number;
|
|
1318
1656
|
|
|
1657
|
+
/**
|
|
1658
|
+
* Available only for assemblyai/universal-streaming. Confidence level required to
|
|
1659
|
+
* trigger an end of turn. Higher values require more certainty before ending a
|
|
1660
|
+
* turn.
|
|
1661
|
+
*/
|
|
1662
|
+
end_of_turn_confidence_threshold?: number;
|
|
1663
|
+
|
|
1319
1664
|
/**
|
|
1320
1665
|
* Available only for deepgram/flux. Confidence required to trigger an end of turn.
|
|
1321
1666
|
* Higher values = more reliable turn detection but slightly increased latency.
|
|
@@ -1328,6 +1673,26 @@ export interface TranscriptionSettingsConfig {
|
|
|
1328
1673
|
*/
|
|
1329
1674
|
eot_timeout_ms?: number;
|
|
1330
1675
|
|
|
1676
|
+
/**
|
|
1677
|
+
* Available only for deepgram/nova-3 and deepgram/flux. A comma-separated list of
|
|
1678
|
+
* key terms to boost for recognition during transcription. Helps improve accuracy
|
|
1679
|
+
* for domain-specific terminology, proper nouns, or uncommon words.
|
|
1680
|
+
*/
|
|
1681
|
+
keyterm?: string;
|
|
1682
|
+
|
|
1683
|
+
/**
|
|
1684
|
+
* Available only for assemblyai/universal-streaming. Maximum duration of silence
|
|
1685
|
+
* in milliseconds before forcing an end of turn.
|
|
1686
|
+
*/
|
|
1687
|
+
max_turn_silence?: number;
|
|
1688
|
+
|
|
1689
|
+
/**
|
|
1690
|
+
* Available only for assemblyai/universal-streaming. Minimum duration of silence
|
|
1691
|
+
* in milliseconds before a turn can end. Must be less than or equal to
|
|
1692
|
+
* max_turn_silence.
|
|
1693
|
+
*/
|
|
1694
|
+
min_turn_silence?: number;
|
|
1695
|
+
|
|
1331
1696
|
numerals?: boolean;
|
|
1332
1697
|
|
|
1333
1698
|
smart_format?: boolean;
|
|
@@ -1376,7 +1741,11 @@ export interface VoiceSettings {
|
|
|
1376
1741
|
* key as an integration secret under the `api_key_ref` field. See
|
|
1377
1742
|
* [integration secrets documentation](https://developers.telnyx.com/api-reference/integration-secrets/create-a-secret)
|
|
1378
1743
|
* for details. For Telnyx voices, use `Telnyx.<model_id>.<voice_id>` (e.g.
|
|
1379
|
-
* Telnyx.KokoroTTS.af_heart)
|
|
1744
|
+
* Telnyx.KokoroTTS.af_heart). The voice portion of the identifier supports
|
|
1745
|
+
* [dynamic variables](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables)
|
|
1746
|
+
* using mustache syntax (e.g. `Telnyx.Ultra.{{voice_id}}`). The variable is
|
|
1747
|
+
* resolved at call time from your dynamic variables webhook, allowing you to
|
|
1748
|
+
* select the voice dynamically per call.
|
|
1380
1749
|
*/
|
|
1381
1750
|
voice: string;
|
|
1382
1751
|
|
|
@@ -1760,13 +2129,6 @@ export interface AssistantCreateParams {
|
|
|
1760
2129
|
*/
|
|
1761
2130
|
instructions: string;
|
|
1762
2131
|
|
|
1763
|
-
/**
|
|
1764
|
-
* ID of the model to use. You can use the
|
|
1765
|
-
* [Get models API](https://developers.telnyx.com/api-reference/chat/get-available-models)
|
|
1766
|
-
* to see all of your available models,
|
|
1767
|
-
*/
|
|
1768
|
-
model: string;
|
|
1769
|
-
|
|
1770
2132
|
name: string;
|
|
1771
2133
|
|
|
1772
2134
|
description?: string;
|
|
@@ -1777,15 +2139,31 @@ export interface AssistantCreateParams {
|
|
|
1777
2139
|
dynamic_variables?: { [key: string]: unknown };
|
|
1778
2140
|
|
|
1779
2141
|
/**
|
|
1780
|
-
*
|
|
1781
|
-
*
|
|
1782
|
-
*
|
|
1783
|
-
*
|
|
2142
|
+
* Timeout in milliseconds for the dynamic variables webhook. Must be between 1 and
|
|
2143
|
+
* 10000 ms. If the webhook does not respond within this timeout, the call proceeds
|
|
2144
|
+
* with default values. See the
|
|
2145
|
+
* [dynamic variables guide](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables).
|
|
2146
|
+
*/
|
|
2147
|
+
dynamic_variables_webhook_timeout_ms?: number;
|
|
2148
|
+
|
|
2149
|
+
/**
|
|
2150
|
+
* If `dynamic_variables_webhook_url` is set, Telnyx sends a POST request to this
|
|
2151
|
+
* URL at the start of the conversation to resolve dynamic variables. **Gotcha:**
|
|
2152
|
+
* the webhook response must wrap variables under a top-level `dynamic_variables`
|
|
2153
|
+
* object, e.g. `{"dynamic_variables": {"customer_name": "Jane"}}`. Returning a
|
|
2154
|
+
* flat object will be ignored and variables will fall back to their defaults. See
|
|
2155
|
+
* the
|
|
2156
|
+
* [dynamic variables guide](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables)
|
|
2157
|
+
* for the full request/response format and timeout behavior.
|
|
1784
2158
|
*/
|
|
1785
2159
|
dynamic_variables_webhook_url?: string;
|
|
1786
2160
|
|
|
1787
2161
|
enabled_features?: Array<EnabledFeatures>;
|
|
1788
2162
|
|
|
2163
|
+
external_llm?: AssistantCreateParams.ExternalLlm;
|
|
2164
|
+
|
|
2165
|
+
fallback_config?: AssistantCreateParams.FallbackConfig;
|
|
2166
|
+
|
|
1789
2167
|
/**
|
|
1790
2168
|
* Text that the assistant will use to start the conversation. This may be
|
|
1791
2169
|
* templated with
|
|
@@ -1799,27 +2177,82 @@ export interface AssistantCreateParams {
|
|
|
1799
2177
|
insight_settings?: InsightSettings;
|
|
1800
2178
|
|
|
1801
2179
|
/**
|
|
1802
|
-
*
|
|
1803
|
-
*
|
|
2180
|
+
* Connected integrations attached to the assistant. The catalog of available
|
|
2181
|
+
* integrations is at `/ai/integrations`; the user's connected integrations are at
|
|
2182
|
+
* `/ai/integrations/connections`. Each item references a catalog integration by
|
|
2183
|
+
* `integration_id`.
|
|
2184
|
+
*/
|
|
2185
|
+
integrations?: Array<AssistantCreateParams.Integration>;
|
|
2186
|
+
|
|
2187
|
+
/**
|
|
2188
|
+
* Settings for interruptions and how the assistant decides the user has finished
|
|
2189
|
+
* speaking. These timings are most relevant when using non turn-taking
|
|
2190
|
+
* transcription models. For turn-taking models like `deepgram/flux`, end-of-turn
|
|
2191
|
+
* behavior is controlled by the transcription end-of-turn settings under
|
|
2192
|
+
* `transcription.settings` (`eot_threshold`, `eot_timeout_ms`,
|
|
2193
|
+
* `eager_eot_threshold`).
|
|
2194
|
+
*/
|
|
2195
|
+
interruption_settings?: AssistantCreateParams.InterruptionSettings;
|
|
2196
|
+
|
|
2197
|
+
/**
|
|
2198
|
+
* This is only needed when using third-party inference providers selected by
|
|
2199
|
+
* `model`. The `identifier` for an integration secret
|
|
1804
2200
|
* [/v2/integration_secrets](https://developers.telnyx.com/api-reference/integration-secrets/create-a-secret)
|
|
1805
|
-
* that refers to your LLM provider's API key.
|
|
1806
|
-
*
|
|
2201
|
+
* that refers to your LLM provider's API key. For bring-your-own endpoint
|
|
2202
|
+
* authentication, use `external_llm.llm_api_key_ref` instead. Warning: Free plans
|
|
2203
|
+
* are unlikely to work with this integration.
|
|
1807
2204
|
*/
|
|
1808
2205
|
llm_api_key_ref?: string;
|
|
1809
2206
|
|
|
2207
|
+
/**
|
|
2208
|
+
* MCP servers attached to the assistant. Create MCP servers with
|
|
2209
|
+
* `/ai/mcp_servers`, then reference them by `id` here.
|
|
2210
|
+
*/
|
|
2211
|
+
mcp_servers?: Array<AssistantCreateParams.McpServer>;
|
|
2212
|
+
|
|
1810
2213
|
messaging_settings?: MessagingSettings;
|
|
1811
2214
|
|
|
2215
|
+
/**
|
|
2216
|
+
* ID of the model to use when `external_llm` is not set. You can use the
|
|
2217
|
+
* [Get models API](https://developers.telnyx.com/api-reference/chat/get-available-models)
|
|
2218
|
+
* to see available models. If `external_llm` is provided, the assistant uses
|
|
2219
|
+
* `external_llm` instead of this field. If neither `model` nor `external_llm` is
|
|
2220
|
+
* provided, Telnyx applies the default model.
|
|
2221
|
+
*/
|
|
2222
|
+
model?: string;
|
|
2223
|
+
|
|
1812
2224
|
observability_settings?: ObservabilityReq;
|
|
1813
2225
|
|
|
2226
|
+
/**
|
|
2227
|
+
* Configuration for post-conversation processing. When enabled, the assistant
|
|
2228
|
+
* receives one additional LLM turn after the conversation ends, allowing it to
|
|
2229
|
+
* execute tool calls such as logging to a CRM or sending a summary. The assistant
|
|
2230
|
+
* can execute multiple parallel or sequential tools during this phase.
|
|
2231
|
+
* Telephony-control tools (e.g. hangup, transfer) are unavailable
|
|
2232
|
+
* post-conversation. Beta feature.
|
|
2233
|
+
*/
|
|
2234
|
+
post_conversation_settings?: AssistantCreateParams.PostConversationSettings;
|
|
2235
|
+
|
|
1814
2236
|
privacy_settings?: PrivacySettings;
|
|
1815
2237
|
|
|
2238
|
+
/**
|
|
2239
|
+
* Tags associated with the assistant. Tags can also be managed with the assistant
|
|
2240
|
+
* tag endpoints.
|
|
2241
|
+
*/
|
|
2242
|
+
tags?: Array<string>;
|
|
2243
|
+
|
|
1816
2244
|
telephony_settings?: TelephonySettings;
|
|
1817
2245
|
|
|
2246
|
+
/**
|
|
2247
|
+
* IDs of shared tools to attach to the assistant. New integrations should prefer
|
|
2248
|
+
* `tool_ids` over inline `tools`.
|
|
2249
|
+
*/
|
|
1818
2250
|
tool_ids?: Array<string>;
|
|
1819
2251
|
|
|
1820
2252
|
/**
|
|
1821
|
-
*
|
|
1822
|
-
*
|
|
2253
|
+
* Deprecated for new integrations. Inline tool definitions available to the
|
|
2254
|
+
* assistant. Prefer `tool_ids` to attach shared tools created with the AI Tools
|
|
2255
|
+
* endpoints.
|
|
1823
2256
|
*/
|
|
1824
2257
|
tools?: Array<AssistantTool>;
|
|
1825
2258
|
|
|
@@ -1833,6 +2266,242 @@ export interface AssistantCreateParams {
|
|
|
1833
2266
|
widget_settings?: WidgetSettings;
|
|
1834
2267
|
}
|
|
1835
2268
|
|
|
2269
|
+
export namespace AssistantCreateParams {
|
|
2270
|
+
export interface ExternalLlm {
|
|
2271
|
+
/**
|
|
2272
|
+
* Base URL for the external LLM endpoint.
|
|
2273
|
+
*/
|
|
2274
|
+
base_url: string;
|
|
2275
|
+
|
|
2276
|
+
/**
|
|
2277
|
+
* Model identifier to use with the external LLM endpoint.
|
|
2278
|
+
*/
|
|
2279
|
+
model: string;
|
|
2280
|
+
|
|
2281
|
+
/**
|
|
2282
|
+
* Authentication method used when connecting to the external LLM endpoint.
|
|
2283
|
+
*/
|
|
2284
|
+
authentication_method?: 'token' | 'certificate';
|
|
2285
|
+
|
|
2286
|
+
/**
|
|
2287
|
+
* Integration secret identifier for the client certificate used with certificate
|
|
2288
|
+
* authentication.
|
|
2289
|
+
*/
|
|
2290
|
+
certificate_ref?: string;
|
|
2291
|
+
|
|
2292
|
+
/**
|
|
2293
|
+
* When `true`, Telnyx forwards the assistant's dynamic variables to the external
|
|
2294
|
+
* LLM endpoint as a top-level `extra_metadata` object on the chat completion
|
|
2295
|
+
* request body. Defaults to `false`. Example payload sent to the external
|
|
2296
|
+
* endpoint:
|
|
2297
|
+
* `{"extra_metadata": {"customer_name": "Jane", "account_id": "acct_789", "telnyx_agent_target": "+13125550100", "telnyx_end_user_target": "+13125550123"}}`.
|
|
2298
|
+
* Distinct from OpenAI's native `metadata` field, which has its own size and type
|
|
2299
|
+
* limits.
|
|
2300
|
+
*/
|
|
2301
|
+
forward_metadata?: boolean;
|
|
2302
|
+
|
|
2303
|
+
/**
|
|
2304
|
+
* Integration secret identifier for the external LLM API key.
|
|
2305
|
+
*/
|
|
2306
|
+
llm_api_key_ref?: string;
|
|
2307
|
+
|
|
2308
|
+
/**
|
|
2309
|
+
* URL used to retrieve an access token when certificate authentication is enabled.
|
|
2310
|
+
*/
|
|
2311
|
+
token_retrieval_url?: string;
|
|
2312
|
+
}
|
|
2313
|
+
|
|
2314
|
+
export interface FallbackConfig {
|
|
2315
|
+
external_llm?: FallbackConfig.ExternalLlm;
|
|
2316
|
+
|
|
2317
|
+
/**
|
|
2318
|
+
* Integration secret identifier for the fallback model API key.
|
|
2319
|
+
*/
|
|
2320
|
+
llm_api_key_ref?: string;
|
|
2321
|
+
|
|
2322
|
+
/**
|
|
2323
|
+
* Fallback Telnyx-hosted model to use when the primary LLM provider is
|
|
2324
|
+
* unavailable.
|
|
2325
|
+
*/
|
|
2326
|
+
model?: string;
|
|
2327
|
+
}
|
|
2328
|
+
|
|
2329
|
+
export namespace FallbackConfig {
|
|
2330
|
+
export interface ExternalLlm {
|
|
2331
|
+
/**
|
|
2332
|
+
* Base URL for the external LLM endpoint.
|
|
2333
|
+
*/
|
|
2334
|
+
base_url: string;
|
|
2335
|
+
|
|
2336
|
+
/**
|
|
2337
|
+
* Model identifier to use with the external LLM endpoint.
|
|
2338
|
+
*/
|
|
2339
|
+
model: string;
|
|
2340
|
+
|
|
2341
|
+
/**
|
|
2342
|
+
* Authentication method used when connecting to the external LLM endpoint.
|
|
2343
|
+
*/
|
|
2344
|
+
authentication_method?: 'token' | 'certificate';
|
|
2345
|
+
|
|
2346
|
+
/**
|
|
2347
|
+
* Integration secret identifier for the client certificate used with certificate
|
|
2348
|
+
* authentication.
|
|
2349
|
+
*/
|
|
2350
|
+
certificate_ref?: string;
|
|
2351
|
+
|
|
2352
|
+
/**
|
|
2353
|
+
* When `true`, Telnyx forwards the assistant's dynamic variables to the external
|
|
2354
|
+
* LLM endpoint as a top-level `extra_metadata` object on the chat completion
|
|
2355
|
+
* request body. Defaults to `false`. Example payload sent to the external
|
|
2356
|
+
* endpoint:
|
|
2357
|
+
* `{"extra_metadata": {"customer_name": "Jane", "account_id": "acct_789", "telnyx_agent_target": "+13125550100", "telnyx_end_user_target": "+13125550123"}}`.
|
|
2358
|
+
* Distinct from OpenAI's native `metadata` field, which has its own size and type
|
|
2359
|
+
* limits.
|
|
2360
|
+
*/
|
|
2361
|
+
forward_metadata?: boolean;
|
|
2362
|
+
|
|
2363
|
+
/**
|
|
2364
|
+
* Integration secret identifier for the external LLM API key.
|
|
2365
|
+
*/
|
|
2366
|
+
llm_api_key_ref?: string;
|
|
2367
|
+
|
|
2368
|
+
/**
|
|
2369
|
+
* URL used to retrieve an access token when certificate authentication is enabled.
|
|
2370
|
+
*/
|
|
2371
|
+
token_retrieval_url?: string;
|
|
2372
|
+
}
|
|
2373
|
+
}
|
|
2374
|
+
|
|
2375
|
+
/**
|
|
2376
|
+
* Reference to a connected integration attached to an assistant. Discover
|
|
2377
|
+
* available integrations with `/ai/integrations` and connected integrations with
|
|
2378
|
+
* `/ai/integrations/connections`.
|
|
2379
|
+
*/
|
|
2380
|
+
export interface Integration {
|
|
2381
|
+
/**
|
|
2382
|
+
* Catalog integration ID to attach. This is the `id` from the integrations catalog
|
|
2383
|
+
* at `/ai/integrations` (the same value also appears as `integration_id` on
|
|
2384
|
+
* entries returned by `/ai/integrations/connections`). It is **not** the
|
|
2385
|
+
* connection-level `id` from `/ai/integrations/connections`.
|
|
2386
|
+
*/
|
|
2387
|
+
integration_id: string;
|
|
2388
|
+
|
|
2389
|
+
/**
|
|
2390
|
+
* Optional per-assistant allowlist of integration tool names. When omitted or
|
|
2391
|
+
* empty, all tools allowed by the connected integration are available to the
|
|
2392
|
+
* assistant.
|
|
2393
|
+
*/
|
|
2394
|
+
allowed_list?: Array<string>;
|
|
2395
|
+
}
|
|
2396
|
+
|
|
2397
|
+
/**
|
|
2398
|
+
* Settings for interruptions and how the assistant decides the user has finished
|
|
2399
|
+
* speaking. These timings are most relevant when using non turn-taking
|
|
2400
|
+
* transcription models. For turn-taking models like `deepgram/flux`, end-of-turn
|
|
2401
|
+
* behavior is controlled by the transcription end-of-turn settings under
|
|
2402
|
+
* `transcription.settings` (`eot_threshold`, `eot_timeout_ms`,
|
|
2403
|
+
* `eager_eot_threshold`).
|
|
2404
|
+
*/
|
|
2405
|
+
export interface InterruptionSettings {
|
|
2406
|
+
/**
|
|
2407
|
+
* Whether users can interrupt the assistant while it is speaking.
|
|
2408
|
+
*/
|
|
2409
|
+
enable?: boolean;
|
|
2410
|
+
|
|
2411
|
+
/**
|
|
2412
|
+
* Controls when the assistant starts speaking after the user stops. These
|
|
2413
|
+
* thresholds primarily apply to non turn-taking transcription models. For
|
|
2414
|
+
* turn-taking models like `deepgram/flux`, end-of-turn detection is driven by the
|
|
2415
|
+
* transcription end-of-turn settings under `transcription.settings` instead.
|
|
2416
|
+
*/
|
|
2417
|
+
start_speaking_plan?: InterruptionSettings.StartSpeakingPlan;
|
|
2418
|
+
}
|
|
2419
|
+
|
|
2420
|
+
export namespace InterruptionSettings {
|
|
2421
|
+
/**
|
|
2422
|
+
* Controls when the assistant starts speaking after the user stops. These
|
|
2423
|
+
* thresholds primarily apply to non turn-taking transcription models. For
|
|
2424
|
+
* turn-taking models like `deepgram/flux`, end-of-turn detection is driven by the
|
|
2425
|
+
* transcription end-of-turn settings under `transcription.settings` instead.
|
|
2426
|
+
*/
|
|
2427
|
+
export interface StartSpeakingPlan {
|
|
2428
|
+
/**
|
|
2429
|
+
* Endpointing thresholds used to decide when the user has finished speaking.
|
|
2430
|
+
* Applies to non turn-taking transcription models. For `deepgram/flux`, use
|
|
2431
|
+
* `transcription.settings.eot_threshold` / `eot_timeout_ms` /
|
|
2432
|
+
* `eager_eot_threshold`.
|
|
2433
|
+
*/
|
|
2434
|
+
transcription_endpointing_plan?: StartSpeakingPlan.TranscriptionEndpointingPlan;
|
|
2435
|
+
|
|
2436
|
+
/**
|
|
2437
|
+
* Minimum seconds to wait before the assistant starts speaking.
|
|
2438
|
+
*/
|
|
2439
|
+
wait_seconds?: number;
|
|
2440
|
+
}
|
|
2441
|
+
|
|
2442
|
+
export namespace StartSpeakingPlan {
|
|
2443
|
+
/**
|
|
2444
|
+
* Endpointing thresholds used to decide when the user has finished speaking.
|
|
2445
|
+
* Applies to non turn-taking transcription models. For `deepgram/flux`, use
|
|
2446
|
+
* `transcription.settings.eot_threshold` / `eot_timeout_ms` /
|
|
2447
|
+
* `eager_eot_threshold`.
|
|
2448
|
+
*/
|
|
2449
|
+
export interface TranscriptionEndpointingPlan {
|
|
2450
|
+
/**
|
|
2451
|
+
* Seconds to wait after the transcript ends without punctuation.
|
|
2452
|
+
*/
|
|
2453
|
+
on_no_punctuation_seconds?: number;
|
|
2454
|
+
|
|
2455
|
+
/**
|
|
2456
|
+
* Seconds to wait after the transcript ends with a number.
|
|
2457
|
+
*/
|
|
2458
|
+
on_number_seconds?: number;
|
|
2459
|
+
|
|
2460
|
+
/**
|
|
2461
|
+
* Seconds to wait after the transcript ends with punctuation.
|
|
2462
|
+
*/
|
|
2463
|
+
on_punctuation_seconds?: number;
|
|
2464
|
+
}
|
|
2465
|
+
}
|
|
2466
|
+
}
|
|
2467
|
+
|
|
2468
|
+
/**
|
|
2469
|
+
* Reference to an MCP server attached to an assistant. Create and manage MCP
|
|
2470
|
+
* servers with the `/ai/mcp_servers` endpoints, then attach them to assistants by
|
|
2471
|
+
* ID.
|
|
2472
|
+
*/
|
|
2473
|
+
export interface McpServer {
|
|
2474
|
+
/**
|
|
2475
|
+
* ID of the MCP server to attach. This must be the `id` of an MCP server returned
|
|
2476
|
+
* by the `/ai/mcp_servers` endpoints.
|
|
2477
|
+
*/
|
|
2478
|
+
id: string;
|
|
2479
|
+
|
|
2480
|
+
/**
|
|
2481
|
+
* Optional per-assistant allowlist of MCP tool names. When omitted, the assistant
|
|
2482
|
+
* uses the MCP server's configured `allowed_tools`.
|
|
2483
|
+
*/
|
|
2484
|
+
allowed_tools?: Array<string>;
|
|
2485
|
+
}
|
|
2486
|
+
|
|
2487
|
+
/**
|
|
2488
|
+
* Configuration for post-conversation processing. When enabled, the assistant
|
|
2489
|
+
* receives one additional LLM turn after the conversation ends, allowing it to
|
|
2490
|
+
* execute tool calls such as logging to a CRM or sending a summary. The assistant
|
|
2491
|
+
* can execute multiple parallel or sequential tools during this phase.
|
|
2492
|
+
* Telephony-control tools (e.g. hangup, transfer) are unavailable
|
|
2493
|
+
* post-conversation. Beta feature.
|
|
2494
|
+
*/
|
|
2495
|
+
export interface PostConversationSettings {
|
|
2496
|
+
/**
|
|
2497
|
+
* Whether post-conversation processing is enabled. When true, the assistant will
|
|
2498
|
+
* be invoked after the conversation ends to perform any final tool calls. Defaults
|
|
2499
|
+
* to false.
|
|
2500
|
+
*/
|
|
2501
|
+
enabled?: boolean;
|
|
2502
|
+
}
|
|
2503
|
+
}
|
|
2504
|
+
|
|
1836
2505
|
export interface AssistantRetrieveParams {
|
|
1837
2506
|
call_control_id?: string;
|
|
1838
2507
|
|
|
@@ -1852,15 +2521,31 @@ export interface AssistantUpdateParams {
|
|
|
1852
2521
|
dynamic_variables?: { [key: string]: unknown };
|
|
1853
2522
|
|
|
1854
2523
|
/**
|
|
1855
|
-
*
|
|
1856
|
-
*
|
|
1857
|
-
*
|
|
1858
|
-
*
|
|
2524
|
+
* Timeout in milliseconds for the dynamic variables webhook. Must be between 1 and
|
|
2525
|
+
* 10000 ms. If the webhook does not respond within this timeout, the call proceeds
|
|
2526
|
+
* with default values. See the
|
|
2527
|
+
* [dynamic variables guide](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables).
|
|
2528
|
+
*/
|
|
2529
|
+
dynamic_variables_webhook_timeout_ms?: number;
|
|
2530
|
+
|
|
2531
|
+
/**
|
|
2532
|
+
* If `dynamic_variables_webhook_url` is set, Telnyx sends a POST request to this
|
|
2533
|
+
* URL at the start of the conversation to resolve dynamic variables. **Gotcha:**
|
|
2534
|
+
* the webhook response must wrap variables under a top-level `dynamic_variables`
|
|
2535
|
+
* object, e.g. `{"dynamic_variables": {"customer_name": "Jane"}}`. Returning a
|
|
2536
|
+
* flat object will be ignored and variables will fall back to their defaults. See
|
|
2537
|
+
* the
|
|
2538
|
+
* [dynamic variables guide](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables)
|
|
2539
|
+
* for the full request/response format and timeout behavior.
|
|
1859
2540
|
*/
|
|
1860
2541
|
dynamic_variables_webhook_url?: string;
|
|
1861
2542
|
|
|
1862
2543
|
enabled_features?: Array<EnabledFeatures>;
|
|
1863
2544
|
|
|
2545
|
+
external_llm?: AssistantUpdateParams.ExternalLlm;
|
|
2546
|
+
|
|
2547
|
+
fallback_config?: AssistantUpdateParams.FallbackConfig;
|
|
2548
|
+
|
|
1864
2549
|
/**
|
|
1865
2550
|
* Text that the assistant will use to start the conversation. This may be
|
|
1866
2551
|
* templated with
|
|
@@ -1880,20 +2565,47 @@ export interface AssistantUpdateParams {
|
|
|
1880
2565
|
instructions?: string;
|
|
1881
2566
|
|
|
1882
2567
|
/**
|
|
1883
|
-
*
|
|
1884
|
-
*
|
|
2568
|
+
* Connected integrations attached to the assistant. The catalog of available
|
|
2569
|
+
* integrations is at `/ai/integrations`; the user's connected integrations are at
|
|
2570
|
+
* `/ai/integrations/connections`. Each item references a catalog integration by
|
|
2571
|
+
* `integration_id`.
|
|
2572
|
+
*/
|
|
2573
|
+
integrations?: Array<AssistantUpdateParams.Integration>;
|
|
2574
|
+
|
|
2575
|
+
/**
|
|
2576
|
+
* Settings for interruptions and how the assistant decides the user has finished
|
|
2577
|
+
* speaking. These timings are most relevant when using non turn-taking
|
|
2578
|
+
* transcription models. For turn-taking models like `deepgram/flux`, end-of-turn
|
|
2579
|
+
* behavior is controlled by the transcription end-of-turn settings under
|
|
2580
|
+
* `transcription.settings` (`eot_threshold`, `eot_timeout_ms`,
|
|
2581
|
+
* `eager_eot_threshold`).
|
|
2582
|
+
*/
|
|
2583
|
+
interruption_settings?: AssistantUpdateParams.InterruptionSettings;
|
|
2584
|
+
|
|
2585
|
+
/**
|
|
2586
|
+
* This is only needed when using third-party inference providers selected by
|
|
2587
|
+
* `model`. The `identifier` for an integration secret
|
|
1885
2588
|
* [/v2/integration_secrets](https://developers.telnyx.com/api-reference/integration-secrets/create-a-secret)
|
|
1886
|
-
* that refers to your LLM provider's API key.
|
|
1887
|
-
*
|
|
2589
|
+
* that refers to your LLM provider's API key. For bring-your-own endpoint
|
|
2590
|
+
* authentication, use `external_llm.llm_api_key_ref` instead. Warning: Free plans
|
|
2591
|
+
* are unlikely to work with this integration.
|
|
1888
2592
|
*/
|
|
1889
2593
|
llm_api_key_ref?: string;
|
|
1890
2594
|
|
|
2595
|
+
/**
|
|
2596
|
+
* MCP servers attached to the assistant. Create MCP servers with
|
|
2597
|
+
* `/ai/mcp_servers`, then reference them by `id` here.
|
|
2598
|
+
*/
|
|
2599
|
+
mcp_servers?: Array<AssistantUpdateParams.McpServer>;
|
|
2600
|
+
|
|
1891
2601
|
messaging_settings?: MessagingSettings;
|
|
1892
2602
|
|
|
1893
2603
|
/**
|
|
1894
|
-
* ID of the model to use. You can use the
|
|
2604
|
+
* ID of the model to use when `external_llm` is not set. You can use the
|
|
1895
2605
|
* [Get models API](https://developers.telnyx.com/api-reference/chat/get-available-models)
|
|
1896
|
-
* to see
|
|
2606
|
+
* to see available models. If `external_llm` is provided, the assistant uses
|
|
2607
|
+
* `external_llm` instead of this field. If neither `model` nor `external_llm` is
|
|
2608
|
+
* provided, Telnyx applies the default model.
|
|
1897
2609
|
*/
|
|
1898
2610
|
model?: string;
|
|
1899
2611
|
|
|
@@ -1901,6 +2613,16 @@ export interface AssistantUpdateParams {
|
|
|
1901
2613
|
|
|
1902
2614
|
observability_settings?: ObservabilityReq;
|
|
1903
2615
|
|
|
2616
|
+
/**
|
|
2617
|
+
* Configuration for post-conversation processing. When enabled, the assistant
|
|
2618
|
+
* receives one additional LLM turn after the conversation ends, allowing it to
|
|
2619
|
+
* execute tool calls such as logging to a CRM or sending a summary. The assistant
|
|
2620
|
+
* can execute multiple parallel or sequential tools during this phase.
|
|
2621
|
+
* Telephony-control tools (e.g. hangup, transfer) are unavailable
|
|
2622
|
+
* post-conversation. Beta feature.
|
|
2623
|
+
*/
|
|
2624
|
+
post_conversation_settings?: AssistantUpdateParams.PostConversationSettings;
|
|
2625
|
+
|
|
1904
2626
|
privacy_settings?: PrivacySettings;
|
|
1905
2627
|
|
|
1906
2628
|
/**
|
|
@@ -1909,18 +2631,34 @@ export interface AssistantUpdateParams {
|
|
|
1909
2631
|
*/
|
|
1910
2632
|
promote_to_main?: boolean;
|
|
1911
2633
|
|
|
2634
|
+
/**
|
|
2635
|
+
* Tags associated with the assistant. Tags can also be managed with the assistant
|
|
2636
|
+
* tag endpoints.
|
|
2637
|
+
*/
|
|
2638
|
+
tags?: Array<string>;
|
|
2639
|
+
|
|
1912
2640
|
telephony_settings?: TelephonySettings;
|
|
1913
2641
|
|
|
2642
|
+
/**
|
|
2643
|
+
* IDs of shared tools to attach to the assistant. New integrations should prefer
|
|
2644
|
+
* `tool_ids` over inline `tools`.
|
|
2645
|
+
*/
|
|
1914
2646
|
tool_ids?: Array<string>;
|
|
1915
2647
|
|
|
1916
2648
|
/**
|
|
1917
|
-
*
|
|
1918
|
-
*
|
|
2649
|
+
* Deprecated for new integrations. Inline tool definitions available to the
|
|
2650
|
+
* assistant. Prefer `tool_ids` to attach shared tools created with the AI Tools
|
|
2651
|
+
* endpoints.
|
|
1919
2652
|
*/
|
|
1920
2653
|
tools?: Array<AssistantTool>;
|
|
1921
2654
|
|
|
1922
2655
|
transcription?: TranscriptionSettings;
|
|
1923
2656
|
|
|
2657
|
+
/**
|
|
2658
|
+
* Human-readable name for the assistant version.
|
|
2659
|
+
*/
|
|
2660
|
+
version_name?: string;
|
|
2661
|
+
|
|
1924
2662
|
voice_settings?: VoiceSettings;
|
|
1925
2663
|
|
|
1926
2664
|
/**
|
|
@@ -1929,6 +2667,242 @@ export interface AssistantUpdateParams {
|
|
|
1929
2667
|
widget_settings?: WidgetSettings;
|
|
1930
2668
|
}
|
|
1931
2669
|
|
|
2670
|
+
export namespace AssistantUpdateParams {
|
|
2671
|
+
export interface ExternalLlm {
|
|
2672
|
+
/**
|
|
2673
|
+
* Base URL for the external LLM endpoint.
|
|
2674
|
+
*/
|
|
2675
|
+
base_url: string;
|
|
2676
|
+
|
|
2677
|
+
/**
|
|
2678
|
+
* Model identifier to use with the external LLM endpoint.
|
|
2679
|
+
*/
|
|
2680
|
+
model: string;
|
|
2681
|
+
|
|
2682
|
+
/**
|
|
2683
|
+
* Authentication method used when connecting to the external LLM endpoint.
|
|
2684
|
+
*/
|
|
2685
|
+
authentication_method?: 'token' | 'certificate';
|
|
2686
|
+
|
|
2687
|
+
/**
|
|
2688
|
+
* Integration secret identifier for the client certificate used with certificate
|
|
2689
|
+
* authentication.
|
|
2690
|
+
*/
|
|
2691
|
+
certificate_ref?: string;
|
|
2692
|
+
|
|
2693
|
+
/**
|
|
2694
|
+
* When `true`, Telnyx forwards the assistant's dynamic variables to the external
|
|
2695
|
+
* LLM endpoint as a top-level `extra_metadata` object on the chat completion
|
|
2696
|
+
* request body. Defaults to `false`. Example payload sent to the external
|
|
2697
|
+
* endpoint:
|
|
2698
|
+
* `{"extra_metadata": {"customer_name": "Jane", "account_id": "acct_789", "telnyx_agent_target": "+13125550100", "telnyx_end_user_target": "+13125550123"}}`.
|
|
2699
|
+
* Distinct from OpenAI's native `metadata` field, which has its own size and type
|
|
2700
|
+
* limits.
|
|
2701
|
+
*/
|
|
2702
|
+
forward_metadata?: boolean;
|
|
2703
|
+
|
|
2704
|
+
/**
|
|
2705
|
+
* Integration secret identifier for the external LLM API key.
|
|
2706
|
+
*/
|
|
2707
|
+
llm_api_key_ref?: string;
|
|
2708
|
+
|
|
2709
|
+
/**
|
|
2710
|
+
* URL used to retrieve an access token when certificate authentication is enabled.
|
|
2711
|
+
*/
|
|
2712
|
+
token_retrieval_url?: string;
|
|
2713
|
+
}
|
|
2714
|
+
|
|
2715
|
+
export interface FallbackConfig {
|
|
2716
|
+
external_llm?: FallbackConfig.ExternalLlm;
|
|
2717
|
+
|
|
2718
|
+
/**
|
|
2719
|
+
* Integration secret identifier for the fallback model API key.
|
|
2720
|
+
*/
|
|
2721
|
+
llm_api_key_ref?: string;
|
|
2722
|
+
|
|
2723
|
+
/**
|
|
2724
|
+
* Fallback Telnyx-hosted model to use when the primary LLM provider is
|
|
2725
|
+
* unavailable.
|
|
2726
|
+
*/
|
|
2727
|
+
model?: string;
|
|
2728
|
+
}
|
|
2729
|
+
|
|
2730
|
+
export namespace FallbackConfig {
|
|
2731
|
+
export interface ExternalLlm {
|
|
2732
|
+
/**
|
|
2733
|
+
* Base URL for the external LLM endpoint.
|
|
2734
|
+
*/
|
|
2735
|
+
base_url: string;
|
|
2736
|
+
|
|
2737
|
+
/**
|
|
2738
|
+
* Model identifier to use with the external LLM endpoint.
|
|
2739
|
+
*/
|
|
2740
|
+
model: string;
|
|
2741
|
+
|
|
2742
|
+
/**
|
|
2743
|
+
* Authentication method used when connecting to the external LLM endpoint.
|
|
2744
|
+
*/
|
|
2745
|
+
authentication_method?: 'token' | 'certificate';
|
|
2746
|
+
|
|
2747
|
+
/**
|
|
2748
|
+
* Integration secret identifier for the client certificate used with certificate
|
|
2749
|
+
* authentication.
|
|
2750
|
+
*/
|
|
2751
|
+
certificate_ref?: string;
|
|
2752
|
+
|
|
2753
|
+
/**
|
|
2754
|
+
* When `true`, Telnyx forwards the assistant's dynamic variables to the external
|
|
2755
|
+
* LLM endpoint as a top-level `extra_metadata` object on the chat completion
|
|
2756
|
+
* request body. Defaults to `false`. Example payload sent to the external
|
|
2757
|
+
* endpoint:
|
|
2758
|
+
* `{"extra_metadata": {"customer_name": "Jane", "account_id": "acct_789", "telnyx_agent_target": "+13125550100", "telnyx_end_user_target": "+13125550123"}}`.
|
|
2759
|
+
* Distinct from OpenAI's native `metadata` field, which has its own size and type
|
|
2760
|
+
* limits.
|
|
2761
|
+
*/
|
|
2762
|
+
forward_metadata?: boolean;
|
|
2763
|
+
|
|
2764
|
+
/**
|
|
2765
|
+
* Integration secret identifier for the external LLM API key.
|
|
2766
|
+
*/
|
|
2767
|
+
llm_api_key_ref?: string;
|
|
2768
|
+
|
|
2769
|
+
/**
|
|
2770
|
+
* URL used to retrieve an access token when certificate authentication is enabled.
|
|
2771
|
+
*/
|
|
2772
|
+
token_retrieval_url?: string;
|
|
2773
|
+
}
|
|
2774
|
+
}
|
|
2775
|
+
|
|
2776
|
+
/**
|
|
2777
|
+
* Reference to a connected integration attached to an assistant. Discover
|
|
2778
|
+
* available integrations with `/ai/integrations` and connected integrations with
|
|
2779
|
+
* `/ai/integrations/connections`.
|
|
2780
|
+
*/
|
|
2781
|
+
export interface Integration {
|
|
2782
|
+
/**
|
|
2783
|
+
* Catalog integration ID to attach. This is the `id` from the integrations catalog
|
|
2784
|
+
* at `/ai/integrations` (the same value also appears as `integration_id` on
|
|
2785
|
+
* entries returned by `/ai/integrations/connections`). It is **not** the
|
|
2786
|
+
* connection-level `id` from `/ai/integrations/connections`.
|
|
2787
|
+
*/
|
|
2788
|
+
integration_id: string;
|
|
2789
|
+
|
|
2790
|
+
/**
|
|
2791
|
+
* Optional per-assistant allowlist of integration tool names. When omitted or
|
|
2792
|
+
* empty, all tools allowed by the connected integration are available to the
|
|
2793
|
+
* assistant.
|
|
2794
|
+
*/
|
|
2795
|
+
allowed_list?: Array<string>;
|
|
2796
|
+
}
|
|
2797
|
+
|
|
2798
|
+
/**
|
|
2799
|
+
* Settings for interruptions and how the assistant decides the user has finished
|
|
2800
|
+
* speaking. These timings are most relevant when using non turn-taking
|
|
2801
|
+
* transcription models. For turn-taking models like `deepgram/flux`, end-of-turn
|
|
2802
|
+
* behavior is controlled by the transcription end-of-turn settings under
|
|
2803
|
+
* `transcription.settings` (`eot_threshold`, `eot_timeout_ms`,
|
|
2804
|
+
* `eager_eot_threshold`).
|
|
2805
|
+
*/
|
|
2806
|
+
export interface InterruptionSettings {
|
|
2807
|
+
/**
|
|
2808
|
+
* Whether users can interrupt the assistant while it is speaking.
|
|
2809
|
+
*/
|
|
2810
|
+
enable?: boolean;
|
|
2811
|
+
|
|
2812
|
+
/**
|
|
2813
|
+
* Controls when the assistant starts speaking after the user stops. These
|
|
2814
|
+
* thresholds primarily apply to non turn-taking transcription models. For
|
|
2815
|
+
* turn-taking models like `deepgram/flux`, end-of-turn detection is driven by the
|
|
2816
|
+
* transcription end-of-turn settings under `transcription.settings` instead.
|
|
2817
|
+
*/
|
|
2818
|
+
start_speaking_plan?: InterruptionSettings.StartSpeakingPlan;
|
|
2819
|
+
}
|
|
2820
|
+
|
|
2821
|
+
export namespace InterruptionSettings {
|
|
2822
|
+
/**
|
|
2823
|
+
* Controls when the assistant starts speaking after the user stops. These
|
|
2824
|
+
* thresholds primarily apply to non turn-taking transcription models. For
|
|
2825
|
+
* turn-taking models like `deepgram/flux`, end-of-turn detection is driven by the
|
|
2826
|
+
* transcription end-of-turn settings under `transcription.settings` instead.
|
|
2827
|
+
*/
|
|
2828
|
+
export interface StartSpeakingPlan {
|
|
2829
|
+
/**
|
|
2830
|
+
* Endpointing thresholds used to decide when the user has finished speaking.
|
|
2831
|
+
* Applies to non turn-taking transcription models. For `deepgram/flux`, use
|
|
2832
|
+
* `transcription.settings.eot_threshold` / `eot_timeout_ms` /
|
|
2833
|
+
* `eager_eot_threshold`.
|
|
2834
|
+
*/
|
|
2835
|
+
transcription_endpointing_plan?: StartSpeakingPlan.TranscriptionEndpointingPlan;
|
|
2836
|
+
|
|
2837
|
+
/**
|
|
2838
|
+
* Minimum seconds to wait before the assistant starts speaking.
|
|
2839
|
+
*/
|
|
2840
|
+
wait_seconds?: number;
|
|
2841
|
+
}
|
|
2842
|
+
|
|
2843
|
+
export namespace StartSpeakingPlan {
|
|
2844
|
+
/**
|
|
2845
|
+
* Endpointing thresholds used to decide when the user has finished speaking.
|
|
2846
|
+
* Applies to non turn-taking transcription models. For `deepgram/flux`, use
|
|
2847
|
+
* `transcription.settings.eot_threshold` / `eot_timeout_ms` /
|
|
2848
|
+
* `eager_eot_threshold`.
|
|
2849
|
+
*/
|
|
2850
|
+
export interface TranscriptionEndpointingPlan {
|
|
2851
|
+
/**
|
|
2852
|
+
* Seconds to wait after the transcript ends without punctuation.
|
|
2853
|
+
*/
|
|
2854
|
+
on_no_punctuation_seconds?: number;
|
|
2855
|
+
|
|
2856
|
+
/**
|
|
2857
|
+
* Seconds to wait after the transcript ends with a number.
|
|
2858
|
+
*/
|
|
2859
|
+
on_number_seconds?: number;
|
|
2860
|
+
|
|
2861
|
+
/**
|
|
2862
|
+
* Seconds to wait after the transcript ends with punctuation.
|
|
2863
|
+
*/
|
|
2864
|
+
on_punctuation_seconds?: number;
|
|
2865
|
+
}
|
|
2866
|
+
}
|
|
2867
|
+
}
|
|
2868
|
+
|
|
2869
|
+
/**
|
|
2870
|
+
* Reference to an MCP server attached to an assistant. Create and manage MCP
|
|
2871
|
+
* servers with the `/ai/mcp_servers` endpoints, then attach them to assistants by
|
|
2872
|
+
* ID.
|
|
2873
|
+
*/
|
|
2874
|
+
export interface McpServer {
|
|
2875
|
+
/**
|
|
2876
|
+
* ID of the MCP server to attach. This must be the `id` of an MCP server returned
|
|
2877
|
+
* by the `/ai/mcp_servers` endpoints.
|
|
2878
|
+
*/
|
|
2879
|
+
id: string;
|
|
2880
|
+
|
|
2881
|
+
/**
|
|
2882
|
+
* Optional per-assistant allowlist of MCP tool names. When omitted, the assistant
|
|
2883
|
+
* uses the MCP server's configured `allowed_tools`.
|
|
2884
|
+
*/
|
|
2885
|
+
allowed_tools?: Array<string>;
|
|
2886
|
+
}
|
|
2887
|
+
|
|
2888
|
+
/**
|
|
2889
|
+
* Configuration for post-conversation processing. When enabled, the assistant
|
|
2890
|
+
* receives one additional LLM turn after the conversation ends, allowing it to
|
|
2891
|
+
* execute tool calls such as logging to a CRM or sending a summary. The assistant
|
|
2892
|
+
* can execute multiple parallel or sequential tools during this phase.
|
|
2893
|
+
* Telephony-control tools (e.g. hangup, transfer) are unavailable
|
|
2894
|
+
* post-conversation. Beta feature.
|
|
2895
|
+
*/
|
|
2896
|
+
export interface PostConversationSettings {
|
|
2897
|
+
/**
|
|
2898
|
+
* Whether post-conversation processing is enabled. When true, the assistant will
|
|
2899
|
+
* be invoked after the conversation ends to perform any final tool calls. Defaults
|
|
2900
|
+
* to false.
|
|
2901
|
+
*/
|
|
2902
|
+
enabled?: boolean;
|
|
2903
|
+
}
|
|
2904
|
+
}
|
|
2905
|
+
|
|
1932
2906
|
export interface AssistantChatParams {
|
|
1933
2907
|
/**
|
|
1934
2908
|
* The message content sent by the client to the assistant
|