<Tool>
Teach your AI Voice Agent a new <Tool>
.
Join our Discord community - we're here to help.
Description
Declare a tool made available to the LLM, performing complex tasks, such as file searches, function calling and more.
The <Tool>
verb follows a similar logic to how Assistant API Tools are defined my other LLM platform, such as the
following:
Tools are affectively a remote web service, the LLM can activate, using data that is passed to it. Data can be passed to the remote tool, using any data that is available to the Voice Application Request.
If a <Parameter>
is defined to be passed to the tool, however, the name provided isn't available as part of the request,
the execution of this verb will terminate with an error - and the session will be terminated.
Example
<Response>
<Gather input="speech" speechEngine="google" actionOnEmptyResult="true" speechTimeout="1.5" speechDetection="stt">
<Converse voice="Google:en-GB-Standard-A" language="en-GB" sessionTools="redirect dial">
<Tool name="contactLookUp" url="https://example.com/contactLookUp">
<Description>Search/Create a contact in our contact address book</Description>
<Parameter name="From" />
<Parameter name="To" />
<Parameter name="Session" />
<Parameter name="Domain" />
</Tool>
<System>
Use the contactLookUp tool to lookup the caller. If the tool reports back a JSON object with
contact information, greet the caller that you're happy to see them again. If the tool reports
an error, greet the user in a formal manner and ask them for their name.
</System>
<Speech/>
</Converse>
</Gather>
</Response>
Attributes
The following attributes are required:
Attribute Name | Allowed Values | Default Value |
---|---|---|
name | Any string value | N/A |
url | A valid URL string | N/A |
<Description>
<Description
> is an optional noun, providing a text description for your LLM tool.
Example
<Response>
<Gather input="speech" speechEngine="google" actionOnEmptyResult="true" speechTimeout="1.5" speechDetection="stt">
<Converse voice="Google:en-GB-Standard-A" language="en-GB" sessionTools="redirect dial">
<Tool name="simpleTool" url="https://example.com/simpleTool">
<Description>Just a simple tool description</Description>
</Tool>
<System>
Just a simple System prompt.
</System>
<Speech/>
</Converse>
</Gather>
</Response>
<Parameter>
The following attributes are required:
Attribute Name | Allowed Values | Default Value |
---|---|---|
name | Any parameter name defined in the Voice Application Request | N/A |
The following attributes are optional:
Attribute Name | Allowed Values | Default Value |
---|---|---|
description | Any text value | N/A |
type | string , integer , number , boolean , enum | string |
required | true , false | true |
values | Comma seperated list of values, when type = enum | N/A |