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