AIGather
The <AIGather>
verb collects specific information from call participants, leveraging AI. It requires the child node <Parameters>
to be provided with a JSON Schema object that describes the parameters to be gathered.
Attributes
ATTRIBUTE | DESCRIPTION | OPTIONS | DEFAULT |
---|---|---|---|
action | URL where TeXML will send the gathered speech input. The same method (GET/POST) as set for the TeXML application is used. Transfers control of the current call to the TeXML file returned. | - | |
method | HTTP request type used to retrieve the next set of instructions. | GET , POST | POST |
Child verbs/nouns
NOUN/VERB | DESCRIPTION |
---|---|
Greeting | Reads supplied text back to the caller when the gathering starts, if none, then nothing will be played when the gathering starts. |
Voice | The voice to be used by the voice assistant. |
Parameters | |
MessageHistory |
Examples
<Response>
<AIGather action="https://example.com/aigather">
<Greeting>Hello, please provide your age and location.</Greeting>
<Voice name="Polly.Joanna"/>
<Parameters>
<![CDATA[
{
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The location of the user"
},
"age": {
"type": "number",
"description": "The age of the user"
}
},
"required": ["location", "age"]
}
]]>
</Parameters>
<MessageHistory>
<Message role="assistant">Hello, what's your name?</Message>
<Message role="user">Hi, I'm Enzo.</Message>
</MessageHistory>
</AIGather>
</Response>
Expected callbacks
If action
is set, the following callbacks are expected:
action
{
"AccountSid": "cb6cfbbc-eb00-41af-a3f3-0d7b32009e4b",
"CallSid": "v2:DPNqxVjTNtQYaKdcKbU0QgRFrQ3YzuAQrVYC4Ggcuq7zTpDkUB7A4w",
"CallSidLegacy": "v2:DPNqxVjTNtQYaKdcKbU0QgRFrQ3YzuAQrVYC4Ggcuq7zTpDkUB7A4w",
"From": "Defaultj35z6@sip.telnyx.com",
"To": "+12132045020",
"Result": {
"age": 29,
"location": "Paris"
},
"MessageHistory": [
{
"role": "assistant",
"text": "Hello, what's your name?"
},
{
"role": "user",
"text": "Hi, I'm Enzo."
},
{
"role": "assistant",
"text": "Hello, please provide your age and location."
},
{
"role": "user",
"text": "Hi, I'm 29 and I live in Paris."
}
]
}
Status callback attributes
If statusCallbackEvent
is set, the following webhooks are expected.
ATTRIBUTE | DESCRIPTION |
AccountSid | A unique identifier for the account generating this call. |
CallSid | A unique identifier for this call, generated by Telnyx. |
From | The outbound caller number. |
To | The inbound callee number. |
Result | The result of the AI gather, its type depends on the parameters provided in the command. |
MessageHistory | The history of the messages exchanged during the AI gather. It also includes any messages passed in the MessageHistory of the AIGather verb. |