<VirtualAgent> noun
<Connect>
verb's <VirtualAgent>
noun permits connecting the
call to a Dialogflow agent. To learn more about integrating SignalWire with
Dialogflow, see Integrating with Dialogflow Agents.
For example, one can connect to Dialogflow with:
- XML
- JavaScript
- C#
- Python
- Ruby
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Connect action="https://example.com/next-xml-instructions" >
<VirtualAgent connectorName="my-agent" />
</Connect>
</Response>
const { RestClient } = require("@signalwire/compatibility-api");
const response = new RestClient.LaML.VoiceResponse();
const connect = response.connect({
action: "https://example.com/next-xml-instructions",
});
connect.virtualAgent({
connectorName: "my-agent",
});
console.log(response.toString());
using System;
using Twilio.TwiML;
using Twilio.TwiML.Voice;
class Example
{
static void Main()
{
var response = new VoiceResponse();
var connect = new Connect(action: new Uri("https://example.com/next-xml-instructions"));
connect.VirtualAgent(connectorName: "my-agent");
response.Append(connect);
Console.WriteLine(response.ToString());
}
}
from signalwire.voice_response import Connect, VoiceResponse, VirtualAgent
response = VoiceResponse()
connect = Connect(action='https://example.com/next-xml-instructions')
connect.virtual_agent(
connector_name='my-agent'
)
response.append(connect)
print(response)
require 'signalwire/sdk'
response = Signalwire::Sdk::VoiceResponse.new do |response|
response.connect(action: 'https://example.com/next-xml-instructions') do |connect|
connect.virtual_agent(connector_name: 'my-agent')
end
end
puts response.to_s
Noun Attributes
Attribute | |
---|---|
connectorName | The Google Project ID of the agent to use. Find a list of IDs in the Dialogflow page in the UI. |
After a Dialogflow conversation is completed, SignalWire can make a request to the <Connect>
verb's action
attribute. In addition to the Standard Request Parameters, the following are parameters passed back to your application when SignalWire makes the request.
Parameter | |
---|---|
VirtualAgentErrorCode string | An error code, in case VirtualAgentStatus is "failed" . |
VirtualAgentError string | An error message, in case VirtualAgentStatus is "failed" . |
VirtualAgentProvider string | The provider of the VirtualAgent (e.g., Dialogflow ) |
VirtualAgentStatus string | E.g. failed or transfer |
VirtualAgentProviderData string | A JSON object (serialized as a string) containing data about the Dialogflow interaction. |