Skip to contentSkip to navigationSkip to topbar

Retrieve an Operator


(information)

Legal information

Conversation Intelligence, including the APIs, may use artificial intelligence or machine learning technologies and is subject to the terms of the Predictive and Generative AI/ML Features Addendum(link takes you to an external page). For more details on AI usage and data, see AI Nutrition Facts for Conversation Intelligence.

Conversation Intelligence is not PCI compliant or a HIPAA Eligible Service and should not be used in workflows that are subject to HIPAA or PCI.

Conversations products are only available in the new Twilio Console(link takes you to an external page). If your account hasn't been migrated, you'll be redirected to the legacy Console where these products won't appear.

GET/v3/ControlPlane/Operators/{id}

Base url: https://intelligence.twilio.com (Twilio Intelligence API)

Request

fetch-operator-request page anchor

Authentication

authentication page anchor
Property nameTypeRequiredPIIDescription
idstring
requiredread-only
Not PII

The unique identifier (TTID) of the Language Operator.

Example: intelligence_operator_01k6fc25s7epm9qtk8rszbv3q5Pattern: ^intelligence_operator_[0-7][0-9a-z]{25}$

200404429500

A Language Operator resource.

SchemaExample
Property nameTypeRequiredPIIDescriptionChild properties
idstring
read-only

Optional

The unique identifier for the Language Operator. Assigned by Twilio (TTID).

Example: intelligence_operator_01k6fc25s7epm9qtk8rszbv3q5Pattern: ^intelligence_operator_[0-7][0-9a-z]{25}$

displayNamestring

Optional

Display name of the Language Operator describing its purpose.


descriptionstring

Optional

Description of the Language Operator further explaining its purpose.


versioninteger
read-only

Optional

Numeric Operator version. Automatically incremented with each update on the resource, used to ensure integrity when updating the Operator.


authorenum<string>
read-only

Optional

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)
Possible values:
SELFTWILIO

promptstring

Optional

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.


outputFormatenum<string>

Optional

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.
Possible values:
TEXTJSONCLASSIFICATION

outputSchemaobject

Optional

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.

trainingExamplesarray[object]

Optional

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.


contextobject

Optional

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.


parametersobject

Optional

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.

Retrieve an OperatorLink to code sample: Retrieve an Operator
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function fetchOperator() {
11
const operator = await client.intelligence.v3
12
.operators("intelligence_operator_01k6fc25s7epm9qtk8rszbv3q5")
13
.fetch();
14
15
console.log(operator.id);
16
}
17
18
fetchOperator();

Response

Note about this response
1
{
2
"id": "intelligence_operator_01k6fc25s7epm9qtk8rszbv3q5",
3
"displayName": "Script Adherence",
4
"description": "Measuring whether the agent stuck to the script",
5
"version": 1,
6
"author": "SELF",
7
"prompt": "Your job is to determine if a contact center agent sticks to the script. Fetch the script from Knowledge using the Knowledge tool. Rate the interaction from 0-{{parameters.scale}}.",
8
"outputFormat": "JSON",
9
"outputSchema": {
10
"type": "object",
11
"properties": {
12
"score": {
13
"type": "integer"
14
},
15
"explanation": {
16
"type": "string"
17
}
18
},
19
"required": [
20
"score",
21
"explanation"
22
],
23
"additionalProperties": false
24
},
25
"trainingExamples": [
26
{
27
"input": "This is an example sentence which qualifies the lead as HOT.",
28
"output": "{\"score\": 5, \"explanation\": \"The agent followed the script closely and addressed all key points effectively.\"}"
29
}
30
],
31
"context": {
32
"memory": {
33
"enabled": true
34
},
35
"knowledge": {
36
"enabled": true
37
}
38
},
39
"parameters": {
40
"scale": {
41
"type": "integer",
42
"default": 5,
43
"description": "Maximum score for evaluating script adherence."
44
}
45
}
46
}