telnyx 7.24.0 → 7.25.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 +7 -0
- package/client.d.mts +19 -4
- package/client.d.mts.map +1 -1
- package/client.d.ts +19 -4
- package/client.d.ts.map +1 -1
- package/client.js +15 -0
- package/client.js.map +1 -1
- package/client.mjs +15 -0
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/ai/ai.d.mts +7 -6
- package/resources/ai/ai.d.mts.map +1 -1
- package/resources/ai/ai.d.ts +7 -6
- package/resources/ai/ai.d.ts.map +1 -1
- package/resources/ai/ai.js.map +1 -1
- package/resources/ai/ai.mjs.map +1 -1
- package/resources/ai/assistants/assistants.d.mts +320 -28
- package/resources/ai/assistants/assistants.d.mts.map +1 -1
- package/resources/ai/assistants/assistants.d.ts +320 -28
- package/resources/ai/assistants/assistants.d.ts.map +1 -1
- package/resources/ai/assistants/assistants.js +79 -2
- package/resources/ai/assistants/assistants.js.map +1 -1
- package/resources/ai/assistants/assistants.mjs +79 -2
- package/resources/ai/assistants/assistants.mjs.map +1 -1
- package/resources/ai/assistants/deleted.d.mts +60 -0
- package/resources/ai/assistants/deleted.d.mts.map +1 -0
- package/resources/ai/assistants/deleted.d.ts +60 -0
- package/resources/ai/assistants/deleted.d.ts.map +1 -0
- package/resources/ai/assistants/deleted.js +49 -0
- package/resources/ai/assistants/deleted.js.map +1 -0
- package/resources/ai/assistants/deleted.mjs +45 -0
- package/resources/ai/assistants/deleted.mjs.map +1 -0
- package/resources/ai/assistants/index.d.mts +2 -1
- package/resources/ai/assistants/index.d.mts.map +1 -1
- package/resources/ai/assistants/index.d.ts +2 -1
- package/resources/ai/assistants/index.d.ts.map +1 -1
- package/resources/ai/assistants/index.js +3 -1
- package/resources/ai/assistants/index.js.map +1 -1
- package/resources/ai/assistants/index.mjs +1 -0
- package/resources/ai/assistants/index.mjs.map +1 -1
- package/resources/ai/assistants/versions.d.mts +36 -0
- package/resources/ai/assistants/versions.d.mts.map +1 -1
- package/resources/ai/assistants/versions.d.ts +36 -0
- package/resources/ai/assistants/versions.d.ts.map +1 -1
- package/resources/ai/chat.d.mts +7 -2
- package/resources/ai/chat.d.mts.map +1 -1
- package/resources/ai/chat.d.ts +7 -2
- package/resources/ai/chat.d.ts.map +1 -1
- package/resources/ai/embeddings/embeddings.d.mts +1 -1
- package/resources/ai/embeddings/embeddings.d.ts +1 -1
- package/resources/ai/embeddings/embeddings.js +1 -1
- package/resources/ai/embeddings/embeddings.mjs +1 -1
- package/resources/ai/index.d.mts +2 -2
- package/resources/ai/index.d.mts.map +1 -1
- package/resources/ai/index.d.ts +2 -2
- package/resources/ai/index.d.ts.map +1 -1
- package/resources/ai/index.js.map +1 -1
- package/resources/ai/index.mjs.map +1 -1
- package/resources/ai/memory/index.d.mts +1 -1
- package/resources/ai/memory/index.d.mts.map +1 -1
- package/resources/ai/memory/index.d.ts +1 -1
- package/resources/ai/memory/index.d.ts.map +1 -1
- package/resources/ai/memory/index.js.map +1 -1
- package/resources/ai/memory/index.mjs +1 -1
- package/resources/ai/memory/index.mjs.map +1 -1
- package/resources/ai/memory/memory.d.mts +2 -2
- package/resources/ai/memory/memory.d.mts.map +1 -1
- package/resources/ai/memory/memory.d.ts +2 -2
- package/resources/ai/memory/memory.d.ts.map +1 -1
- package/resources/ai/memory/memory.js.map +1 -1
- package/resources/ai/memory/memory.mjs +1 -1
- package/resources/ai/memory/memory.mjs.map +1 -1
- package/resources/ai/memory/namespaces/index.d.mts +1 -1
- package/resources/ai/memory/namespaces/index.d.mts.map +1 -1
- package/resources/ai/memory/namespaces/index.d.ts +1 -1
- package/resources/ai/memory/namespaces/index.d.ts.map +1 -1
- package/resources/ai/memory/namespaces/index.js.map +1 -1
- package/resources/ai/memory/namespaces/index.mjs +1 -1
- package/resources/ai/memory/namespaces/index.mjs.map +1 -1
- package/resources/ai/memory/namespaces/namespaces.d.mts +60 -4
- package/resources/ai/memory/namespaces/namespaces.d.mts.map +1 -1
- package/resources/ai/memory/namespaces/namespaces.d.ts +60 -4
- package/resources/ai/memory/namespaces/namespaces.d.ts.map +1 -1
- package/resources/ai/memory/namespaces/namespaces.js +41 -3
- package/resources/ai/memory/namespaces/namespaces.js.map +1 -1
- package/resources/ai/memory/namespaces/namespaces.mjs +41 -3
- package/resources/ai/memory/namespaces/namespaces.mjs.map +1 -1
- package/resources/ai/openai/chat.d.mts +7 -2
- package/resources/ai/openai/chat.d.mts.map +1 -1
- package/resources/ai/openai/chat.d.ts +7 -2
- package/resources/ai/openai/chat.d.ts.map +1 -1
- package/resources/ai/tools.d.mts +3 -4
- package/resources/ai/tools.d.mts.map +1 -1
- package/resources/ai/tools.d.ts +3 -4
- package/resources/ai/tools.d.ts.map +1 -1
- package/resources/ai/tools.js +5 -2
- package/resources/ai/tools.js.map +1 -1
- package/resources/ai/tools.mjs +5 -2
- package/resources/ai/tools.mjs.map +1 -1
- package/resources/calls/actions.d.mts +76 -17
- package/resources/calls/actions.d.mts.map +1 -1
- package/resources/calls/actions.d.ts +76 -17
- package/resources/calls/actions.d.ts.map +1 -1
- package/resources/calls/actions.js +31 -0
- package/resources/calls/actions.js.map +1 -1
- package/resources/calls/actions.mjs +31 -0
- package/resources/calls/actions.mjs.map +1 -1
- package/resources/calls/calls.d.mts +48 -11
- package/resources/calls/calls.d.mts.map +1 -1
- package/resources/calls/calls.d.ts +48 -11
- package/resources/calls/calls.d.ts.map +1 -1
- package/resources/calls/calls.js +3 -0
- package/resources/calls/calls.js.map +1 -1
- package/resources/calls/calls.mjs +3 -0
- package/resources/calls/calls.mjs.map +1 -1
- package/resources/dir/dir.d.mts +220 -28
- package/resources/dir/dir.d.mts.map +1 -1
- package/resources/dir/dir.d.ts +220 -28
- package/resources/dir/dir.d.ts.map +1 -1
- package/resources/dir/dir.js +77 -13
- package/resources/dir/dir.js.map +1 -1
- package/resources/dir/dir.mjs +77 -13
- package/resources/dir/dir.mjs.map +1 -1
- package/resources/dir/index.d.mts +1 -1
- package/resources/dir/index.d.mts.map +1 -1
- package/resources/dir/index.d.ts +1 -1
- package/resources/dir/index.d.ts.map +1 -1
- package/resources/dir/index.js.map +1 -1
- package/resources/dir/index.mjs.map +1 -1
- package/resources/dir/phone-numbers.d.mts +8 -4
- package/resources/dir/phone-numbers.d.mts.map +1 -1
- package/resources/dir/phone-numbers.d.ts +8 -4
- package/resources/dir/phone-numbers.d.ts.map +1 -1
- package/resources/dir/phone-numbers.js +4 -4
- package/resources/dir/phone-numbers.mjs +4 -4
- package/resources/dir/references.d.mts +9 -6
- package/resources/dir/references.d.mts.map +1 -1
- package/resources/dir/references.d.ts +9 -6
- package/resources/dir/references.d.ts.map +1 -1
- package/resources/enterprises/dir.d.mts +17 -1
- package/resources/enterprises/dir.d.mts.map +1 -1
- package/resources/enterprises/dir.d.ts +17 -1
- package/resources/enterprises/dir.d.ts.map +1 -1
- package/resources/enterprises/enterprises.d.mts +237 -23
- package/resources/enterprises/enterprises.d.mts.map +1 -1
- package/resources/enterprises/enterprises.d.ts +237 -23
- package/resources/enterprises/enterprises.d.ts.map +1 -1
- package/resources/enterprises/enterprises.js +26 -4
- package/resources/enterprises/enterprises.js.map +1 -1
- package/resources/enterprises/enterprises.mjs +26 -4
- package/resources/enterprises/enterprises.mjs.map +1 -1
- package/resources/enterprises/index.d.mts +1 -0
- package/resources/enterprises/index.d.mts.map +1 -1
- package/resources/enterprises/index.d.ts +1 -0
- package/resources/enterprises/index.d.ts.map +1 -1
- package/resources/enterprises/index.js +3 -1
- package/resources/enterprises/index.js.map +1 -1
- package/resources/enterprises/index.mjs +1 -0
- package/resources/enterprises/index.mjs.map +1 -1
- package/resources/enterprises/reputation/loa.d.mts +61 -1
- package/resources/enterprises/reputation/loa.d.mts.map +1 -1
- package/resources/enterprises/reputation/loa.d.ts +61 -1
- package/resources/enterprises/reputation/loa.d.ts.map +1 -1
- package/resources/enterprises/verify-email.d.mts +91 -0
- package/resources/enterprises/verify-email.d.mts.map +1 -0
- package/resources/enterprises/verify-email.d.ts +91 -0
- package/resources/enterprises/verify-email.d.ts.map +1 -0
- package/resources/enterprises/verify-email.js +55 -0
- package/resources/enterprises/verify-email.js.map +1 -0
- package/resources/enterprises/verify-email.mjs +51 -0
- package/resources/enterprises/verify-email.mjs.map +1 -0
- package/resources/index.d.mts +4 -2
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +4 -2
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +7 -3
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +2 -0
- package/resources/index.mjs.map +1 -1
- package/resources/infringement-claims.d.mts +4 -0
- package/resources/infringement-claims.d.mts.map +1 -1
- package/resources/infringement-claims.d.ts +4 -0
- package/resources/infringement-claims.d.ts.map +1 -1
- package/resources/llm-token-gateway/index.d.mts +3 -0
- package/resources/llm-token-gateway/index.d.mts.map +1 -0
- package/resources/llm-token-gateway/index.d.ts +3 -0
- package/resources/llm-token-gateway/index.d.ts.map +1 -0
- package/resources/llm-token-gateway/index.js +9 -0
- package/resources/llm-token-gateway/index.js.map +1 -0
- package/resources/llm-token-gateway/index.mjs +4 -0
- package/resources/llm-token-gateway/index.mjs.map +1 -0
- package/resources/llm-token-gateway/llm-token-gateway.d.mts +10 -0
- package/resources/llm-token-gateway/llm-token-gateway.d.mts.map +1 -0
- package/resources/llm-token-gateway/llm-token-gateway.d.ts +10 -0
- package/resources/llm-token-gateway/llm-token-gateway.d.ts.map +1 -0
- package/resources/llm-token-gateway/llm-token-gateway.js +17 -0
- package/resources/llm-token-gateway/llm-token-gateway.js.map +1 -0
- package/resources/llm-token-gateway/llm-token-gateway.mjs +12 -0
- package/resources/llm-token-gateway/llm-token-gateway.mjs.map +1 -0
- package/resources/llm-token-gateway/usage.d.mts +260 -0
- package/resources/llm-token-gateway/usage.d.mts.map +1 -0
- package/resources/llm-token-gateway/usage.d.ts +260 -0
- package/resources/llm-token-gateway/usage.d.ts.map +1 -0
- package/resources/llm-token-gateway/usage.js +31 -0
- package/resources/llm-token-gateway/usage.js.map +1 -0
- package/resources/llm-token-gateway/usage.mjs +27 -0
- package/resources/llm-token-gateway/usage.mjs.map +1 -0
- package/resources/llm-token-gateway.d.mts +2 -0
- package/resources/llm-token-gateway.d.mts.map +1 -0
- package/resources/llm-token-gateway.d.ts +2 -0
- package/resources/llm-token-gateway.d.ts.map +1 -0
- package/resources/llm-token-gateway.js +6 -0
- package/resources/llm-token-gateway.js.map +1 -0
- package/resources/llm-token-gateway.mjs +3 -0
- package/resources/llm-token-gateway.mjs.map +1 -0
- package/resources/meeting-sessions/meeting-sessions.d.mts +8 -9
- package/resources/meeting-sessions/meeting-sessions.d.mts.map +1 -1
- package/resources/meeting-sessions/meeting-sessions.d.ts +8 -9
- package/resources/meeting-sessions/meeting-sessions.d.ts.map +1 -1
- package/resources/meeting-sessions/meeting-sessions.js +6 -6
- package/resources/meeting-sessions/meeting-sessions.js.map +1 -1
- package/resources/meeting-sessions/meeting-sessions.mjs +6 -6
- package/resources/meeting-sessions/meeting-sessions.mjs.map +1 -1
- package/resources/porting-orders/phone-number-blocks.d.mts +1 -1
- package/resources/porting-orders/phone-number-blocks.d.mts.map +1 -1
- package/resources/porting-orders/phone-number-blocks.d.ts +1 -1
- package/resources/porting-orders/phone-number-blocks.d.ts.map +1 -1
- package/resources/porting-orders/porting-orders.d.mts +1 -1
- package/resources/porting-orders/porting-orders.d.mts.map +1 -1
- package/resources/porting-orders/porting-orders.d.ts +1 -1
- package/resources/porting-orders/porting-orders.d.ts.map +1 -1
- package/resources/porting-orders/porting-orders.js.map +1 -1
- package/resources/porting-orders/porting-orders.mjs.map +1 -1
- package/resources/porting-phone-numbers.d.mts +1 -1
- package/resources/porting-phone-numbers.d.mts.map +1 -1
- package/resources/porting-phone-numbers.d.ts +1 -1
- package/resources/porting-phone-numbers.d.ts.map +1 -1
- package/resources/requirements.d.mts +2 -2
- package/resources/requirements.d.mts.map +1 -1
- package/resources/requirements.d.ts +2 -2
- package/resources/requirements.d.ts.map +1 -1
- package/resources/spend-limits.d.mts +335 -0
- package/resources/spend-limits.d.mts.map +1 -0
- package/resources/spend-limits.d.ts +335 -0
- package/resources/spend-limits.d.ts.map +1 -0
- package/resources/spend-limits.js +91 -0
- package/resources/spend-limits.js.map +1 -0
- package/resources/spend-limits.mjs +87 -0
- package/resources/spend-limits.mjs.map +1 -0
- package/resources/terms-of-service/agreements.d.mts +12 -0
- package/resources/terms-of-service/agreements.d.mts.map +1 -1
- package/resources/terms-of-service/agreements.d.ts +12 -0
- package/resources/terms-of-service/agreements.d.ts.map +1 -1
- package/resources/terms-of-service/terms-of-service.d.mts +15 -0
- package/resources/terms-of-service/terms-of-service.d.mts.map +1 -1
- package/resources/terms-of-service/terms-of-service.d.ts +15 -0
- package/resources/terms-of-service/terms-of-service.d.ts.map +1 -1
- package/resources/terms-of-service/terms-of-service.js.map +1 -1
- package/resources/terms-of-service/terms-of-service.mjs.map +1 -1
- package/resources/text-to-speech/text-to-speech.d.mts +4 -2
- package/resources/text-to-speech/text-to-speech.d.mts.map +1 -1
- package/resources/text-to-speech/text-to-speech.d.ts +4 -2
- package/resources/text-to-speech/text-to-speech.d.ts.map +1 -1
- package/resources/webhooks.d.mts +403 -5
- package/resources/webhooks.d.mts.map +1 -1
- package/resources/webhooks.d.ts +403 -5
- package/resources/webhooks.d.ts.map +1 -1
- package/resources/whatsapp/phone-numbers/calling-routing.d.mts +89 -0
- package/resources/whatsapp/phone-numbers/calling-routing.d.mts.map +1 -0
- package/resources/whatsapp/phone-numbers/calling-routing.d.ts +89 -0
- package/resources/whatsapp/phone-numbers/calling-routing.d.ts.map +1 -0
- package/resources/whatsapp/phone-numbers/calling-routing.js +65 -0
- package/resources/whatsapp/phone-numbers/calling-routing.js.map +1 -0
- package/resources/whatsapp/phone-numbers/calling-routing.mjs +61 -0
- package/resources/whatsapp/phone-numbers/calling-routing.mjs.map +1 -0
- package/resources/whatsapp/phone-numbers/index.d.mts +1 -0
- package/resources/whatsapp/phone-numbers/index.d.mts.map +1 -1
- package/resources/whatsapp/phone-numbers/index.d.ts +1 -0
- package/resources/whatsapp/phone-numbers/index.d.ts.map +1 -1
- package/resources/whatsapp/phone-numbers/index.js +3 -1
- package/resources/whatsapp/phone-numbers/index.js.map +1 -1
- package/resources/whatsapp/phone-numbers/index.mjs +1 -0
- package/resources/whatsapp/phone-numbers/index.mjs.map +1 -1
- package/resources/whatsapp/phone-numbers/phone-numbers.d.mts +4 -0
- package/resources/whatsapp/phone-numbers/phone-numbers.d.mts.map +1 -1
- package/resources/whatsapp/phone-numbers/phone-numbers.d.ts +4 -0
- package/resources/whatsapp/phone-numbers/phone-numbers.d.ts.map +1 -1
- package/resources/whatsapp/phone-numbers/phone-numbers.js +4 -0
- package/resources/whatsapp/phone-numbers/phone-numbers.js.map +1 -1
- package/resources/whatsapp/phone-numbers/phone-numbers.mjs +4 -0
- package/resources/whatsapp/phone-numbers/phone-numbers.mjs.map +1 -1
- package/src/client.ts +55 -0
- package/src/resources/ai/ai.ts +13 -4
- package/src/resources/ai/assistants/assistants.ts +384 -28
- package/src/resources/ai/assistants/deleted.ts +86 -0
- package/src/resources/ai/assistants/index.ts +11 -0
- package/src/resources/ai/assistants/versions.ts +40 -0
- package/src/resources/ai/chat.ts +7 -2
- package/src/resources/ai/embeddings/embeddings.ts +1 -1
- package/src/resources/ai/index.ts +5 -1
- package/src/resources/ai/memory/index.ts +9 -1
- package/src/resources/ai/memory/memory.ts +13 -1
- package/src/resources/ai/memory/namespaces/index.ts +9 -1
- package/src/resources/ai/memory/namespaces/namespaces.ts +81 -3
- package/src/resources/ai/openai/chat.ts +7 -2
- package/src/resources/ai/tools.ts +6 -6
- package/src/resources/calls/actions.ts +76 -15
- package/src/resources/calls/calls.ts +49 -9
- package/src/resources/dir/dir.ts +263 -32
- package/src/resources/dir/index.ts +6 -0
- package/src/resources/dir/phone-numbers.ts +8 -4
- package/src/resources/dir/references.ts +9 -6
- package/src/resources/enterprises/dir.ts +19 -1
- package/src/resources/enterprises/enterprises.ts +250 -23
- package/src/resources/enterprises/index.ts +5 -0
- package/src/resources/enterprises/reputation/loa.ts +73 -1
- package/src/resources/enterprises/verify-email.ts +117 -0
- package/src/resources/index.ts +20 -0
- package/src/resources/infringement-claims.ts +4 -0
- package/src/resources/llm-token-gateway/index.ts +4 -0
- package/src/resources/llm-token-gateway/llm-token-gateway.ts +19 -0
- package/src/resources/llm-token-gateway/usage.ts +336 -0
- package/src/resources/llm-token-gateway.ts +3 -0
- package/src/resources/meeting-sessions/meeting-sessions.ts +8 -9
- package/src/resources/porting-orders/phone-number-blocks.ts +9 -1
- package/src/resources/porting-orders/porting-orders.ts +9 -1
- package/src/resources/porting-phone-numbers.ts +9 -1
- package/src/resources/requirements.ts +2 -2
- package/src/resources/spend-limits.ts +428 -0
- package/src/resources/terms-of-service/agreements.ts +12 -0
- package/src/resources/terms-of-service/terms-of-service.ts +15 -0
- package/src/resources/text-to-speech/text-to-speech.ts +4 -2
- package/src/resources/webhooks.ts +495 -2
- package/src/resources/whatsapp/phone-numbers/calling-routing.ts +113 -0
- package/src/resources/whatsapp/phone-numbers/index.ts +7 -0
- package/src/resources/whatsapp/phone-numbers/phone-numbers.ts +18 -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
|
@@ -18,6 +18,13 @@ import {
|
|
|
18
18
|
RuleOutput,
|
|
19
19
|
Serve,
|
|
20
20
|
} from './canary-deploys';
|
|
21
|
+
import * as DeletedAPI from './deleted';
|
|
22
|
+
import {
|
|
23
|
+
Deleted,
|
|
24
|
+
DeletedAssistant,
|
|
25
|
+
DeletedAssistantsDefaultFlatPagination,
|
|
26
|
+
DeletedListParams,
|
|
27
|
+
} from './deleted';
|
|
21
28
|
import * as InstructionsAPI from './instructions';
|
|
22
29
|
import { InstructionEnhanceParams, InstructionEnhanceResponse, Instructions } from './instructions';
|
|
23
30
|
import * as ScheduledEventsAPI from './scheduled-events';
|
|
@@ -84,6 +91,7 @@ export class Assistants extends APIResource {
|
|
|
84
91
|
versions: VersionsAPI.Versions = new VersionsAPI.Versions(this._client);
|
|
85
92
|
tags: TagsAPI.Tags = new TagsAPI.Tags(this._client);
|
|
86
93
|
instructions: InstructionsAPI.Instructions = new InstructionsAPI.Instructions(this._client);
|
|
94
|
+
deleted: DeletedAPI.Deleted = new DeletedAPI.Deleted(this._client);
|
|
87
95
|
|
|
88
96
|
/**
|
|
89
97
|
* Retrieve a list of all AI Assistants configured by the user.
|
|
@@ -151,6 +159,20 @@ export class Assistants extends APIResource {
|
|
|
151
159
|
/**
|
|
152
160
|
* Delete an AI Assistant by `assistant_id`.
|
|
153
161
|
*
|
|
162
|
+
* By default this performs a soft delete: the assistant moves to the Recently
|
|
163
|
+
* Deleted list and stays restorable for 30 days, after which it is permanently
|
|
164
|
+
* deleted automatically. The assistant's versions and TeXML application are
|
|
165
|
+
* preserved during the retention window.
|
|
166
|
+
*
|
|
167
|
+
* Pass `hard_delete=true` to skip the retention window and permanently delete the
|
|
168
|
+
* assistant immediately. A hard delete erases the assistant and all of its
|
|
169
|
+
* versions, and deletes its TeXML application unless phone numbers are still
|
|
170
|
+
* assigned to it. It does not delete conversations, recordings, shared tools the
|
|
171
|
+
* assistant referenced, or knowledge-base embeddings.
|
|
172
|
+
*
|
|
173
|
+
* Deletion fails with `400` if other assistants reference this one through a
|
|
174
|
+
* handoff tool or a conversation-flow edge — remove those references first.
|
|
175
|
+
*
|
|
154
176
|
* @example
|
|
155
177
|
* ```ts
|
|
156
178
|
* const assistant = await client.ai.assistants.delete(
|
|
@@ -158,8 +180,13 @@ export class Assistants extends APIResource {
|
|
|
158
180
|
* );
|
|
159
181
|
* ```
|
|
160
182
|
*/
|
|
161
|
-
delete(
|
|
162
|
-
|
|
183
|
+
delete(
|
|
184
|
+
assistantID: string,
|
|
185
|
+
params: AssistantDeleteParams | null | undefined = {},
|
|
186
|
+
options?: RequestOptions,
|
|
187
|
+
): APIPromise<AssistantDeleteResponse> {
|
|
188
|
+
const { hard_delete } = params ?? {};
|
|
189
|
+
return this._client.delete(path`/ai/assistants/${assistantID}`, { query: { hard_delete }, ...options });
|
|
163
190
|
}
|
|
164
191
|
|
|
165
192
|
/**
|
|
@@ -306,6 +333,70 @@ export class Assistants extends APIResource {
|
|
|
306
333
|
]),
|
|
307
334
|
});
|
|
308
335
|
}
|
|
336
|
+
|
|
337
|
+
/**
|
|
338
|
+
* Start a WhatsApp conversation with a customer from the business side. This
|
|
339
|
+
* endpoint:
|
|
340
|
+
*
|
|
341
|
+
* 1. Validates that `from` is a WhatsApp number on your account whose messaging
|
|
342
|
+
* profile has this assistant configured
|
|
343
|
+
* 2. Creates a new `whatsapp_chat` conversation with the provided metadata
|
|
344
|
+
* 3. Asks the assistant to pick one of its approved WhatsApp templates and fill
|
|
345
|
+
* its variables from `content`
|
|
346
|
+
* 4. Sends the template from `from` to `to`
|
|
347
|
+
* 5. Returns the conversation ID and the message ID
|
|
348
|
+
*
|
|
349
|
+
* When the customer replies, the reply is routed to the same conversation and the
|
|
350
|
+
* assistant answers within the 24-hour customer service window. The assistant
|
|
351
|
+
* needs a `whatsapp_template` tool with at least one approved template, data
|
|
352
|
+
* retention enabled and PII redaction disabled.
|
|
353
|
+
*
|
|
354
|
+
* @example
|
|
355
|
+
* ```ts
|
|
356
|
+
* const response = await client.ai.assistants.whatsapp(
|
|
357
|
+
* 'assistant_id',
|
|
358
|
+
* {
|
|
359
|
+
* content:
|
|
360
|
+
* 'Send the login verification code 482913 to the customer.',
|
|
361
|
+
* from: '+13125550001',
|
|
362
|
+
* to: '+13125550002',
|
|
363
|
+
* conversation_metadata: { order_id: 'A1' },
|
|
364
|
+
* },
|
|
365
|
+
* );
|
|
366
|
+
* ```
|
|
367
|
+
*/
|
|
368
|
+
whatsapp(
|
|
369
|
+
assistantID: string,
|
|
370
|
+
params: AssistantWhatsappParams,
|
|
371
|
+
options?: RequestOptions,
|
|
372
|
+
): APIPromise<AssistantWhatsappResponse> {
|
|
373
|
+
const { 'Idempotency-Key': idempotencyKey, ...body } = params;
|
|
374
|
+
return this._client.post(path`/ai/assistants/${assistantID}/chat/whatsapp`, {
|
|
375
|
+
body,
|
|
376
|
+
...options,
|
|
377
|
+
headers: buildHeaders([
|
|
378
|
+
{ ...(idempotencyKey != null ? { 'Idempotency-Key': idempotencyKey } : undefined) },
|
|
379
|
+
options?.headers,
|
|
380
|
+
]),
|
|
381
|
+
});
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
/**
|
|
385
|
+
* Restore a soft-deleted assistant from the Recently Deleted list.
|
|
386
|
+
*
|
|
387
|
+
* The assistant becomes fully active again with its versions and TeXML application
|
|
388
|
+
* as they were at deletion time. Restoring does not re-enable numbers or
|
|
389
|
+
* connections that were released separately after the deletion.
|
|
390
|
+
*
|
|
391
|
+
* @example
|
|
392
|
+
* ```ts
|
|
393
|
+
* const inferenceEmbedding =
|
|
394
|
+
* await client.ai.assistants.restore('assistant_id');
|
|
395
|
+
* ```
|
|
396
|
+
*/
|
|
397
|
+
restore(assistantID: string, options?: RequestOptions): APIPromise<InferenceEmbedding> {
|
|
398
|
+
return this._client.post(path`/ai/assistants/${assistantID}/restore`, options);
|
|
399
|
+
}
|
|
309
400
|
}
|
|
310
401
|
|
|
311
402
|
/**
|
|
@@ -1429,7 +1520,7 @@ export interface ConversationFlow {
|
|
|
1429
1520
|
export interface ConversationFlowReq {
|
|
1430
1521
|
/**
|
|
1431
1522
|
* All nodes in the flow. Must contain `start_node_id`. Each node is a prompt node
|
|
1432
|
-
* (`type: prompt`)
|
|
1523
|
+
* (`type: prompt`), a tool node (`type: tool`), or a speak node (`type: speak`).
|
|
1433
1524
|
*/
|
|
1434
1525
|
nodes: Array<FlowNodeReq | ToolNodeReq | SpeakNodeReq>;
|
|
1435
1526
|
|
|
@@ -1444,6 +1535,73 @@ export interface ConversationFlowReq {
|
|
|
1444
1535
|
edges?: Array<FlowEdge>;
|
|
1445
1536
|
}
|
|
1446
1537
|
|
|
1538
|
+
/**
|
|
1539
|
+
* Splits the conversation between a frontend model that talks to the caller and a
|
|
1540
|
+
* backend model that does the work. On the GPT-Live route the frontend model
|
|
1541
|
+
* cannot call tools at all — when it needs something done it raises a delegation
|
|
1542
|
+
* and waits. On the chat completion route the frontend keeps a single `delegate`
|
|
1543
|
+
* tool that returns immediately, so the conversation carries on while the backend
|
|
1544
|
+
* works. Either way the backend's answer is spoken as commentary or kept as silent
|
|
1545
|
+
* context, depending on `speak_results`. Beta feature.
|
|
1546
|
+
*/
|
|
1547
|
+
export interface DelegationSettings {
|
|
1548
|
+
/**
|
|
1549
|
+
* Whether the assistant delegates work to a backend model. Defaults to `true`: a
|
|
1550
|
+
* GPT-Live assistant with delegation disabled can hold a conversation but can
|
|
1551
|
+
* never look anything up or run a tool.
|
|
1552
|
+
*/
|
|
1553
|
+
enabled?: boolean;
|
|
1554
|
+
|
|
1555
|
+
/**
|
|
1556
|
+
* Run the backend on your own OpenAI-compatible endpoint instead of a
|
|
1557
|
+
* Telnyx-hosted model. As above, a raw `api_key` here is rejected — reference an
|
|
1558
|
+
* integration secret with `external_llm.llm_api_key_ref` instead.
|
|
1559
|
+
*/
|
|
1560
|
+
external_llm?: ExternalLlm;
|
|
1561
|
+
|
|
1562
|
+
/**
|
|
1563
|
+
* Extra instructions for the backend model, in addition to the assistant's own.
|
|
1564
|
+
* Use this for the business rules the backend needs and the talking model does
|
|
1565
|
+
* not.
|
|
1566
|
+
*/
|
|
1567
|
+
instructions?: string;
|
|
1568
|
+
|
|
1569
|
+
/**
|
|
1570
|
+
* Integration secret identifier for the backend model's API key. Required for
|
|
1571
|
+
* models from providers other than Telnyx, OpenAI and Anthropic. A raw `api_key`
|
|
1572
|
+
* is rejected rather than ignored, so that no plaintext credential is stored on
|
|
1573
|
+
* the assistant.
|
|
1574
|
+
*/
|
|
1575
|
+
llm_api_key_ref?: string;
|
|
1576
|
+
|
|
1577
|
+
/**
|
|
1578
|
+
* Who answers a delegation. `telnyx` runs the backend model on Telnyx with the
|
|
1579
|
+
* assistant's own tools, MCP servers and observability. `client` relays the
|
|
1580
|
+
* delegation to a server you host over the WebSocket configured in
|
|
1581
|
+
* `websocket_settings`: Telnyx sends a `session.delegation.created` frame and
|
|
1582
|
+
* waits for your `session.delegation.completed` answer. That answer is text only,
|
|
1583
|
+
* since the socket offers no tool vocabulary. If no socket is connected the
|
|
1584
|
+
* delegation is refused and the assistant tells the caller it cannot look things
|
|
1585
|
+
* up right now. Defaults to `telnyx`.
|
|
1586
|
+
*/
|
|
1587
|
+
mode?: 'telnyx' | 'client';
|
|
1588
|
+
|
|
1589
|
+
/**
|
|
1590
|
+
* The backend model that answers delegations. Must be a model available for AI
|
|
1591
|
+
* Assistants. When enabling `telnyx` delegation, explicitly set this field or
|
|
1592
|
+
* `external_llm.model`; a configuration without either backend model is rejected.
|
|
1593
|
+
* Only applies when `mode` is `telnyx`.
|
|
1594
|
+
*/
|
|
1595
|
+
model?: string;
|
|
1596
|
+
|
|
1597
|
+
/**
|
|
1598
|
+
* Whether the backend's answer is spoken to the caller. When `true` the result is
|
|
1599
|
+
* appended as commentary and paraphrased aloud; when `false` it is kept as silent
|
|
1600
|
+
* context that informs later answers without being read out. Defaults to `true`.
|
|
1601
|
+
*/
|
|
1602
|
+
speak_results?: boolean;
|
|
1603
|
+
}
|
|
1604
|
+
|
|
1447
1605
|
/**
|
|
1448
1606
|
* If `telephony` is enabled, the assistant will be able to make and receive calls.
|
|
1449
1607
|
* If `messaging` is enabled, the assistant will be able to send and receive
|
|
@@ -1644,9 +1802,14 @@ export interface FallbackConfigReq {
|
|
|
1644
1802
|
* Directed transition from one node to a target, gated by a condition.
|
|
1645
1803
|
*
|
|
1646
1804
|
* The target is either another node in the same flow (`NodeTarget`) or a different
|
|
1647
|
-
* assistant (`AssistantTarget`). Multiple edges may share a `start_node_id
|
|
1648
|
-
*
|
|
1649
|
-
*
|
|
1805
|
+
* assistant (`AssistantTarget`). Multiple edges may share a `start_node_id`. On
|
|
1806
|
+
* calls, `expression` conditions are evaluated before the model turn and take
|
|
1807
|
+
* precedence over `llm` conditions regardless of declaration order, while `llm`
|
|
1808
|
+
* conditions are offered to the assistant's model as transition tools and fire
|
|
1809
|
+
* when the model selects one. On chat channels, an `expression` condition that is
|
|
1810
|
+
* true when the turn begins routes before the reply is generated; all conditioned
|
|
1811
|
+
* edges that remain are considered together in declaration order after the reply,
|
|
1812
|
+
* and the first true one wins.
|
|
1650
1813
|
*/
|
|
1651
1814
|
export interface FlowEdge {
|
|
1652
1815
|
/**
|
|
@@ -1674,15 +1837,22 @@ export interface FlowEdge {
|
|
|
1674
1837
|
|
|
1675
1838
|
export namespace FlowEdge {
|
|
1676
1839
|
/**
|
|
1677
|
-
* Edge condition
|
|
1840
|
+
* Edge condition routed by the assistant's LLM from a natural-language prompt.
|
|
1678
1841
|
*
|
|
1679
|
-
*
|
|
1680
|
-
*
|
|
1681
|
-
*
|
|
1842
|
+
* How the edge is decided depends on the channel. On calls, each outgoing `llm`
|
|
1843
|
+
* condition is offered to the assistant's model as a transition tool alongside the
|
|
1844
|
+
* assistant's tools, and the edge fires when the model selects it; the platform
|
|
1845
|
+
* does not evaluate the prompt itself, and instructions that forbid or discourage
|
|
1846
|
+
* tool calls can stop these edges from firing. On chat channels, the edge prompts
|
|
1847
|
+
* are evaluated in a separate model call after the reply, which does not use the
|
|
1848
|
+
* assistant's instructions. Use this for fuzzy intents that aren't expressible as
|
|
1849
|
+
* a deterministic expression (e.g. 'user wants to escalate to a human').
|
|
1682
1850
|
*/
|
|
1683
1851
|
export interface LlmCondition {
|
|
1684
1852
|
/**
|
|
1685
|
-
* Natural-language criterion the
|
|
1853
|
+
* Natural-language criterion the model routes on. On calls this is offered to the
|
|
1854
|
+
* model as the transition tool's description; on chat channels it is judged as a
|
|
1855
|
+
* statement in the post-reply evaluation call.
|
|
1686
1856
|
*/
|
|
1687
1857
|
prompt: string;
|
|
1688
1858
|
|
|
@@ -1948,7 +2118,8 @@ export interface FlowNodeReq {
|
|
|
1948
2118
|
|
|
1949
2119
|
/**
|
|
1950
2120
|
* Node kind discriminator. `prompt` (default) is an LLM-driven step; `tool` is a
|
|
1951
|
-
* standalone tool execution (see `ToolNodeReq`
|
|
2121
|
+
* standalone tool execution and `speak` a scripted message (see `ToolNodeReq` /
|
|
2122
|
+
* `SpeakNodeReq`).
|
|
1952
2123
|
*/
|
|
1953
2124
|
type?: 'prompt';
|
|
1954
2125
|
|
|
@@ -2023,6 +2194,17 @@ export interface InferenceEmbedding {
|
|
|
2023
2194
|
*/
|
|
2024
2195
|
conversation_flow?: ConversationFlow;
|
|
2025
2196
|
|
|
2197
|
+
/**
|
|
2198
|
+
* Splits the conversation between a frontend model that talks to the caller and a
|
|
2199
|
+
* backend model that does the work. On the GPT-Live route the frontend model
|
|
2200
|
+
* cannot call tools at all — when it needs something done it raises a delegation
|
|
2201
|
+
* and waits. On the chat completion route the frontend keeps a single `delegate`
|
|
2202
|
+
* tool that returns immediately, so the conversation carries on while the backend
|
|
2203
|
+
* works. Either way the backend's answer is spoken as commentary or kept as silent
|
|
2204
|
+
* context, depending on `speak_results`. Beta feature.
|
|
2205
|
+
*/
|
|
2206
|
+
delegation_settings?: DelegationSettings;
|
|
2207
|
+
|
|
2026
2208
|
description?: string;
|
|
2027
2209
|
|
|
2028
2210
|
/**
|
|
@@ -2163,6 +2345,15 @@ export interface InferenceEmbedding {
|
|
|
2163
2345
|
|
|
2164
2346
|
voice_settings?: InferenceEmbeddingVoiceSettings;
|
|
2165
2347
|
|
|
2348
|
+
/**
|
|
2349
|
+
* Streams conversation and telephony events to a WebSocket server you host, and
|
|
2350
|
+
* accepts messages injected back into the conversation. Telnyx opens the
|
|
2351
|
+
* connection as a client, once per conversation. Delivery is best effort
|
|
2352
|
+
* throughout: while the connection is down events are dropped rather than queued,
|
|
2353
|
+
* and no socket failure is ever allowed to affect the call. Beta feature.
|
|
2354
|
+
*/
|
|
2355
|
+
websocket_settings?: WebsocketSettings;
|
|
2356
|
+
|
|
2166
2357
|
/**
|
|
2167
2358
|
* Configuration settings for the assistant's web widget.
|
|
2168
2359
|
*/
|
|
@@ -2328,9 +2519,10 @@ export interface InferenceEmbeddingVoiceSettings {
|
|
|
2328
2519
|
use_speaker_boost?: boolean;
|
|
2329
2520
|
|
|
2330
2521
|
/**
|
|
2331
|
-
* The speed of the voice in the range [0.
|
|
2332
|
-
* numbers make the voice faster, smaller numbers make it slower.
|
|
2333
|
-
*
|
|
2522
|
+
* The speed of the voice in the range [0.6, 1.5]. 1.0 is the default speed. Larger
|
|
2523
|
+
* numbers make the voice faster, smaller numbers make it slower. Applies to Telnyx
|
|
2524
|
+
* `Ultra` voices; values outside this range are rejected by the synthesis engine.
|
|
2525
|
+
* Soniox voices support a speed range of 0.7 to 1.3.
|
|
2334
2526
|
*/
|
|
2335
2527
|
voice_speed?: number;
|
|
2336
2528
|
}
|
|
@@ -3169,13 +3361,24 @@ export interface ToolNode {
|
|
|
3169
3361
|
/**
|
|
3170
3362
|
* ID of the single shared (org-level) tool this node executes. When the flow
|
|
3171
3363
|
* reaches this node the tool runs as a deliberate step (no LLM turn); its outgoing
|
|
3172
|
-
* `
|
|
3173
|
-
* conversation's dynamic variables by name — a dynamic variable
|
|
3174
|
-
* one of the tool's parameters supplies that argument.
|
|
3175
|
-
* org's shared tools on write.
|
|
3364
|
+
* `llm` / `expression` edges route the flow on the tool's outcome. Arguments are
|
|
3365
|
+
* filled from the conversation's dynamic variables by name — a dynamic variable
|
|
3366
|
+
* whose name matches one of the tool's parameters supplies that argument.
|
|
3367
|
+
* Cross-validated against the org's shared tools on write.
|
|
3176
3368
|
*/
|
|
3177
3369
|
shared_tool_id: string;
|
|
3178
3370
|
|
|
3371
|
+
/**
|
|
3372
|
+
* Optional message delivered to the user verbatim immediately before the tool
|
|
3373
|
+
* executes — an announcement such as 'One moment while I look that up.' No LLM
|
|
3374
|
+
* turn and no customer turn: the message is spoken/sent, then the tool runs, in
|
|
3375
|
+
* the same deterministic step. `{{variable}}` placeholders are interpolated from
|
|
3376
|
+
* the conversation's dynamic variables (unresolved → empty string); the tool's own
|
|
3377
|
+
* result is not yet available when the message is rendered. Omit for a silent tool
|
|
3378
|
+
* step.
|
|
3379
|
+
*/
|
|
3380
|
+
message?: string;
|
|
3381
|
+
|
|
3179
3382
|
/**
|
|
3180
3383
|
* Optional human-readable label, displayed in authoring UIs.
|
|
3181
3384
|
*/
|
|
@@ -3206,8 +3409,10 @@ export interface ToolNode {
|
|
|
3206
3409
|
*
|
|
3207
3410
|
* Unlike a prompt node, a tool node has no instructions or model — it isn't an LLM
|
|
3208
3411
|
* turn. Reaching it deterministically runs one shared tool (arguments filled from
|
|
3209
|
-
* matching dynamic variables by name), then routes
|
|
3210
|
-
* `
|
|
3412
|
+
* matching dynamic variables by name), then routes via outgoing `llm` /
|
|
3413
|
+
* `expression` edges, with exactly one `default` fallback edge required when the
|
|
3414
|
+
* node has any outgoing edges (the tool's outcome is readable as
|
|
3415
|
+
* `telnyx_last_tool_status_code` in `expression` conditions).
|
|
3211
3416
|
*/
|
|
3212
3417
|
export interface ToolNodeReq {
|
|
3213
3418
|
/**
|
|
@@ -3218,13 +3423,24 @@ export interface ToolNodeReq {
|
|
|
3218
3423
|
/**
|
|
3219
3424
|
* ID of the single shared (org-level) tool this node executes. When the flow
|
|
3220
3425
|
* reaches this node the tool runs as a deliberate step (no LLM turn); its outgoing
|
|
3221
|
-
* `
|
|
3222
|
-
* conversation's dynamic variables by name — a dynamic variable
|
|
3223
|
-
* one of the tool's parameters supplies that argument.
|
|
3224
|
-
* org's shared tools on write.
|
|
3426
|
+
* `llm` / `expression` edges route the flow on the tool's outcome. Arguments are
|
|
3427
|
+
* filled from the conversation's dynamic variables by name — a dynamic variable
|
|
3428
|
+
* whose name matches one of the tool's parameters supplies that argument.
|
|
3429
|
+
* Cross-validated against the org's shared tools on write.
|
|
3225
3430
|
*/
|
|
3226
3431
|
shared_tool_id: string;
|
|
3227
3432
|
|
|
3433
|
+
/**
|
|
3434
|
+
* Optional message delivered to the user verbatim immediately before the tool
|
|
3435
|
+
* executes — an announcement such as 'One moment while I look that up.' No LLM
|
|
3436
|
+
* turn and no customer turn: the message is spoken/sent, then the tool runs, in
|
|
3437
|
+
* the same deterministic step. `{{variable}}` placeholders are interpolated from
|
|
3438
|
+
* the conversation's dynamic variables (unresolved → empty string); the tool's own
|
|
3439
|
+
* result is not yet available when the message is rendered. Omit for a silent tool
|
|
3440
|
+
* step.
|
|
3441
|
+
*/
|
|
3442
|
+
message?: string;
|
|
3443
|
+
|
|
3228
3444
|
/**
|
|
3229
3445
|
* Optional human-readable label, displayed in authoring UIs.
|
|
3230
3446
|
*/
|
|
@@ -3598,9 +3814,9 @@ export interface VoiceSettings {
|
|
|
3598
3814
|
use_speaker_boost?: boolean;
|
|
3599
3815
|
|
|
3600
3816
|
/**
|
|
3601
|
-
* The speed of the voice in the range [0.
|
|
3602
|
-
* numbers make the voice faster, smaller numbers make it slower.
|
|
3603
|
-
*
|
|
3817
|
+
* The speed of the voice in the range [0.6, 1.5]. 1.0 is the default speed. Larger
|
|
3818
|
+
* numbers make the voice faster, smaller numbers make it slower. Applies to Telnyx
|
|
3819
|
+
* `Ultra` voices; values outside this range are rejected by the synthesis engine.
|
|
3604
3820
|
*/
|
|
3605
3821
|
voice_speed?: number;
|
|
3606
3822
|
}
|
|
@@ -3799,6 +4015,35 @@ export namespace WebhookTool {
|
|
|
3799
4015
|
}
|
|
3800
4016
|
}
|
|
3801
4017
|
|
|
4018
|
+
/**
|
|
4019
|
+
* Streams conversation and telephony events to a WebSocket server you host, and
|
|
4020
|
+
* accepts messages injected back into the conversation. Telnyx opens the
|
|
4021
|
+
* connection as a client, once per conversation. Delivery is best effort
|
|
4022
|
+
* throughout: while the connection is down events are dropped rather than queued,
|
|
4023
|
+
* and no socket failure is ever allowed to affect the call. Beta feature.
|
|
4024
|
+
*/
|
|
4025
|
+
export interface WebsocketSettings {
|
|
4026
|
+
/**
|
|
4027
|
+
* Integration secret identifier whose value Telnyx sends as an
|
|
4028
|
+
* `Authorization: Bearer <value>` header on the upgrade request. Resolved on every
|
|
4029
|
+
* connection attempt, so a rotated secret is picked up by the next reconnect.
|
|
4030
|
+
*/
|
|
4031
|
+
auth_ref?: string;
|
|
4032
|
+
|
|
4033
|
+
/**
|
|
4034
|
+
* Whether Telnyx opens a WebSocket to `url` for each of this assistant's
|
|
4035
|
+
* conversations. Defaults to `false`.
|
|
4036
|
+
*/
|
|
4037
|
+
enabled?: boolean;
|
|
4038
|
+
|
|
4039
|
+
/**
|
|
4040
|
+
* The `ws://` or `wss://` endpoint Telnyx connects to. Required when `enabled` is
|
|
4041
|
+
* `true`. Must be externally reachable — localhost, private IP ranges and `.local`
|
|
4042
|
+
* domains are rejected.
|
|
4043
|
+
*/
|
|
4044
|
+
url?: string;
|
|
4045
|
+
}
|
|
4046
|
+
|
|
3802
4047
|
/**
|
|
3803
4048
|
* Configuration settings for the assistant's web widget.
|
|
3804
4049
|
*/
|
|
@@ -3881,6 +4126,18 @@ export interface AssistantSendSMSResponse {
|
|
|
3881
4126
|
conversation_id?: string;
|
|
3882
4127
|
}
|
|
3883
4128
|
|
|
4129
|
+
export interface AssistantWhatsappResponse {
|
|
4130
|
+
/**
|
|
4131
|
+
* ID of the conversation created for this WhatsApp chat.
|
|
4132
|
+
*/
|
|
4133
|
+
conversation_id: string;
|
|
4134
|
+
|
|
4135
|
+
/**
|
|
4136
|
+
* ID of the WhatsApp template message that was sent.
|
|
4137
|
+
*/
|
|
4138
|
+
message_id: string;
|
|
4139
|
+
}
|
|
4140
|
+
|
|
3884
4141
|
export interface AssistantCreateParams {
|
|
3885
4142
|
/**
|
|
3886
4143
|
* Body param: System instructions for the assistant. These may be templated with
|
|
@@ -3914,6 +4171,17 @@ export interface AssistantCreateParams {
|
|
|
3914
4171
|
*/
|
|
3915
4172
|
conversation_flow?: ConversationFlowReq;
|
|
3916
4173
|
|
|
4174
|
+
/**
|
|
4175
|
+
* Body param: Splits the conversation between a frontend model that talks to the
|
|
4176
|
+
* caller and a backend model that does the work. On the GPT-Live route the
|
|
4177
|
+
* frontend model cannot call tools at all — when it needs something done it raises
|
|
4178
|
+
* a delegation and waits. On the chat completion route the frontend keeps a single
|
|
4179
|
+
* `delegate` tool that returns immediately, so the conversation carries on while
|
|
4180
|
+
* the backend works. Either way the backend's answer is spoken as commentary or
|
|
4181
|
+
* kept as silent context, depending on `speak_results`. Beta feature.
|
|
4182
|
+
*/
|
|
4183
|
+
delegation_settings?: DelegationSettings;
|
|
4184
|
+
|
|
3917
4185
|
/**
|
|
3918
4186
|
* Body param
|
|
3919
4187
|
*/
|
|
@@ -4077,6 +4345,15 @@ export interface AssistantCreateParams {
|
|
|
4077
4345
|
*/
|
|
4078
4346
|
voice_settings?: InferenceEmbeddingVoiceSettings;
|
|
4079
4347
|
|
|
4348
|
+
/**
|
|
4349
|
+
* Body param: Streams conversation and telephony events to a WebSocket server you
|
|
4350
|
+
* host, and accepts messages injected back into the conversation. Telnyx opens the
|
|
4351
|
+
* connection as a client, once per conversation. Delivery is best effort
|
|
4352
|
+
* throughout: while the connection is down events are dropped rather than queued,
|
|
4353
|
+
* and no socket failure is ever allowed to affect the call. Beta feature.
|
|
4354
|
+
*/
|
|
4355
|
+
websocket_settings?: WebsocketSettings;
|
|
4356
|
+
|
|
4080
4357
|
/**
|
|
4081
4358
|
* Body param: Configuration settings for the assistant's web widget.
|
|
4082
4359
|
*/
|
|
@@ -4127,6 +4404,14 @@ export interface AssistantImportsParams {
|
|
|
4127
4404
|
'Idempotency-Key'?: string;
|
|
4128
4405
|
}
|
|
4129
4406
|
|
|
4407
|
+
export interface AssistantDeleteParams {
|
|
4408
|
+
/**
|
|
4409
|
+
* Permanently delete the assistant immediately instead of soft-deleting it to the
|
|
4410
|
+
* Recently Deleted list, where it stays restorable for 30 days.
|
|
4411
|
+
*/
|
|
4412
|
+
hard_delete?: boolean;
|
|
4413
|
+
}
|
|
4414
|
+
|
|
4130
4415
|
export interface AssistantRetrieveParams {
|
|
4131
4416
|
/**
|
|
4132
4417
|
* Filter results by call control id.
|
|
@@ -4172,6 +4457,17 @@ export interface AssistantUpdateParams {
|
|
|
4172
4457
|
*/
|
|
4173
4458
|
conversation_flow?: ConversationFlowReq;
|
|
4174
4459
|
|
|
4460
|
+
/**
|
|
4461
|
+
* Splits the conversation between a frontend model that talks to the caller and a
|
|
4462
|
+
* backend model that does the work. On the GPT-Live route the frontend model
|
|
4463
|
+
* cannot call tools at all — when it needs something done it raises a delegation
|
|
4464
|
+
* and waits. On the chat completion route the frontend keeps a single `delegate`
|
|
4465
|
+
* tool that returns immediately, so the conversation carries on while the backend
|
|
4466
|
+
* works. Either way the backend's answer is spoken as commentary or kept as silent
|
|
4467
|
+
* context, depending on `speak_results`. Beta feature.
|
|
4468
|
+
*/
|
|
4469
|
+
delegation_settings?: DelegationSettings;
|
|
4470
|
+
|
|
4175
4471
|
description?: string;
|
|
4176
4472
|
|
|
4177
4473
|
/**
|
|
@@ -4331,6 +4627,15 @@ export interface AssistantUpdateParams {
|
|
|
4331
4627
|
|
|
4332
4628
|
voice_settings?: InferenceEmbeddingVoiceSettings;
|
|
4333
4629
|
|
|
4630
|
+
/**
|
|
4631
|
+
* Streams conversation and telephony events to a WebSocket server you host, and
|
|
4632
|
+
* accepts messages injected back into the conversation. Telnyx opens the
|
|
4633
|
+
* connection as a client, once per conversation. Delivery is best effort
|
|
4634
|
+
* throughout: while the connection is down events are dropped rather than queued,
|
|
4635
|
+
* and no socket failure is ever allowed to affect the call. Beta feature.
|
|
4636
|
+
*/
|
|
4637
|
+
websocket_settings?: WebsocketSettings;
|
|
4638
|
+
|
|
4334
4639
|
/**
|
|
4335
4640
|
* Configuration settings for the assistant's web widget.
|
|
4336
4641
|
*/
|
|
@@ -4416,6 +4721,44 @@ export interface AssistantSendSMSParams {
|
|
|
4416
4721
|
'Idempotency-Key'?: string;
|
|
4417
4722
|
}
|
|
4418
4723
|
|
|
4724
|
+
export interface AssistantWhatsappParams {
|
|
4725
|
+
/**
|
|
4726
|
+
* Body param: Instruction for the assistant, including the values for the template
|
|
4727
|
+
* variables, e.g. `Send the login verification code 482913 to the customer.`
|
|
4728
|
+
*/
|
|
4729
|
+
content: string;
|
|
4730
|
+
|
|
4731
|
+
/**
|
|
4732
|
+
* Body param: WhatsApp number on your account to send from, in E.164 format. Its
|
|
4733
|
+
* messaging profile must have this assistant configured.
|
|
4734
|
+
*/
|
|
4735
|
+
from: string;
|
|
4736
|
+
|
|
4737
|
+
/**
|
|
4738
|
+
* Body param: Customer to message, as an E.164 phone number or a WhatsApp
|
|
4739
|
+
* business-scoped user ID (BSUID).
|
|
4740
|
+
*/
|
|
4741
|
+
to: string;
|
|
4742
|
+
|
|
4743
|
+
/**
|
|
4744
|
+
* Body param: Metadata stored on the conversation. Keys starting with `telnyx_`
|
|
4745
|
+
* and the `assistant_id` key are reserved.
|
|
4746
|
+
*/
|
|
4747
|
+
conversation_metadata?: { [key: string]: string | number | boolean };
|
|
4748
|
+
|
|
4749
|
+
/**
|
|
4750
|
+
* Header param: Optional opaque, unquoted key for safely retrying the same logical
|
|
4751
|
+
* request. Keys must contain 1 to 255 letters, numbers, hyphens, or underscores.
|
|
4752
|
+
* Generate a unique UUID v4 for each operation and reuse it only when retrying
|
|
4753
|
+
* that operation with the same request. Invalid headers—including duplicate,
|
|
4754
|
+
* empty, malformed, or overlong values—return 400 with error code 10015. A request
|
|
4755
|
+
* already in progress with the same key returns 409; reusing the key with a
|
|
4756
|
+
* different request returns 422. Only successful responses are replayed, for up to
|
|
4757
|
+
* 24 hours. Do not include sensitive data in the key.
|
|
4758
|
+
*/
|
|
4759
|
+
'Idempotency-Key'?: string;
|
|
4760
|
+
}
|
|
4761
|
+
|
|
4419
4762
|
Assistants.Tests = Tests;
|
|
4420
4763
|
Assistants.CanaryDeploys = CanaryDeploys;
|
|
4421
4764
|
Assistants.ScheduledEvents = ScheduledEvents;
|
|
@@ -4423,6 +4766,7 @@ Assistants.Tools = Tools;
|
|
|
4423
4766
|
Assistants.Versions = Versions;
|
|
4424
4767
|
Assistants.Tags = Tags;
|
|
4425
4768
|
Assistants.Instructions = Instructions;
|
|
4769
|
+
Assistants.Deleted = Deleted;
|
|
4426
4770
|
|
|
4427
4771
|
export declare namespace Assistants {
|
|
4428
4772
|
export {
|
|
@@ -4439,6 +4783,7 @@ export declare namespace Assistants {
|
|
|
4439
4783
|
type ComparisonExpression as ComparisonExpression,
|
|
4440
4784
|
type ConversationFlow as ConversationFlow,
|
|
4441
4785
|
type ConversationFlowReq as ConversationFlowReq,
|
|
4786
|
+
type DelegationSettings as DelegationSettings,
|
|
4442
4787
|
type EnabledFeatures as EnabledFeatures,
|
|
4443
4788
|
type Expression as Expression,
|
|
4444
4789
|
type ExternalLlm as ExternalLlm,
|
|
@@ -4478,18 +4823,22 @@ export declare namespace Assistants {
|
|
|
4478
4823
|
type TransferTool as TransferTool,
|
|
4479
4824
|
type VoiceSettings as VoiceSettings,
|
|
4480
4825
|
type WebhookTool as WebhookTool,
|
|
4826
|
+
type WebsocketSettings as WebsocketSettings,
|
|
4481
4827
|
type WidgetSettings as WidgetSettings,
|
|
4482
4828
|
type AssistantDeleteResponse as AssistantDeleteResponse,
|
|
4483
4829
|
type AssistantChatResponse as AssistantChatResponse,
|
|
4484
4830
|
type AssistantGetTexmlResponse as AssistantGetTexmlResponse,
|
|
4485
4831
|
type AssistantSendSMSResponse as AssistantSendSMSResponse,
|
|
4832
|
+
type AssistantWhatsappResponse as AssistantWhatsappResponse,
|
|
4486
4833
|
type AssistantCreateParams as AssistantCreateParams,
|
|
4487
4834
|
type AssistantImportsParams as AssistantImportsParams,
|
|
4835
|
+
type AssistantDeleteParams as AssistantDeleteParams,
|
|
4488
4836
|
type AssistantRetrieveParams as AssistantRetrieveParams,
|
|
4489
4837
|
type AssistantUpdateParams as AssistantUpdateParams,
|
|
4490
4838
|
type AssistantChatParams as AssistantChatParams,
|
|
4491
4839
|
type AssistantCloneParams as AssistantCloneParams,
|
|
4492
4840
|
type AssistantSendSMSParams as AssistantSendSMSParams,
|
|
4841
|
+
type AssistantWhatsappParams as AssistantWhatsappParams,
|
|
4493
4842
|
};
|
|
4494
4843
|
|
|
4495
4844
|
export {
|
|
@@ -4562,4 +4911,11 @@ export declare namespace Assistants {
|
|
|
4562
4911
|
type InstructionEnhanceResponse as InstructionEnhanceResponse,
|
|
4563
4912
|
type InstructionEnhanceParams as InstructionEnhanceParams,
|
|
4564
4913
|
};
|
|
4914
|
+
|
|
4915
|
+
export {
|
|
4916
|
+
Deleted as Deleted,
|
|
4917
|
+
type DeletedAssistant as DeletedAssistant,
|
|
4918
|
+
type DeletedAssistantsDefaultFlatPagination as DeletedAssistantsDefaultFlatPagination,
|
|
4919
|
+
type DeletedListParams as DeletedListParams,
|
|
4920
|
+
};
|
|
4565
4921
|
}
|