twilio 6.0.0 → 6.0.2

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.
Files changed (121) hide show
  1. package/lib/rest/ConversationsBase.d.ts +3 -0
  2. package/lib/rest/ConversationsBase.js +5 -0
  3. package/lib/rest/InsightsBase.d.ts +3 -0
  4. package/lib/rest/InsightsBase.js +5 -0
  5. package/lib/rest/IntelligenceBase.d.ts +3 -0
  6. package/lib/rest/IntelligenceBase.js +5 -0
  7. package/lib/rest/KnowledgeBase.d.ts +3 -0
  8. package/lib/rest/KnowledgeBase.js +5 -0
  9. package/lib/rest/Memory.d.ts +4 -0
  10. package/lib/rest/Memory.js +8 -0
  11. package/lib/rest/MemoryBase.d.ts +13 -0
  12. package/lib/rest/MemoryBase.js +31 -0
  13. package/lib/rest/Twilio.d.ts +5 -0
  14. package/lib/rest/Twilio.js +5 -0
  15. package/lib/rest/VoiceBase.d.ts +3 -0
  16. package/lib/rest/VoiceBase.js +5 -0
  17. package/lib/rest/api/v2010/account/call/recording.d.ts +2 -0
  18. package/lib/rest/api/v2010/account/call/recording.js +4 -0
  19. package/lib/rest/api/v2010/account/call/transcription.d.ts +1 -1
  20. package/lib/rest/api/v2010/account/call/transcription.js +6 -4
  21. package/lib/rest/api/v2010/account/call.d.ts +2 -0
  22. package/lib/rest/api/v2010/account/call.js +4 -0
  23. package/lib/rest/api/v2010/account/conference/participant.d.ts +2 -0
  24. package/lib/rest/api/v2010/account/conference/participant.js +4 -0
  25. package/lib/rest/conversations/V2.d.ts +38 -0
  26. package/lib/rest/conversations/V2.js +72 -0
  27. package/lib/rest/conversations/v2/action.d.ts +241 -0
  28. package/lib/rest/conversations/v2/action.js +246 -0
  29. package/lib/rest/conversations/v2/communication.d.ts +479 -0
  30. package/lib/rest/conversations/v2/communication.js +436 -0
  31. package/lib/rest/conversations/v2/configuration.d.ts +906 -0
  32. package/lib/rest/conversations/v2/configuration.js +619 -0
  33. package/lib/rest/conversations/v2/conversation.d.ts +936 -0
  34. package/lib/rest/conversations/v2/conversation.js +664 -0
  35. package/lib/rest/conversations/v2/operation.d.ts +167 -0
  36. package/lib/rest/conversations/v2/operation.js +170 -0
  37. package/lib/rest/conversations/v2/participant.d.ts +469 -0
  38. package/lib/rest/conversations/v2/participant.js +442 -0
  39. package/lib/rest/flexApi/v1/plugin/pluginVersions.d.ts +1 -1
  40. package/lib/rest/flexApi/v1/plugin/pluginVersions.js +8 -6
  41. package/lib/rest/insights/V3.d.ts +20 -0
  42. package/lib/rest/insights/V3.js +42 -0
  43. package/lib/rest/insights/v1/call/callSummary.d.ts +10 -10
  44. package/lib/rest/insights/v1/call/event.d.ts +4 -4
  45. package/lib/rest/insights/v1/callSummaries.d.ts +12 -9
  46. package/lib/rest/insights/v3/metadata.d.ts +115 -0
  47. package/lib/rest/insights/v3/metadata.js +118 -0
  48. package/lib/rest/insights/v3/query.d.ts +180 -0
  49. package/lib/rest/insights/v3/query.js +214 -0
  50. package/lib/rest/intelligence/V3.d.ts +35 -0
  51. package/lib/rest/intelligence/V3.js +65 -0
  52. package/lib/rest/intelligence/v3/configuration.d.ts +693 -0
  53. package/lib/rest/intelligence/v3/configuration.js +528 -0
  54. package/lib/rest/intelligence/v3/conversation.d.ts +478 -0
  55. package/lib/rest/intelligence/v3/conversation.js +342 -0
  56. package/lib/rest/intelligence/v3/operator.d.ts +619 -0
  57. package/lib/rest/intelligence/v3/operator.js +493 -0
  58. package/lib/rest/intelligence/v3/operatorResult.d.ts +543 -0
  59. package/lib/rest/intelligence/v3/operatorResult.js +478 -0
  60. package/lib/rest/intelligence/v3/version.d.ts +469 -0
  61. package/lib/rest/intelligence/v3/version.js +341 -0
  62. package/lib/rest/knowledge/V2.d.ts +31 -0
  63. package/lib/rest/knowledge/V2.js +62 -0
  64. package/lib/rest/knowledge/v2/chunk.d.ts +209 -0
  65. package/lib/rest/knowledge/v2/chunk.js +178 -0
  66. package/lib/rest/knowledge/v2/knowledge.d.ts +507 -0
  67. package/lib/rest/knowledge/v2/knowledge.js +466 -0
  68. package/lib/rest/knowledge/v2/knowledgeBasis.d.ts +484 -0
  69. package/lib/rest/knowledge/v2/knowledgeBasis.js +441 -0
  70. package/lib/rest/knowledge/v2/operation.d.ts +162 -0
  71. package/lib/rest/knowledge/v2/operation.js +175 -0
  72. package/lib/rest/knowledge/v2/search.d.ts +180 -0
  73. package/lib/rest/knowledge/v2/search.js +174 -0
  74. package/lib/rest/memory/V1.d.ts +76 -0
  75. package/lib/rest/memory/V1.js +140 -0
  76. package/lib/rest/memory/v1/bulk.d.ts +129 -0
  77. package/lib/rest/memory/v1/bulk.js +158 -0
  78. package/lib/rest/memory/v1/conversationSummary.d.ts +531 -0
  79. package/lib/rest/memory/v1/conversationSummary.js +473 -0
  80. package/lib/rest/memory/v1/dataMapping.d.ts +630 -0
  81. package/lib/rest/memory/v1/dataMapping.js +512 -0
  82. package/lib/rest/memory/v1/event.d.ts +153 -0
  83. package/lib/rest/memory/v1/event.js +159 -0
  84. package/lib/rest/memory/v1/identifier.d.ts +362 -0
  85. package/lib/rest/memory/v1/identifier.js +369 -0
  86. package/lib/rest/memory/v1/identityResolutionSetting.d.ts +247 -0
  87. package/lib/rest/memory/v1/identityResolutionSetting.js +229 -0
  88. package/lib/rest/memory/v1/import.d.ts +292 -0
  89. package/lib/rest/memory/v1/import.js +280 -0
  90. package/lib/rest/memory/v1/lookup.d.ts +82 -0
  91. package/lib/rest/memory/v1/lookup.js +118 -0
  92. package/lib/rest/memory/v1/observation.d.ts +521 -0
  93. package/lib/rest/memory/v1/observation.js +477 -0
  94. package/lib/rest/memory/v1/operation.d.ts +162 -0
  95. package/lib/rest/memory/v1/operation.js +175 -0
  96. package/lib/rest/memory/v1/profile.d.ts +548 -0
  97. package/lib/rest/memory/v1/profile.js +531 -0
  98. package/lib/rest/memory/v1/recall.d.ts +306 -0
  99. package/lib/rest/memory/v1/recall.js +234 -0
  100. package/lib/rest/memory/v1/revision.d.ts +246 -0
  101. package/lib/rest/memory/v1/revision.js +195 -0
  102. package/lib/rest/memory/v1/store.d.ts +544 -0
  103. package/lib/rest/memory/v1/store.js +534 -0
  104. package/lib/rest/memory/v1/trait.d.ts +233 -0
  105. package/lib/rest/memory/v1/trait.js +190 -0
  106. package/lib/rest/memory/v1/traitGroup.d.ts +758 -0
  107. package/lib/rest/memory/v1/traitGroup.js +555 -0
  108. package/lib/rest/messaging/v2/channelsSender.d.ts +8 -0
  109. package/lib/rest/messaging/v2/channelsSender.js +2 -0
  110. package/lib/rest/previewIam/versionless/organization/roleAssignment.d.ts +32 -0
  111. package/lib/rest/previewIam/versionless/organization/roleAssignment.js +14 -0
  112. package/lib/rest/studio/v2/flow.d.ts +4 -0
  113. package/lib/rest/studio/v2/flow.js +8 -0
  114. package/lib/rest/verify/v2/service/webhook.d.ts +2 -2
  115. package/lib/rest/verify/v2/service/webhook.js +8 -8
  116. package/lib/rest/voice/V3.d.ts +15 -0
  117. package/lib/rest/voice/V3.js +37 -0
  118. package/lib/rest/voice/v3/transcription.d.ts +378 -0
  119. package/lib/rest/voice/v3/transcription.js +264 -0
  120. package/lib/twiml/VoiceResponse.d.ts +8 -0
  121. package/package.json +1 -1
