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
|
@@ -80,13 +80,26 @@ export interface UpdateAssistant {
|
|
|
80
80
|
[key: string]: unknown;
|
|
81
81
|
};
|
|
82
82
|
/**
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
*
|
|
83
|
+
* Timeout in milliseconds for the dynamic variables webhook. Must be between 1 and
|
|
84
|
+
* 10000 ms. If the webhook does not respond within this timeout, the call proceeds
|
|
85
|
+
* with default values. See the
|
|
86
|
+
* [dynamic variables guide](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables).
|
|
87
|
+
*/
|
|
88
|
+
dynamic_variables_webhook_timeout_ms?: number;
|
|
89
|
+
/**
|
|
90
|
+
* If `dynamic_variables_webhook_url` is set, Telnyx sends a POST request to this
|
|
91
|
+
* URL at the start of the conversation to resolve dynamic variables. **Gotcha:**
|
|
92
|
+
* the webhook response must wrap variables under a top-level `dynamic_variables`
|
|
93
|
+
* object, e.g. `{"dynamic_variables": {"customer_name": "Jane"}}`. Returning a
|
|
94
|
+
* flat object will be ignored and variables will fall back to their defaults. See
|
|
95
|
+
* the
|
|
96
|
+
* [dynamic variables guide](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables)
|
|
97
|
+
* for the full request/response format and timeout behavior.
|
|
87
98
|
*/
|
|
88
99
|
dynamic_variables_webhook_url?: string;
|
|
89
100
|
enabled_features?: Array<AssistantsAPI.EnabledFeatures>;
|
|
101
|
+
external_llm?: UpdateAssistant.ExternalLlm;
|
|
102
|
+
fallback_config?: UpdateAssistant.FallbackConfig;
|
|
90
103
|
/**
|
|
91
104
|
* Text that the assistant will use to start the conversation. This may be
|
|
92
105
|
* templated with
|
|
@@ -103,37 +116,291 @@ export interface UpdateAssistant {
|
|
|
103
116
|
*/
|
|
104
117
|
instructions?: string;
|
|
105
118
|
/**
|
|
106
|
-
*
|
|
107
|
-
*
|
|
119
|
+
* Connected integrations attached to the assistant. The catalog of available
|
|
120
|
+
* integrations is at `/ai/integrations`; the user's connected integrations are at
|
|
121
|
+
* `/ai/integrations/connections`. Each item references a catalog integration by
|
|
122
|
+
* `integration_id`.
|
|
123
|
+
*/
|
|
124
|
+
integrations?: Array<UpdateAssistant.Integration>;
|
|
125
|
+
/**
|
|
126
|
+
* Settings for interruptions and how the assistant decides the user has finished
|
|
127
|
+
* speaking. These timings are most relevant when using non turn-taking
|
|
128
|
+
* transcription models. For turn-taking models like `deepgram/flux`, end-of-turn
|
|
129
|
+
* behavior is controlled by the transcription end-of-turn settings under
|
|
130
|
+
* `transcription.settings` (`eot_threshold`, `eot_timeout_ms`,
|
|
131
|
+
* `eager_eot_threshold`).
|
|
132
|
+
*/
|
|
133
|
+
interruption_settings?: UpdateAssistant.InterruptionSettings;
|
|
134
|
+
/**
|
|
135
|
+
* This is only needed when using third-party inference providers selected by
|
|
136
|
+
* `model`. The `identifier` for an integration secret
|
|
108
137
|
* [/v2/integration_secrets](https://developers.telnyx.com/api-reference/integration-secrets/create-a-secret)
|
|
109
|
-
* that refers to your LLM provider's API key.
|
|
110
|
-
*
|
|
138
|
+
* that refers to your LLM provider's API key. For bring-your-own endpoint
|
|
139
|
+
* authentication, use `external_llm.llm_api_key_ref` instead. Warning: Free plans
|
|
140
|
+
* are unlikely to work with this integration.
|
|
111
141
|
*/
|
|
112
142
|
llm_api_key_ref?: string;
|
|
143
|
+
/**
|
|
144
|
+
* MCP servers attached to the assistant. Create MCP servers with
|
|
145
|
+
* `/ai/mcp_servers`, then reference them by `id` here.
|
|
146
|
+
*/
|
|
147
|
+
mcp_servers?: Array<UpdateAssistant.McpServer>;
|
|
113
148
|
messaging_settings?: AssistantsAPI.MessagingSettings;
|
|
114
149
|
/**
|
|
115
|
-
* ID of the model to use. You can use the
|
|
150
|
+
* ID of the model to use when `external_llm` is not set. You can use the
|
|
116
151
|
* [Get models API](https://developers.telnyx.com/api-reference/chat/get-available-models)
|
|
117
|
-
* to see
|
|
152
|
+
* to see available models. If `external_llm` is provided, the assistant uses
|
|
153
|
+
* `external_llm` instead of this field. If neither `model` nor `external_llm` is
|
|
154
|
+
* provided, Telnyx applies the default model.
|
|
118
155
|
*/
|
|
119
156
|
model?: string;
|
|
120
157
|
name?: string;
|
|
121
158
|
observability_settings?: AssistantsAPI.ObservabilityReq;
|
|
159
|
+
/**
|
|
160
|
+
* Configuration for post-conversation processing. When enabled, the assistant
|
|
161
|
+
* receives one additional LLM turn after the conversation ends, allowing it to
|
|
162
|
+
* execute tool calls such as logging to a CRM or sending a summary. The assistant
|
|
163
|
+
* can execute multiple parallel or sequential tools during this phase.
|
|
164
|
+
* Telephony-control tools (e.g. hangup, transfer) are unavailable
|
|
165
|
+
* post-conversation. Beta feature.
|
|
166
|
+
*/
|
|
167
|
+
post_conversation_settings?: UpdateAssistant.PostConversationSettings;
|
|
122
168
|
privacy_settings?: AssistantsAPI.PrivacySettings;
|
|
169
|
+
/**
|
|
170
|
+
* Tags associated with the assistant. Tags can also be managed with the assistant
|
|
171
|
+
* tag endpoints.
|
|
172
|
+
*/
|
|
173
|
+
tags?: Array<string>;
|
|
123
174
|
telephony_settings?: AssistantsAPI.TelephonySettings;
|
|
175
|
+
/**
|
|
176
|
+
* IDs of shared tools to attach to the assistant. New integrations should prefer
|
|
177
|
+
* `tool_ids` over inline `tools`.
|
|
178
|
+
*/
|
|
124
179
|
tool_ids?: Array<string>;
|
|
125
180
|
/**
|
|
126
|
-
*
|
|
127
|
-
*
|
|
181
|
+
* Deprecated for new integrations. Inline tool definitions available to the
|
|
182
|
+
* assistant. Prefer `tool_ids` to attach shared tools created with the AI Tools
|
|
183
|
+
* endpoints.
|
|
128
184
|
*/
|
|
129
185
|
tools?: Array<AssistantsAPI.AssistantTool>;
|
|
130
186
|
transcription?: AssistantsAPI.TranscriptionSettings;
|
|
187
|
+
/**
|
|
188
|
+
* Human-readable name for the assistant version.
|
|
189
|
+
*/
|
|
190
|
+
version_name?: string;
|
|
131
191
|
voice_settings?: AssistantsAPI.VoiceSettings;
|
|
132
192
|
/**
|
|
133
193
|
* Configuration settings for the assistant's web widget.
|
|
134
194
|
*/
|
|
135
195
|
widget_settings?: AssistantsAPI.WidgetSettings;
|
|
136
196
|
}
|
|
197
|
+
export declare namespace UpdateAssistant {
|
|
198
|
+
interface ExternalLlm {
|
|
199
|
+
/**
|
|
200
|
+
* Base URL for the external LLM endpoint.
|
|
201
|
+
*/
|
|
202
|
+
base_url: string;
|
|
203
|
+
/**
|
|
204
|
+
* Model identifier to use with the external LLM endpoint.
|
|
205
|
+
*/
|
|
206
|
+
model: string;
|
|
207
|
+
/**
|
|
208
|
+
* Authentication method used when connecting to the external LLM endpoint.
|
|
209
|
+
*/
|
|
210
|
+
authentication_method?: 'token' | 'certificate';
|
|
211
|
+
/**
|
|
212
|
+
* Integration secret identifier for the client certificate used with certificate
|
|
213
|
+
* authentication.
|
|
214
|
+
*/
|
|
215
|
+
certificate_ref?: string;
|
|
216
|
+
/**
|
|
217
|
+
* When `true`, Telnyx forwards the assistant's dynamic variables to the external
|
|
218
|
+
* LLM endpoint as a top-level `extra_metadata` object on the chat completion
|
|
219
|
+
* request body. Defaults to `false`. Example payload sent to the external
|
|
220
|
+
* endpoint:
|
|
221
|
+
* `{"extra_metadata": {"customer_name": "Jane", "account_id": "acct_789", "telnyx_agent_target": "+13125550100", "telnyx_end_user_target": "+13125550123"}}`.
|
|
222
|
+
* Distinct from OpenAI's native `metadata` field, which has its own size and type
|
|
223
|
+
* limits.
|
|
224
|
+
*/
|
|
225
|
+
forward_metadata?: boolean;
|
|
226
|
+
/**
|
|
227
|
+
* Integration secret identifier for the external LLM API key.
|
|
228
|
+
*/
|
|
229
|
+
llm_api_key_ref?: string;
|
|
230
|
+
/**
|
|
231
|
+
* URL used to retrieve an access token when certificate authentication is enabled.
|
|
232
|
+
*/
|
|
233
|
+
token_retrieval_url?: string;
|
|
234
|
+
}
|
|
235
|
+
interface FallbackConfig {
|
|
236
|
+
external_llm?: FallbackConfig.ExternalLlm;
|
|
237
|
+
/**
|
|
238
|
+
* Integration secret identifier for the fallback model API key.
|
|
239
|
+
*/
|
|
240
|
+
llm_api_key_ref?: string;
|
|
241
|
+
/**
|
|
242
|
+
* Fallback Telnyx-hosted model to use when the primary LLM provider is
|
|
243
|
+
* unavailable.
|
|
244
|
+
*/
|
|
245
|
+
model?: string;
|
|
246
|
+
}
|
|
247
|
+
namespace FallbackConfig {
|
|
248
|
+
interface ExternalLlm {
|
|
249
|
+
/**
|
|
250
|
+
* Base URL for the external LLM endpoint.
|
|
251
|
+
*/
|
|
252
|
+
base_url: string;
|
|
253
|
+
/**
|
|
254
|
+
* Model identifier to use with the external LLM endpoint.
|
|
255
|
+
*/
|
|
256
|
+
model: string;
|
|
257
|
+
/**
|
|
258
|
+
* Authentication method used when connecting to the external LLM endpoint.
|
|
259
|
+
*/
|
|
260
|
+
authentication_method?: 'token' | 'certificate';
|
|
261
|
+
/**
|
|
262
|
+
* Integration secret identifier for the client certificate used with certificate
|
|
263
|
+
* authentication.
|
|
264
|
+
*/
|
|
265
|
+
certificate_ref?: string;
|
|
266
|
+
/**
|
|
267
|
+
* When `true`, Telnyx forwards the assistant's dynamic variables to the external
|
|
268
|
+
* LLM endpoint as a top-level `extra_metadata` object on the chat completion
|
|
269
|
+
* request body. Defaults to `false`. Example payload sent to the external
|
|
270
|
+
* endpoint:
|
|
271
|
+
* `{"extra_metadata": {"customer_name": "Jane", "account_id": "acct_789", "telnyx_agent_target": "+13125550100", "telnyx_end_user_target": "+13125550123"}}`.
|
|
272
|
+
* Distinct from OpenAI's native `metadata` field, which has its own size and type
|
|
273
|
+
* limits.
|
|
274
|
+
*/
|
|
275
|
+
forward_metadata?: boolean;
|
|
276
|
+
/**
|
|
277
|
+
* Integration secret identifier for the external LLM API key.
|
|
278
|
+
*/
|
|
279
|
+
llm_api_key_ref?: string;
|
|
280
|
+
/**
|
|
281
|
+
* URL used to retrieve an access token when certificate authentication is enabled.
|
|
282
|
+
*/
|
|
283
|
+
token_retrieval_url?: string;
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* Reference to a connected integration attached to an assistant. Discover
|
|
288
|
+
* available integrations with `/ai/integrations` and connected integrations with
|
|
289
|
+
* `/ai/integrations/connections`.
|
|
290
|
+
*/
|
|
291
|
+
interface Integration {
|
|
292
|
+
/**
|
|
293
|
+
* Catalog integration ID to attach. This is the `id` from the integrations catalog
|
|
294
|
+
* at `/ai/integrations` (the same value also appears as `integration_id` on
|
|
295
|
+
* entries returned by `/ai/integrations/connections`). It is **not** the
|
|
296
|
+
* connection-level `id` from `/ai/integrations/connections`.
|
|
297
|
+
*/
|
|
298
|
+
integration_id: string;
|
|
299
|
+
/**
|
|
300
|
+
* Optional per-assistant allowlist of integration tool names. When omitted or
|
|
301
|
+
* empty, all tools allowed by the connected integration are available to the
|
|
302
|
+
* assistant.
|
|
303
|
+
*/
|
|
304
|
+
allowed_list?: Array<string>;
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* Settings for interruptions and how the assistant decides the user has finished
|
|
308
|
+
* speaking. These timings are most relevant when using non turn-taking
|
|
309
|
+
* transcription models. For turn-taking models like `deepgram/flux`, end-of-turn
|
|
310
|
+
* behavior is controlled by the transcription end-of-turn settings under
|
|
311
|
+
* `transcription.settings` (`eot_threshold`, `eot_timeout_ms`,
|
|
312
|
+
* `eager_eot_threshold`).
|
|
313
|
+
*/
|
|
314
|
+
interface InterruptionSettings {
|
|
315
|
+
/**
|
|
316
|
+
* Whether users can interrupt the assistant while it is speaking.
|
|
317
|
+
*/
|
|
318
|
+
enable?: boolean;
|
|
319
|
+
/**
|
|
320
|
+
* Controls when the assistant starts speaking after the user stops. These
|
|
321
|
+
* thresholds primarily apply to non turn-taking transcription models. For
|
|
322
|
+
* turn-taking models like `deepgram/flux`, end-of-turn detection is driven by the
|
|
323
|
+
* transcription end-of-turn settings under `transcription.settings` instead.
|
|
324
|
+
*/
|
|
325
|
+
start_speaking_plan?: InterruptionSettings.StartSpeakingPlan;
|
|
326
|
+
}
|
|
327
|
+
namespace InterruptionSettings {
|
|
328
|
+
/**
|
|
329
|
+
* Controls when the assistant starts speaking after the user stops. These
|
|
330
|
+
* thresholds primarily apply to non turn-taking transcription models. For
|
|
331
|
+
* turn-taking models like `deepgram/flux`, end-of-turn detection is driven by the
|
|
332
|
+
* transcription end-of-turn settings under `transcription.settings` instead.
|
|
333
|
+
*/
|
|
334
|
+
interface StartSpeakingPlan {
|
|
335
|
+
/**
|
|
336
|
+
* Endpointing thresholds used to decide when the user has finished speaking.
|
|
337
|
+
* Applies to non turn-taking transcription models. For `deepgram/flux`, use
|
|
338
|
+
* `transcription.settings.eot_threshold` / `eot_timeout_ms` /
|
|
339
|
+
* `eager_eot_threshold`.
|
|
340
|
+
*/
|
|
341
|
+
transcription_endpointing_plan?: StartSpeakingPlan.TranscriptionEndpointingPlan;
|
|
342
|
+
/**
|
|
343
|
+
* Minimum seconds to wait before the assistant starts speaking.
|
|
344
|
+
*/
|
|
345
|
+
wait_seconds?: number;
|
|
346
|
+
}
|
|
347
|
+
namespace StartSpeakingPlan {
|
|
348
|
+
/**
|
|
349
|
+
* Endpointing thresholds used to decide when the user has finished speaking.
|
|
350
|
+
* Applies to non turn-taking transcription models. For `deepgram/flux`, use
|
|
351
|
+
* `transcription.settings.eot_threshold` / `eot_timeout_ms` /
|
|
352
|
+
* `eager_eot_threshold`.
|
|
353
|
+
*/
|
|
354
|
+
interface TranscriptionEndpointingPlan {
|
|
355
|
+
/**
|
|
356
|
+
* Seconds to wait after the transcript ends without punctuation.
|
|
357
|
+
*/
|
|
358
|
+
on_no_punctuation_seconds?: number;
|
|
359
|
+
/**
|
|
360
|
+
* Seconds to wait after the transcript ends with a number.
|
|
361
|
+
*/
|
|
362
|
+
on_number_seconds?: number;
|
|
363
|
+
/**
|
|
364
|
+
* Seconds to wait after the transcript ends with punctuation.
|
|
365
|
+
*/
|
|
366
|
+
on_punctuation_seconds?: number;
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
/**
|
|
371
|
+
* Reference to an MCP server attached to an assistant. Create and manage MCP
|
|
372
|
+
* servers with the `/ai/mcp_servers` endpoints, then attach them to assistants by
|
|
373
|
+
* ID.
|
|
374
|
+
*/
|
|
375
|
+
interface McpServer {
|
|
376
|
+
/**
|
|
377
|
+
* ID of the MCP server to attach. This must be the `id` of an MCP server returned
|
|
378
|
+
* by the `/ai/mcp_servers` endpoints.
|
|
379
|
+
*/
|
|
380
|
+
id: string;
|
|
381
|
+
/**
|
|
382
|
+
* Optional per-assistant allowlist of MCP tool names. When omitted, the assistant
|
|
383
|
+
* uses the MCP server's configured `allowed_tools`.
|
|
384
|
+
*/
|
|
385
|
+
allowed_tools?: Array<string>;
|
|
386
|
+
}
|
|
387
|
+
/**
|
|
388
|
+
* Configuration for post-conversation processing. When enabled, the assistant
|
|
389
|
+
* receives one additional LLM turn after the conversation ends, allowing it to
|
|
390
|
+
* execute tool calls such as logging to a CRM or sending a summary. The assistant
|
|
391
|
+
* can execute multiple parallel or sequential tools during this phase.
|
|
392
|
+
* Telephony-control tools (e.g. hangup, transfer) are unavailable
|
|
393
|
+
* post-conversation. Beta feature.
|
|
394
|
+
*/
|
|
395
|
+
interface PostConversationSettings {
|
|
396
|
+
/**
|
|
397
|
+
* Whether post-conversation processing is enabled. When true, the assistant will
|
|
398
|
+
* be invoked after the conversation ends to perform any final tool calls. Defaults
|
|
399
|
+
* to false.
|
|
400
|
+
*/
|
|
401
|
+
enabled?: boolean;
|
|
402
|
+
}
|
|
403
|
+
}
|
|
137
404
|
export interface VersionRetrieveParams {
|
|
138
405
|
/**
|
|
139
406
|
* Path param
|
|
@@ -160,16 +427,35 @@ export interface VersionUpdateParams {
|
|
|
160
427
|
[key: string]: unknown;
|
|
161
428
|
};
|
|
162
429
|
/**
|
|
163
|
-
* Body param:
|
|
164
|
-
*
|
|
165
|
-
*
|
|
166
|
-
*
|
|
430
|
+
* Body param: Timeout in milliseconds for the dynamic variables webhook. Must be
|
|
431
|
+
* between 1 and 10000 ms. If the webhook does not respond within this timeout, the
|
|
432
|
+
* call proceeds with default values. See the
|
|
433
|
+
* [dynamic variables guide](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables).
|
|
434
|
+
*/
|
|
435
|
+
dynamic_variables_webhook_timeout_ms?: number;
|
|
436
|
+
/**
|
|
437
|
+
* Body param: If `dynamic_variables_webhook_url` is set, Telnyx sends a POST
|
|
438
|
+
* request to this URL at the start of the conversation to resolve dynamic
|
|
439
|
+
* variables. **Gotcha:** the webhook response must wrap variables under a
|
|
440
|
+
* top-level `dynamic_variables` object, e.g.
|
|
441
|
+
* `{"dynamic_variables": {"customer_name": "Jane"}}`. Returning a flat object will
|
|
442
|
+
* be ignored and variables will fall back to their defaults. See the
|
|
443
|
+
* [dynamic variables guide](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables)
|
|
444
|
+
* for the full request/response format and timeout behavior.
|
|
167
445
|
*/
|
|
168
446
|
dynamic_variables_webhook_url?: string;
|
|
169
447
|
/**
|
|
170
448
|
* Body param
|
|
171
449
|
*/
|
|
172
450
|
enabled_features?: Array<AssistantsAPI.EnabledFeatures>;
|
|
451
|
+
/**
|
|
452
|
+
* Body param
|
|
453
|
+
*/
|
|
454
|
+
external_llm?: VersionUpdateParams.ExternalLlm;
|
|
455
|
+
/**
|
|
456
|
+
* Body param
|
|
457
|
+
*/
|
|
458
|
+
fallback_config?: VersionUpdateParams.FallbackConfig;
|
|
173
459
|
/**
|
|
174
460
|
* Body param: Text that the assistant will use to start the conversation. This may
|
|
175
461
|
* be templated with
|
|
@@ -189,21 +475,46 @@ export interface VersionUpdateParams {
|
|
|
189
475
|
*/
|
|
190
476
|
instructions?: string;
|
|
191
477
|
/**
|
|
192
|
-
* Body param:
|
|
193
|
-
*
|
|
478
|
+
* Body param: Connected integrations attached to the assistant. The catalog of
|
|
479
|
+
* available integrations is at `/ai/integrations`; the user's connected
|
|
480
|
+
* integrations are at `/ai/integrations/connections`. Each item references a
|
|
481
|
+
* catalog integration by `integration_id`.
|
|
482
|
+
*/
|
|
483
|
+
integrations?: Array<VersionUpdateParams.Integration>;
|
|
484
|
+
/**
|
|
485
|
+
* Body param: Settings for interruptions and how the assistant decides the user
|
|
486
|
+
* has finished speaking. These timings are most relevant when using non
|
|
487
|
+
* turn-taking transcription models. For turn-taking models like `deepgram/flux`,
|
|
488
|
+
* end-of-turn behavior is controlled by the transcription end-of-turn settings
|
|
489
|
+
* under `transcription.settings` (`eot_threshold`, `eot_timeout_ms`,
|
|
490
|
+
* `eager_eot_threshold`).
|
|
491
|
+
*/
|
|
492
|
+
interruption_settings?: VersionUpdateParams.InterruptionSettings;
|
|
493
|
+
/**
|
|
494
|
+
* Body param: This is only needed when using third-party inference providers
|
|
495
|
+
* selected by `model`. The `identifier` for an integration secret
|
|
194
496
|
* [/v2/integration_secrets](https://developers.telnyx.com/api-reference/integration-secrets/create-a-secret)
|
|
195
|
-
* that refers to your LLM provider's API key.
|
|
196
|
-
*
|
|
497
|
+
* that refers to your LLM provider's API key. For bring-your-own endpoint
|
|
498
|
+
* authentication, use `external_llm.llm_api_key_ref` instead. Warning: Free plans
|
|
499
|
+
* are unlikely to work with this integration.
|
|
197
500
|
*/
|
|
198
501
|
llm_api_key_ref?: string;
|
|
502
|
+
/**
|
|
503
|
+
* Body param: MCP servers attached to the assistant. Create MCP servers with
|
|
504
|
+
* `/ai/mcp_servers`, then reference them by `id` here.
|
|
505
|
+
*/
|
|
506
|
+
mcp_servers?: Array<VersionUpdateParams.McpServer>;
|
|
199
507
|
/**
|
|
200
508
|
* Body param
|
|
201
509
|
*/
|
|
202
510
|
messaging_settings?: AssistantsAPI.MessagingSettings;
|
|
203
511
|
/**
|
|
204
|
-
* Body param: ID of the model to use. You can use
|
|
512
|
+
* Body param: ID of the model to use when `external_llm` is not set. You can use
|
|
513
|
+
* the
|
|
205
514
|
* [Get models API](https://developers.telnyx.com/api-reference/chat/get-available-models)
|
|
206
|
-
* to see
|
|
515
|
+
* to see available models. If `external_llm` is provided, the assistant uses
|
|
516
|
+
* `external_llm` instead of this field. If neither `model` nor `external_llm` is
|
|
517
|
+
* provided, Telnyx applies the default model.
|
|
207
518
|
*/
|
|
208
519
|
model?: string;
|
|
209
520
|
/**
|
|
@@ -214,27 +525,47 @@ export interface VersionUpdateParams {
|
|
|
214
525
|
* Body param
|
|
215
526
|
*/
|
|
216
527
|
observability_settings?: AssistantsAPI.ObservabilityReq;
|
|
528
|
+
/**
|
|
529
|
+
* Body param: Configuration for post-conversation processing. When enabled, the
|
|
530
|
+
* assistant receives one additional LLM turn after the conversation ends, allowing
|
|
531
|
+
* it to execute tool calls such as logging to a CRM or sending a summary. The
|
|
532
|
+
* assistant can execute multiple parallel or sequential tools during this phase.
|
|
533
|
+
* Telephony-control tools (e.g. hangup, transfer) are unavailable
|
|
534
|
+
* post-conversation. Beta feature.
|
|
535
|
+
*/
|
|
536
|
+
post_conversation_settings?: VersionUpdateParams.PostConversationSettings;
|
|
217
537
|
/**
|
|
218
538
|
* Body param
|
|
219
539
|
*/
|
|
220
540
|
privacy_settings?: AssistantsAPI.PrivacySettings;
|
|
541
|
+
/**
|
|
542
|
+
* Body param: Tags associated with the assistant. Tags can also be managed with
|
|
543
|
+
* the assistant tag endpoints.
|
|
544
|
+
*/
|
|
545
|
+
tags?: Array<string>;
|
|
221
546
|
/**
|
|
222
547
|
* Body param
|
|
223
548
|
*/
|
|
224
549
|
telephony_settings?: AssistantsAPI.TelephonySettings;
|
|
225
550
|
/**
|
|
226
|
-
* Body param
|
|
551
|
+
* Body param: IDs of shared tools to attach to the assistant. New integrations
|
|
552
|
+
* should prefer `tool_ids` over inline `tools`.
|
|
227
553
|
*/
|
|
228
554
|
tool_ids?: Array<string>;
|
|
229
555
|
/**
|
|
230
|
-
* Body param:
|
|
231
|
-
*
|
|
556
|
+
* Body param: Deprecated for new integrations. Inline tool definitions available
|
|
557
|
+
* to the assistant. Prefer `tool_ids` to attach shared tools created with the AI
|
|
558
|
+
* Tools endpoints.
|
|
232
559
|
*/
|
|
233
560
|
tools?: Array<AssistantsAPI.AssistantTool>;
|
|
234
561
|
/**
|
|
235
562
|
* Body param
|
|
236
563
|
*/
|
|
237
564
|
transcription?: AssistantsAPI.TranscriptionSettings;
|
|
565
|
+
/**
|
|
566
|
+
* Body param: Human-readable name for the assistant version.
|
|
567
|
+
*/
|
|
568
|
+
version_name?: string;
|
|
238
569
|
/**
|
|
239
570
|
* Body param
|
|
240
571
|
*/
|
|
@@ -244,6 +575,213 @@ export interface VersionUpdateParams {
|
|
|
244
575
|
*/
|
|
245
576
|
widget_settings?: AssistantsAPI.WidgetSettings;
|
|
246
577
|
}
|
|
578
|
+
export declare namespace VersionUpdateParams {
|
|
579
|
+
interface ExternalLlm {
|
|
580
|
+
/**
|
|
581
|
+
* Base URL for the external LLM endpoint.
|
|
582
|
+
*/
|
|
583
|
+
base_url: string;
|
|
584
|
+
/**
|
|
585
|
+
* Model identifier to use with the external LLM endpoint.
|
|
586
|
+
*/
|
|
587
|
+
model: string;
|
|
588
|
+
/**
|
|
589
|
+
* Authentication method used when connecting to the external LLM endpoint.
|
|
590
|
+
*/
|
|
591
|
+
authentication_method?: 'token' | 'certificate';
|
|
592
|
+
/**
|
|
593
|
+
* Integration secret identifier for the client certificate used with certificate
|
|
594
|
+
* authentication.
|
|
595
|
+
*/
|
|
596
|
+
certificate_ref?: string;
|
|
597
|
+
/**
|
|
598
|
+
* When `true`, Telnyx forwards the assistant's dynamic variables to the external
|
|
599
|
+
* LLM endpoint as a top-level `extra_metadata` object on the chat completion
|
|
600
|
+
* request body. Defaults to `false`. Example payload sent to the external
|
|
601
|
+
* endpoint:
|
|
602
|
+
* `{"extra_metadata": {"customer_name": "Jane", "account_id": "acct_789", "telnyx_agent_target": "+13125550100", "telnyx_end_user_target": "+13125550123"}}`.
|
|
603
|
+
* Distinct from OpenAI's native `metadata` field, which has its own size and type
|
|
604
|
+
* limits.
|
|
605
|
+
*/
|
|
606
|
+
forward_metadata?: boolean;
|
|
607
|
+
/**
|
|
608
|
+
* Integration secret identifier for the external LLM API key.
|
|
609
|
+
*/
|
|
610
|
+
llm_api_key_ref?: string;
|
|
611
|
+
/**
|
|
612
|
+
* URL used to retrieve an access token when certificate authentication is enabled.
|
|
613
|
+
*/
|
|
614
|
+
token_retrieval_url?: string;
|
|
615
|
+
}
|
|
616
|
+
interface FallbackConfig {
|
|
617
|
+
external_llm?: FallbackConfig.ExternalLlm;
|
|
618
|
+
/**
|
|
619
|
+
* Integration secret identifier for the fallback model API key.
|
|
620
|
+
*/
|
|
621
|
+
llm_api_key_ref?: string;
|
|
622
|
+
/**
|
|
623
|
+
* Fallback Telnyx-hosted model to use when the primary LLM provider is
|
|
624
|
+
* unavailable.
|
|
625
|
+
*/
|
|
626
|
+
model?: string;
|
|
627
|
+
}
|
|
628
|
+
namespace FallbackConfig {
|
|
629
|
+
interface ExternalLlm {
|
|
630
|
+
/**
|
|
631
|
+
* Base URL for the external LLM endpoint.
|
|
632
|
+
*/
|
|
633
|
+
base_url: string;
|
|
634
|
+
/**
|
|
635
|
+
* Model identifier to use with the external LLM endpoint.
|
|
636
|
+
*/
|
|
637
|
+
model: string;
|
|
638
|
+
/**
|
|
639
|
+
* Authentication method used when connecting to the external LLM endpoint.
|
|
640
|
+
*/
|
|
641
|
+
authentication_method?: 'token' | 'certificate';
|
|
642
|
+
/**
|
|
643
|
+
* Integration secret identifier for the client certificate used with certificate
|
|
644
|
+
* authentication.
|
|
645
|
+
*/
|
|
646
|
+
certificate_ref?: string;
|
|
647
|
+
/**
|
|
648
|
+
* When `true`, Telnyx forwards the assistant's dynamic variables to the external
|
|
649
|
+
* LLM endpoint as a top-level `extra_metadata` object on the chat completion
|
|
650
|
+
* request body. Defaults to `false`. Example payload sent to the external
|
|
651
|
+
* endpoint:
|
|
652
|
+
* `{"extra_metadata": {"customer_name": "Jane", "account_id": "acct_789", "telnyx_agent_target": "+13125550100", "telnyx_end_user_target": "+13125550123"}}`.
|
|
653
|
+
* Distinct from OpenAI's native `metadata` field, which has its own size and type
|
|
654
|
+
* limits.
|
|
655
|
+
*/
|
|
656
|
+
forward_metadata?: boolean;
|
|
657
|
+
/**
|
|
658
|
+
* Integration secret identifier for the external LLM API key.
|
|
659
|
+
*/
|
|
660
|
+
llm_api_key_ref?: string;
|
|
661
|
+
/**
|
|
662
|
+
* URL used to retrieve an access token when certificate authentication is enabled.
|
|
663
|
+
*/
|
|
664
|
+
token_retrieval_url?: string;
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
/**
|
|
668
|
+
* Reference to a connected integration attached to an assistant. Discover
|
|
669
|
+
* available integrations with `/ai/integrations` and connected integrations with
|
|
670
|
+
* `/ai/integrations/connections`.
|
|
671
|
+
*/
|
|
672
|
+
interface Integration {
|
|
673
|
+
/**
|
|
674
|
+
* Catalog integration ID to attach. This is the `id` from the integrations catalog
|
|
675
|
+
* at `/ai/integrations` (the same value also appears as `integration_id` on
|
|
676
|
+
* entries returned by `/ai/integrations/connections`). It is **not** the
|
|
677
|
+
* connection-level `id` from `/ai/integrations/connections`.
|
|
678
|
+
*/
|
|
679
|
+
integration_id: string;
|
|
680
|
+
/**
|
|
681
|
+
* Optional per-assistant allowlist of integration tool names. When omitted or
|
|
682
|
+
* empty, all tools allowed by the connected integration are available to the
|
|
683
|
+
* assistant.
|
|
684
|
+
*/
|
|
685
|
+
allowed_list?: Array<string>;
|
|
686
|
+
}
|
|
687
|
+
/**
|
|
688
|
+
* Settings for interruptions and how the assistant decides the user has finished
|
|
689
|
+
* speaking. These timings are most relevant when using non turn-taking
|
|
690
|
+
* transcription models. For turn-taking models like `deepgram/flux`, end-of-turn
|
|
691
|
+
* behavior is controlled by the transcription end-of-turn settings under
|
|
692
|
+
* `transcription.settings` (`eot_threshold`, `eot_timeout_ms`,
|
|
693
|
+
* `eager_eot_threshold`).
|
|
694
|
+
*/
|
|
695
|
+
interface InterruptionSettings {
|
|
696
|
+
/**
|
|
697
|
+
* Whether users can interrupt the assistant while it is speaking.
|
|
698
|
+
*/
|
|
699
|
+
enable?: boolean;
|
|
700
|
+
/**
|
|
701
|
+
* Controls when the assistant starts speaking after the user stops. These
|
|
702
|
+
* thresholds primarily apply to non turn-taking transcription models. For
|
|
703
|
+
* turn-taking models like `deepgram/flux`, end-of-turn detection is driven by the
|
|
704
|
+
* transcription end-of-turn settings under `transcription.settings` instead.
|
|
705
|
+
*/
|
|
706
|
+
start_speaking_plan?: InterruptionSettings.StartSpeakingPlan;
|
|
707
|
+
}
|
|
708
|
+
namespace InterruptionSettings {
|
|
709
|
+
/**
|
|
710
|
+
* Controls when the assistant starts speaking after the user stops. These
|
|
711
|
+
* thresholds primarily apply to non turn-taking transcription models. For
|
|
712
|
+
* turn-taking models like `deepgram/flux`, end-of-turn detection is driven by the
|
|
713
|
+
* transcription end-of-turn settings under `transcription.settings` instead.
|
|
714
|
+
*/
|
|
715
|
+
interface StartSpeakingPlan {
|
|
716
|
+
/**
|
|
717
|
+
* Endpointing thresholds used to decide when the user has finished speaking.
|
|
718
|
+
* Applies to non turn-taking transcription models. For `deepgram/flux`, use
|
|
719
|
+
* `transcription.settings.eot_threshold` / `eot_timeout_ms` /
|
|
720
|
+
* `eager_eot_threshold`.
|
|
721
|
+
*/
|
|
722
|
+
transcription_endpointing_plan?: StartSpeakingPlan.TranscriptionEndpointingPlan;
|
|
723
|
+
/**
|
|
724
|
+
* Minimum seconds to wait before the assistant starts speaking.
|
|
725
|
+
*/
|
|
726
|
+
wait_seconds?: number;
|
|
727
|
+
}
|
|
728
|
+
namespace StartSpeakingPlan {
|
|
729
|
+
/**
|
|
730
|
+
* Endpointing thresholds used to decide when the user has finished speaking.
|
|
731
|
+
* Applies to non turn-taking transcription models. For `deepgram/flux`, use
|
|
732
|
+
* `transcription.settings.eot_threshold` / `eot_timeout_ms` /
|
|
733
|
+
* `eager_eot_threshold`.
|
|
734
|
+
*/
|
|
735
|
+
interface TranscriptionEndpointingPlan {
|
|
736
|
+
/**
|
|
737
|
+
* Seconds to wait after the transcript ends without punctuation.
|
|
738
|
+
*/
|
|
739
|
+
on_no_punctuation_seconds?: number;
|
|
740
|
+
/**
|
|
741
|
+
* Seconds to wait after the transcript ends with a number.
|
|
742
|
+
*/
|
|
743
|
+
on_number_seconds?: number;
|
|
744
|
+
/**
|
|
745
|
+
* Seconds to wait after the transcript ends with punctuation.
|
|
746
|
+
*/
|
|
747
|
+
on_punctuation_seconds?: number;
|
|
748
|
+
}
|
|
749
|
+
}
|
|
750
|
+
}
|
|
751
|
+
/**
|
|
752
|
+
* Reference to an MCP server attached to an assistant. Create and manage MCP
|
|
753
|
+
* servers with the `/ai/mcp_servers` endpoints, then attach them to assistants by
|
|
754
|
+
* ID.
|
|
755
|
+
*/
|
|
756
|
+
interface McpServer {
|
|
757
|
+
/**
|
|
758
|
+
* ID of the MCP server to attach. This must be the `id` of an MCP server returned
|
|
759
|
+
* by the `/ai/mcp_servers` endpoints.
|
|
760
|
+
*/
|
|
761
|
+
id: string;
|
|
762
|
+
/**
|
|
763
|
+
* Optional per-assistant allowlist of MCP tool names. When omitted, the assistant
|
|
764
|
+
* uses the MCP server's configured `allowed_tools`.
|
|
765
|
+
*/
|
|
766
|
+
allowed_tools?: Array<string>;
|
|
767
|
+
}
|
|
768
|
+
/**
|
|
769
|
+
* Configuration for post-conversation processing. When enabled, the assistant
|
|
770
|
+
* receives one additional LLM turn after the conversation ends, allowing it to
|
|
771
|
+
* execute tool calls such as logging to a CRM or sending a summary. The assistant
|
|
772
|
+
* can execute multiple parallel or sequential tools during this phase.
|
|
773
|
+
* Telephony-control tools (e.g. hangup, transfer) are unavailable
|
|
774
|
+
* post-conversation. Beta feature.
|
|
775
|
+
*/
|
|
776
|
+
interface PostConversationSettings {
|
|
777
|
+
/**
|
|
778
|
+
* Whether post-conversation processing is enabled. When true, the assistant will
|
|
779
|
+
* be invoked after the conversation ends to perform any final tool calls. Defaults
|
|
780
|
+
* to false.
|
|
781
|
+
*/
|
|
782
|
+
enabled?: boolean;
|
|
783
|
+
}
|
|
784
|
+
}
|
|
247
785
|
export interface VersionDeleteParams {
|
|
248
786
|
assistant_id: string;
|
|
249
787
|
}
|