@@ -0,0 +1,619 @@
1
+ import { inspect, InspectOptions } from "util";
2
+ import TokenPage, { TokenPaginationPayload } from "../../../base/TokenPage";
3
+ import Response from "../../../http/response";
4
+ import V3 from "../V3";
5
+ import { ApiResponse } from "../../../base/ApiResponse";
6
+ /**
7
+ * A Language Operator resource.
8
+ */
9
+ export declare class LanguageOperator {
10
+ /**
11
+ * The unique identifier for the Language Operator. Assigned by Twilio (TTID).
12
+ */
13
+ "id"?: string;
14
+ /**
15
+ * Display name of the Language Operator describing its purpose.
16
+ */
17
+ "displayName"?: string;
18
+ /**
19
+ * Description of the Language Operator further explaining its purpose.
20
+ */
21
+ "description"?: string;
22
+ /**
23
+ * Numeric Operator version. Automatically incremented with each update on the resource, used to ensure integrity when updating the Operator.
24
+ */
25
+ "version"?: number;
26
+ "author"?: OperatorOperatorAuthor;
27
+ /**
28
+ * The natural language instructions used by the operator to analyze the conversation. Within the prompt, users can reference parameters using the `{{parameters.[param_name]}}` syntax. Parameter values are provided to the Operator by the Intelligence Configuration Rule at runtime. **Note**: Prompts will only be exposed for Custom Operators (`author` = `SELF`). Twilio-authored Operators (`author` = `TWILIO`) will have their prompts omitted from the API.
29
+ */
30
+ "prompt"?: string;
31
+ "outputFormat"?: OperatorOutputFormat;
32
+ /**
33
+ * Required for `JSON` output only. this will be set to a JSON Schema object describing the properties & data types of the response. Please see https://platform.openai.com/docs/guides/structured-outputs#supported-schemas Will include the following keywords: - `type` : Must be set to `object` - `properties`: An object containing the property names and their data types you would like the LLM to return Additional details on JSON output formatting: - The root level `type` of a JSON schema must be set to `object` - The following property data types are supported : `string`, `number`, `boolean`, `integer`, `object`, `array`, `anyOf` - Definitions with `$defs` / `$ref` are supported - Max 100 object properties and 10 levels of nesting are supported - Max 1000 enum values across all enum properties are supported - Notable JSON Schema keywords not supported include: - For `strings`: `minLength`, `maxLength` - For `objects`: `patternProperties`, `unevaluatedProperties`, `propertyNames`, `minProperties`, `maxProperties` - For `arrays`: `unevaluatedItems`, `contains`, `minContains`, `maxContains`, `uniqueItems` - Structured Operator Results will be returned in the same order as the ordering of keys in the schema - In the event an Operator execution request is refused for safety reasons the Operator Result API response will include a new field called `refusal` to indicate that the LLM refused to fulfill the request - Twilio will automatically set `additionalProperties` to false and specify all provided fields as required (constraints of Structured Outputs). You don\'t need to pass these fields as part of your JSON schema. Twilio will automatically overwrite any user-provided values for these fields.
34
+ */
35
+ "outputSchema"?: Record<string, object>;
36
+ /**
37
+ * An array of example input/output pairs used to illustrate the intended behavior of the Language Operator. These examples help guide the model\'s understanding of expected input–output relationships and improve consistency during evaluation and testing. **Note**: Training examples will only be exposed for Custom Operators (`author` = `SELF`). Twilio-authored Operators (`author` = `TWILIO`) will have their training examples omitted from the API.
38
+ */
39
+ "trainingExamples"?: Array<OperatorTrainingExample>;
40
+ "context"?: OperatorContext;
41
+ /**
42
+ * Defines the schema of the parameters that are provided when running the operator, including required and optional values that determine the operator\'s behavior. The values of the parameters themselves are passed in by the attached Intelligence Configuration.
43
+ */
44
+ "parameters"?: {
45
+ [key: string]: OperatorParameter;
46
+ };
47
+ constructor(payload: any);
48
+ }
49
+ /**
50
+ * The creator and maintainer of the Language Operator. Available values: - `SELF` - Created and maintained by the customer (Custom Operator) - `TWILIO` - Created and maintained by Twilio (Twilio-Authored Operator)
51
+ */
52
+ export type OperatorOperatorAuthor = "SELF" | "TWILIO";
53
+ /**
54
+ * Optionally specifies which contextual data sources (Memory, Knowledge) the operator can access during execution. Context objects will be passed in by the Intelligence Configuration Rule at runtime. **Note**: this simply gives the LLM access to these context objects – ultimately the LLM will determine whether to actually call for context at runtime.
55
+ */
56
+ export declare class OperatorContext {
57
+ "memory"?: OperatorContextMemory;
58
+ "knowledge"?: OperatorContextKnowledge;
59
+ constructor(payload: any);
60
+ }
61
+ /**
62
+ * Defines whether the Operator has access to organizational Knowledge Sources (e.g., policies, FAQs, scripts) at runtime.
63
+ */
64
+ export declare class OperatorContextKnowledge {
65
+ /**
66
+ * Set to true to allow access to Knowledge Sources at runtime.
67
+ */
68
+ "enabled"?: boolean;
69
+ constructor(payload: any);
70
+ }
71
+ /**
72
+ * Defines whether the Operator has access to Memory (past conversational memories and profile traits).
73
+ */
74
+ export declare class OperatorContextMemory {
75
+ /**
76
+ * Set to true to allow access to Memory at runtime.
77
+ */
78
+ "enabled"?: boolean;
79
+ constructor(payload: any);
80
+ }
81
+ /**
82
+ * The structure of the result returned by the Language Operator (specific to what the LLM returns, not the entirety of the Operator Result resource). Available values: - `TEXT`: The Operator will return plaintext from the LLM. - `JSON`: the Operator will return a structured object with schema defined in `output_schema` - `CLASSIFICATION`: The Operator will return the determined classifier string.
83
+ */
84
+ export type OperatorOutputFormat = "TEXT" | "JSON" | "CLASSIFICATION";
85
+ export declare class OperatorParameter {
86
+ /**
87
+ * The data type of the parameter (e.g., STRING, INTEGER). Available values: STRING, INTEGER, NUMBER, BOOLEAN, KNOWLEDGE_BASE_AND_SOURCE_IDS KNOWLEDGE_BASE_AND_SOURCE_IDS is a special type of parameter that refers to a Memora Knowledge Source, prefixed with its Knowledge Base container. Support for KB type = plaintext only. During Intelligence Configuration creation, this parameter is linked to a specific Knowledge Source. The operator receives the resolved plaintext at runtime and injects it into the prompt. The value of this parameter is expected to be passed in the following format: knowledge_base_id:knowledge_source_id.
88
+ */
89
+ "type": string;
90
+ /**
91
+ * Default value to use in the prompt if no value is provided by the Intelligence Configuration. Note: knowledge_base_and_source_ids does not support the default attribute, but all other param types do allow for a default value.
92
+ */
93
+ "_default"?: any | null;
94
+ /**
95
+ * Whether this parameter must be set at Operator execution time. Defaults to false if not provided.
96
+ */
97
+ "required"?: boolean;
98
+ /**
99
+ * A human-readable description of the parameter.
100
+ */
101
+ "description"?: string;
102
+ constructor(payload: any);
103
+ }
104
+ export declare class OperatorTrainingExample {
105
+ /**
106
+ * A sample input text that demonstrates the type of content the Operator processes.
107
+ */
108
+ "input": string;
109
+ /**
110
+ * The expected output corresponding to the provided input example. This value must be consistent with the defined `output_format` and `output_schema` of the Operator.
111
+ */
112
+ "output": string;
113
+ constructor(payload: any);
114
+ }
115
+ /**
116
+ * Options to pass to update a OperatorInstance
117
+ */
118
+ export interface OperatorContextUpdateOptions {
119
+ /** Full replacement of a Language Operator configuration */
120
+ languageOperator: LanguageOperator;
121
+ /** Current ETag/version required for conditional update */
122
+ ifMatch?: string;
123
+ }
124
+ /**
125
+ * Options to pass to create a OperatorInstance
126
+ */
127
+ export interface OperatorListInstanceCreateOptions {
128
+ /** Create Language Operator request */
129
+ languageOperator: LanguageOperator;
130
+ }
131
+ /**
132
+ * Options to pass to each
133
+ */
134
+ export interface OperatorListInstanceEachOptions {
135
+ /** The maximum number of resources to return */
136
+ pageSize?: number;
137
+ /** Token for pagination */
138
+ pageToken?: string;
139
+ /** Function to process each record. If this and a positional callback are passed, this one will be used */
140
+ callback?: (item: OperatorInstance, done: (err?: Error) => void) => void;
141
+ /** Function to be called upon completion of streaming */
142
+ done?: Function;
143
+ /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */
144
+ limit?: number;
145
+ }
146
+ /**
147
+ * Options to pass to list
148
+ */
149
+ export interface OperatorListInstanceOptions {
150
+ /** The maximum number of resources to return */
151
+ pageSize?: number;
152
+ /** Token for pagination */
153
+ pageToken?: string;
154
+ /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */
155
+ limit?: number;
156
+ }
157
+ /**
158
+ * Options to pass to page
159
+ */
160
+ export interface OperatorListInstancePageOptions {
161
+ /** The maximum number of resources to return */
162
+ pageSize?: number;
163
+ /** Token for pagination */
164
+ pageToken?: string;
165
+ }
166
+ export interface OperatorContext {
167
+ /**
168
+ * Remove a OperatorInstance
169
+ *
170
+ * @param callback - Callback to handle processed record
171
+ *
172
+ * @returns Resolves to processed boolean
173
+ */
174
+ remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
175
+ /**
176
+ * Remove a OperatorInstance and return HTTP info
177
+ *
178
+ * @param callback - Callback to handle processed record
179
+ *
180
+ * @returns Resolves to processed boolean with HTTP metadata
181
+ */
182
+ removeWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<boolean>) => any): Promise<ApiResponse<boolean>>;
183
+ /**
184
+ * Fetch a OperatorInstance
185
+ *
186
+ * @param callback - Callback to handle processed record
187
+ *
188
+ * @returns Resolves to processed OperatorInstance
189
+ */
190
+ fetch(callback?: (error: Error | null, item?: OperatorInstance) => any): Promise<OperatorInstance>;
191
+ /**
192
+ * Fetch a OperatorInstance and return HTTP info
193
+ *
194
+ * @param callback - Callback to handle processed record
195
+ *
196
+ * @returns Resolves to processed OperatorInstance with HTTP metadata
197
+ */
198
+ fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<OperatorInstance>) => any): Promise<ApiResponse<OperatorInstance>>;
199
+ /**
200
+ * Update a OperatorInstance
201
+ *
202
+ * @param params - Body for request
203
+ * @param headers - header params for request
204
+ * @param callback - Callback to handle processed record
205
+ *
206
+ * @returns Resolves to processed OperatorInstance
207
+ */
208
+ update(params: LanguageOperator, headers?: any, callback?: (error: Error | null, item?: OperatorInstance) => any): Promise<OperatorInstance>;
209
+ /**
210
+ * Update a OperatorInstance and return HTTP info
211
+ *
212
+ * @param params - Body for request
213
+ * @param headers - header params for request
214
+ * @param callback - Callback to handle processed record
215
+ *
216
+ * @returns Resolves to processed OperatorInstance with HTTP metadata
217
+ */
218
+ updateWithHttpInfo(params: LanguageOperator, headers?: any, callback?: (error: Error | null, item?: ApiResponse<OperatorInstance>) => any): Promise<ApiResponse<OperatorInstance>>;
219
+ /**
220
+ * Provide a user-friendly representation
221
+ */
222
+ toJSON(): any;
223
+ [inspect.custom](_depth: any, options: InspectOptions): any;
224
+ }
225
+ export interface OperatorContextSolution {
226
+ id: string;
227
+ }
228
+ export declare class OperatorContextImpl implements OperatorContext {
229
+ protected _version: V3;
230
+ protected _solution: OperatorContextSolution;
231
+ protected _uri: string;
232
+ constructor(_version: V3, id: string);
233
+ remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
234
+ removeWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<boolean>) => any): Promise<ApiResponse<boolean>>;
235
+ fetch(callback?: (error: Error | null, item?: OperatorInstance) => any): Promise<OperatorInstance>;
236
+ fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<OperatorInstance>) => any): Promise<ApiResponse<OperatorInstance>>;
237
+ update(params: LanguageOperator, headers?: any, callback?: (error: Error | null, item?: OperatorInstance) => any): Promise<OperatorInstance>;
238
+ updateWithHttpInfo(params: LanguageOperator, headers?: any, callback?: (error: Error | null, item?: ApiResponse<OperatorInstance>) => any): Promise<ApiResponse<OperatorInstance>>;
239
+ /**
240
+ * Provide a user-friendly representation
241
+ *
242
+ * @returns Object
243
+ */
244
+ toJSON(): OperatorContextSolution;
245
+ [inspect.custom](_depth: any, options: InspectOptions): string;
246
+ }
247
+ /**
248
+ * Nested model for LanguageOperator
249
+ */
250
+ export interface LanguageOperator {
251
+ id?: string;
252
+ displayName?: string;
253
+ description?: string;
254
+ version?: number;
255
+ author?: OperatorOperatorAuthor;
256
+ prompt?: string;
257
+ outputFormat?: OperatorOutputFormat;
258
+ outputSchema?: Record<string, object>;
259
+ trainingExamples?: Array<OperatorTrainingExample>;
260
+ context?: OperatorContext;
261
+ parameters?: {
262
+ [key: string]: OperatorParameter;
263
+ };
264
+ }
265
+ /**
266
+ * Nested model for OperatorContext
267
+ */
268
+ export interface OperatorContext {
269
+ memory?: OperatorContextMemory;
270
+ knowledge?: OperatorContextKnowledge;
271
+ }
272
+ /**
273
+ * Nested model for OperatorContextKnowledge
274
+ */
275
+ export interface OperatorContextKnowledge {
276
+ enabled?: boolean;
277
+ }
278
+ /**
279
+ * Nested model for OperatorContextMemory
280
+ */
281
+ export interface OperatorContextMemory {
282
+ enabled?: boolean;
283
+ }
284
+ /**
285
+ * Nested model for OperatorParameter
286
+ */
287
+ export interface OperatorParameter {
288
+ type: string;
289
+ default?: any;
290
+ required?: boolean;
291
+ description?: string;
292
+ }
293
+ /**
294
+ * Nested model for OperatorTrainingExample
295
+ */
296
+ export interface OperatorTrainingExample {
297
+ input: string;
298
+ output: string;
299
+ }
300
+ interface OperatorPayload extends TokenPaginationPayload {
301
+ items: OperatorResource[];
302
+ }
303
+ /**
304
+ * Response model for CreateOperator201Response operations
305
+ */
306
+ interface CreateOperator201Response_ResponseResource {
307
+ id?: string;
308
+ displayName?: string;
309
+ description?: string;
310
+ version?: number;
311
+ author?: OperatorOperatorAuthor;
312
+ prompt?: string;
313
+ outputFormat?: OperatorOutputFormat;
314
+ outputSchema?: Record<string, object>;
315
+ trainingExamples?: Array<OperatorTrainingExample>;
316
+ context?: OperatorContext;
317
+ parameters?: {
318
+ [key: string]: OperatorParameter;
319
+ };
320
+ }
321
+ /**
322
+ * Response model for LanguageOperator operations
323
+ */
324
+ interface LanguageOperator_ResponseResource {
325
+ id?: string;
326
+ displayName?: string;
327
+ description?: string;
328
+ version?: number;
329
+ author?: OperatorOperatorAuthor;
330
+ prompt?: string;
331
+ outputFormat?: OperatorOutputFormat;
332
+ outputSchema?: Record<string, object>;
333
+ trainingExamples?: Array<OperatorTrainingExample>;
334
+ context?: OperatorContext;
335
+ parameters?: {
336
+ [key: string]: OperatorParameter;
337
+ };
338
+ }
339
+ /**
340
+ * Union type for all possible response models
341
+ */
342
+ type OperatorResource = CreateOperator201Response_ResponseResource | LanguageOperator_ResponseResource;
343
+ /**
344
+ * A Language Operator resource.
345
+ */
346
+ export declare class OperatorInstance {
347
+ protected _version: V3;
348
+ protected _solution: OperatorContextSolution;
349
+ protected _context?: OperatorContext;
350
+ constructor(_version: V3, _payload: OperatorResource, id?: string);
351
+ /**
352
+ * The unique identifier for the Language Operator. Assigned by Twilio (TTID).
353
+ */
354
+ id?: string;
355
+ /**
356
+ * Display name of the Language Operator describing its purpose.
357
+ */
358
+ displayName?: string;
359
+ /**
360
+ * Description of the Language Operator further explaining its purpose.
361
+ */
362
+ description?: string;
363
+ /**
364
+ * Numeric Operator version. Automatically incremented with each update on the resource, used to ensure integrity when updating the Operator.
365
+ */
366
+ version?: number;
367
+ author?: OperatorOperatorAuthor;
368
+ /**
369
+ * The natural language instructions used by the operator to analyze the conversation. Within the prompt, users can reference parameters using the `{{parameters.[param_name]}}` syntax. Parameter values are provided to the Operator by the Intelligence Configuration Rule at runtime. **Note**: Prompts will only be exposed for Custom Operators (`author` = `SELF`). Twilio-authored Operators (`author` = `TWILIO`) will have their prompts omitted from the API.
370
+ */
371
+ prompt?: string;
372
+ outputFormat?: OperatorOutputFormat;
373
+ /**
374
+ * Required for `JSON` output only. this will be set to a JSON Schema object describing the properties & data types of the response. Please see https://platform.openai.com/docs/guides/structured-outputs#supported-schemas Will include the following keywords: - `type` : Must be set to `object` - `properties`: An object containing the property names and their data types you would like the LLM to return Additional details on JSON output formatting: - The root level `type` of a JSON schema must be set to `object` - The following property data types are supported : `string`, `number`, `boolean`, `integer`, `object`, `array`, `anyOf` - Definitions with `$defs` / `$ref` are supported - Max 100 object properties and 10 levels of nesting are supported - Max 1000 enum values across all enum properties are supported - Notable JSON Schema keywords not supported include: - For `strings`: `minLength`, `maxLength` - For `objects`: `patternProperties`, `unevaluatedProperties`, `propertyNames`, `minProperties`, `maxProperties` - For `arrays`: `unevaluatedItems`, `contains`, `minContains`, `maxContains`, `uniqueItems` - Structured Operator Results will be returned in the same order as the ordering of keys in the schema - In the event an Operator execution request is refused for safety reasons the Operator Result API response will include a new field called `refusal` to indicate that the LLM refused to fulfill the request - Twilio will automatically set `additionalProperties` to false and specify all provided fields as required (constraints of Structured Outputs). You don\'t need to pass these fields as part of your JSON schema. Twilio will automatically overwrite any user-provided values for these fields.
375
+ */
376
+ outputSchema?: Record<string, object>;
377
+ /**
378
+ * An array of example input/output pairs used to illustrate the intended behavior of the Language Operator. These examples help guide the model\'s understanding of expected input–output relationships and improve consistency during evaluation and testing. **Note**: Training examples will only be exposed for Custom Operators (`author` = `SELF`). Twilio-authored Operators (`author` = `TWILIO`) will have their training examples omitted from the API.
379
+ */
380
+ trainingExamples?: Array<OperatorTrainingExample>;
381
+ context?: OperatorContext;
382
+ /**
383
+ * Defines the schema of the parameters that are provided when running the operator, including required and optional values that determine the operator\'s behavior. The values of the parameters themselves are passed in by the attached Intelligence Configuration.
384
+ */
385
+ parameters?: {
386
+ [key: string]: OperatorParameter;
387
+ };
388
+ private get _proxy();
389
+ /**
390
+ * Remove a OperatorInstance
391
+ *
392
+ * @param callback - Callback to handle processed record
393
+ *
394
+ * @returns Resolves to processed boolean
395
+ */
396
+ remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
397
+ /**
398
+ * Remove a OperatorInstance and return HTTP info
399
+ *
400
+ * @param callback - Callback to handle processed record
401
+ *
402
+ * @returns Resolves to processed boolean with HTTP metadata
403
+ */
404
+ removeWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<boolean>) => any): Promise<ApiResponse<boolean>>;
405
+ /**
406
+ * Fetch a OperatorInstance
407
+ *
408
+ * @param callback - Callback to handle processed record
409
+ *
410
+ * @returns Resolves to processed OperatorInstance
411
+ */
412
+ fetch(callback?: (error: Error | null, item?: OperatorInstance) => any): Promise<OperatorInstance>;
413
+ /**
414
+ * Fetch a OperatorInstance and return HTTP info
415
+ *
416
+ * @param callback - Callback to handle processed record
417
+ *
418
+ * @returns Resolves to processed OperatorInstance with HTTP metadata
419
+ */
420
+ fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<OperatorInstance>) => any): Promise<ApiResponse<OperatorInstance>>;
421
+ /**
422
+ * Update a OperatorInstance
423
+ *
424
+ * @param params - Body for request
425
+ * @param headers - header params for request
426
+ * @param callback - Callback to handle processed record
427
+ *
428
+ * @returns Resolves to processed OperatorInstance
429
+ */
430
+ update(params: LanguageOperator, headers?: any, callback?: (error: Error | null, item?: OperatorInstance) => any): Promise<OperatorInstance>;
431
+ /**
432
+ * Update a OperatorInstance and return HTTP info
433
+ *
434
+ * @param params - Body for request
435
+ * @param headers - header params for request
436
+ * @param callback - Callback to handle processed record
437
+ *
438
+ * @returns Resolves to processed OperatorInstance with HTTP metadata
439
+ */
440
+ updateWithHttpInfo(params: LanguageOperator, headers?: any, callback?: (error: Error | null, item?: ApiResponse<OperatorInstance>) => any): Promise<ApiResponse<OperatorInstance>>;
441
+ /**
442
+ * Provide a user-friendly representation
443
+ *
444
+ * @returns Object
445
+ */
446
+ toJSON(): {
447
+ id: string;
448
+ displayName: string;
449
+ description: string;
450
+ version: number;
451
+ author: OperatorOperatorAuthor;
452
+ prompt: string;
453
+ outputFormat: OperatorOutputFormat;
454
+ outputSchema: Record<string, object>;
455
+ trainingExamples: OperatorTrainingExample[];
456
+ context: OperatorContext;
457
+ parameters: {
458
+ [key: string]: OperatorParameter;
459
+ };
460
+ };
461
+ [inspect.custom](_depth: any, options: InspectOptions): string;
462
+ }
463
+ export interface OperatorSolution {
464
+ }
465
+ export interface OperatorListInstance {
466
+ _version: V3;
467
+ _solution: OperatorSolution;
468
+ _uri: string;
469
+ (id: string): OperatorContext;
470
+ get(id: string): OperatorContext;
471
+ /**
472
+ * Create a OperatorInstance
473
+ *
474
+ * @param params - Body for request
475
+ * @param headers - header params for request
476
+ * @param callback - Callback to handle processed record
477
+ *
478
+ * @returns Resolves to processed OperatorInstance
479
+ */
480
+ create(params: LanguageOperator, headers?: any, callback?: (error: Error | null, item?: OperatorInstance) => any): Promise<OperatorInstance>;
481
+ /**
482
+ * Create a OperatorInstance and return HTTP info
483
+ *
484
+ * @param params - Body for request
485
+ * @param headers - header params for request
486
+ * @param callback - Callback to handle processed record
487
+ *
488
+ * @returns Resolves to processed OperatorInstance with HTTP metadata
489
+ */
490
+ createWithHttpInfo(params: LanguageOperator, headers?: any, callback?: (error: Error | null, item?: ApiResponse<OperatorInstance>) => any): Promise<ApiResponse<OperatorInstance>>;
491
+ /**
492
+ * Streams OperatorInstance records from the API.
493
+ *
494
+ * This operation lazily loads records as efficiently as possible until the limit
495
+ * is reached.
496
+ *
497
+ * The results are passed into the callback function, so this operation is memory
498
+ * efficient.
499
+ *
500
+ * If a function is passed as the first argument, it will be used as the callback
501
+ * function.
502
+ *
503
+ * @param { OperatorListInstanceEachOptions } [params] - Options for request
504
+ * @param { function } [callback] - Function to process each record
505
+ */
506
+ each(callback?: (item: OperatorInstance, done: (err?: Error) => void) => void): void;
507
+ each(params: OperatorListInstanceEachOptions, callback?: (item: OperatorInstance, done: (err?: Error) => void) => void): void;
508
+ /**
509
+ * Streams OperatorInstance records from the API with HTTP metadata captured per page.
510
+ *
511
+ * This operation lazily loads records as efficiently as possible until the limit
512
+ * is reached. HTTP metadata (status code, headers) is captured for each page request.
513
+ *
514
+ * The results are passed into the callback function, so this operation is memory
515
+ * efficient.
516
+ *
517
+ * If a function is passed as the first argument, it will be used as the callback
518
+ * function.
519
+ *
520
+ * @param { OperatorListInstanceEachOptions } [params] - Options for request
521
+ * @param { function } [callback] - Function to process each record
522
+ */
523
+ eachWithHttpInfo(callback?: (item: OperatorInstance, done: (err?: Error) => void) => void): void;
524
+ eachWithHttpInfo(params: OperatorListInstanceEachOptions, callback?: (item: OperatorInstance, done: (err?: Error) => void) => void): void;
525
+ /**
526
+ * Retrieve a single target page of OperatorInstance records from the API.
527
+ *
528
+ * The request is executed immediately.
529
+ *
530
+ * @param { string } [targetUrl] - API-generated URL for the requested results page
531
+ * @param { function } [callback] - Callback to handle list of records
532
+ */
533
+ getPage(targetUrl: string, callback?: (error: Error | null, items: OperatorPage) => any): Promise<OperatorPage>;
534
+ /**
535
+ * Retrieve a single target page of OperatorInstance records from the API with HTTP metadata.
536
+ *
537
+ * The request is executed immediately.
538
+ *
539
+ * @param { string } [targetUrl] - API-generated URL for the requested results page
540
+ * @param { function } [callback] - Callback to handle list of records with metadata
541
+ */
542
+ getPageWithHttpInfo(targetUrl: string, callback?: (error: Error | null, items: ApiResponse<OperatorPage>) => any): Promise<ApiResponse<OperatorPage>>;
543
+ /**
544
+ * Lists OperatorInstance records from the API as a list.
545
+ *
546
+ * If a function is passed as the first argument, it will be used as the callback
547
+ * function.
548
+ *
549
+ * @param { OperatorListInstanceOptions } [params] - Options for request
550
+ * @param { function } [callback] - Callback to handle list of records
551
+ */
552
+ list(callback?: (error: Error | null, items: OperatorInstance[]) => any): Promise<OperatorInstance[]>;
553
+ list(params: OperatorListInstanceOptions, callback?: (error: Error | null, items: OperatorInstance[]) => any): Promise<OperatorInstance[]>;
554
+ /**
555
+ * Lists OperatorInstance records from the API as a list with HTTP metadata.
556
+ *
557
+ * Returns all records along with HTTP metadata from the first page fetched.
558
+ *
559
+ * If a function is passed as the first argument, it will be used as the callback
560
+ * function.
561
+ *
562
+ * @param { OperatorListInstanceOptions } [params] - Options for request
563
+ * @param { function } [callback] - Callback to handle list of records with metadata
564
+ */
565
+ listWithHttpInfo(callback?: (error: Error | null, items: ApiResponse<OperatorInstance[]>) => any): Promise<ApiResponse<OperatorInstance[]>>;
566
+ listWithHttpInfo(params: OperatorListInstanceOptions, callback?: (error: Error | null, items: ApiResponse<OperatorInstance[]>) => any): Promise<ApiResponse<OperatorInstance[]>>;
567
+ /**
568
+ * Retrieve a single page of OperatorInstance records from the API.
569
+ *
570
+ * The request is executed immediately.
571
+ *
572
+ * If a function is passed as the first argument, it will be used as the callback
573
+ * function.
574
+ *
575
+ * @param { OperatorListInstancePageOptions } [params] - Options for request
576
+ * @param { function } [callback] - Callback to handle list of records
577
+ */
578
+ page(callback?: (error: Error | null, items: OperatorPage) => any): Promise<OperatorPage>;
579
+ page(params: OperatorListInstancePageOptions, callback?: (error: Error | null, items: OperatorPage) => any): Promise<OperatorPage>;
580
+ /**
581
+ * Retrieve a single page of OperatorInstance records from the API with HTTP metadata.
582
+ *
583
+ * The request is executed immediately.
584
+ *
585
+ * If a function is passed as the first argument, it will be used as the callback
586
+ * function.
587
+ *
588
+ * @param { OperatorListInstancePageOptions } [params] - Options for request
589
+ * @param { function } [callback] - Callback to handle list of records with metadata
590
+ */
591
+ pageWithHttpInfo(callback?: (error: Error | null, items: ApiResponse<OperatorPage>) => any): Promise<ApiResponse<OperatorPage>>;
592
+ pageWithHttpInfo(params: OperatorListInstancePageOptions, callback?: (error: Error | null, items: ApiResponse<OperatorPage>) => any): Promise<ApiResponse<OperatorPage>>;
593
+ /**
594
+ * Provide a user-friendly representation
595
+ */
596
+ toJSON(): any;
597
+ [inspect.custom](_depth: any, options: InspectOptions): any;
598
+ }
599
+ export declare function OperatorListInstance(version: V3): OperatorListInstance;
600
+ export declare class OperatorPage extends TokenPage<V3, OperatorPayload, OperatorResource, OperatorInstance> {
601
+ /**
602
+ * Initialize the OperatorPage
603
+ *
604
+ * @param version - Version of the resource
605
+ * @param response - Response from the API
606
+ * @param uri - URI of the resource
607
+ * @param params - Query parameters
608
+ * @param solution - Path solution
609
+ */
610
+ constructor(version: V3, response: Response<string>, uri: string, params: any, solution: OperatorSolution);
611
+ /**
612
+ * Build an instance of OperatorInstance
613
+ *
614
+ * @param payload - Payload response from the API
615
+ */
616
+ getInstance(payload: OperatorResource): OperatorInstance;
617
+ [inspect.custom](depth: any, options: InspectOptions): string;
618
+ }
619
+ export {};