AI Agents: Custom

Creates a custom AI Agent in your SignalWire project. The new agent becomes a reusable Fabric resource for conversational calls and can be reached through resource addresses or assigned as a call handler. Use a Dialogflow Agent for an existing Dialogflow integration, or Create call flow for visual, deterministic call logic.

Permissions

The API token used to authenticate must have the following scope(s) enabled to make a successful request: Voice, Messaging, Fax, or Video.

Learn more about API scopes.

post/api/fabric/resources/ai_agents

Request

  • Base URL
    https://{Your_Space_Name}.signalwire.com
  • URL
    https://{Your_Space_Name}.signalwire.com/api/fabric/resources/ai_agents
  • Auth
    HTTP basic

Request body

hintsstring[]

Hints help the AI agent understand certain words or phrases better. Words that can commonly be misinterpreted can be added to the hints to help the AI speak more accurately.

See ai.hints in the SWML reference.

languagesobject[]

An array of JSON objects defining supported languages in the conversation. Mutually exclusive with multilingual: if both are set, multilingual is used and this array is ignored.

See ai.languages in the SWML reference.

paramsobject

A JSON object containing parameters as key-value pairs.

See ai.params in the SWML reference.

post_promptobject

The final set of instructions and configuration settings to send to the agent.

See ai.post_prompt in the SWML reference.

pronounceobject[]

An array of JSON objects to clarify the AI's pronunciation of words or expressions.

See ai.pronounce in the SWML reference.

promptobject required

Defines the AI agent's personality, goals, behaviors, and instructions for handling conversations. The prompt establishes how the agent should interact with callers, what information it should gather, and how it should respond to various scenarios. It is recommended to write prompts using markdown formatting.

See ai.prompt in the SWML reference.

SWAIGobject

An array of JSON objects to create user-defined functions/endpoints that can be executed during the dialogue.

See ai.SWAIG in the SWML reference.

namestring required

Name of the AI Agent.

Example request

{
  "hints": [
    "pizza",
    "pepperoni"
  ],
  "languages": [
    {
      "name": "English",
      "code": "en-US",
      "voice": "rime.spore"
    }
  ],
  "params": {
    "ai_model": "gpt-4o-mini",
    "wait_for_user": true
  },
  "post_prompt": {
    "text": "Summarize the conversation and provide any follow-up action items."
  },
  "pronounce": [
    {
      "replace": "SWML",
      "with": "swim-el",
      "ignore_case": true
    }
  ],
  "prompt": {
    "text": "You are a helpful customer support assistant."
  },
  "SWAIG": {
    "native_functions": [
      "check_time"
    ]
  },
  "name": "My AI Agent"
}

Response

The request has succeeded and a new resource has been created as a result.

idstring uuid required

Universal Unique Identifier.

project_idstring uuid required

Universal Unique Identifier.

display_namestring required

Display name of the AIAgent Fabric Resource

type'ai_agent' required

Type of the Fabric Resource

created_atstring date-time required

Date and time when the resource was created.

updated_atstring date-time required

Date and time when the resource was updated.

Example response

{
  "display_name": "Booking Assistant",
  "type": "ai_agent",
  "created_at": "2024-05-06T12:20:00Z",
  "updated_at": "2024-05-06T12:20:00Z",
  "ai_agent": {
    "hints": [
      "pizza",
      "pepperoni"
    ],
    "languages": [
      {
        "name": "English",
        "code": "en-US",
        "voice": "rime.spore"
      }
    ],
    "params": {
      "ai_model": "gpt-4o-mini",
      "wait_for_user": true
    },
    "post_prompt": {
      "text": "Summarize the conversation and provide any follow-up action items."
    },
    "pronounce": [
      {
        "replace": "SWML",
        "with": "swim-el",
        "ignore_case": true
      }
    ],
    "prompt": {
      "text": "You are a helpful customer support assistant."
    },
    "SWAIG": {
      "native_functions": [
        "check_time"
      ]
    },
    "name": "My AI Agent"
  }
}

Changes

    • breaking

      request property / list-of-types was narrowed by removing types object from media type application/json

    • warning

      removed the request property

    • warning

      removed the request property

    • warning

      removed the request property

    • warning

      removed the request property

    • warning

      removed the optional property // from the response with the status

    • warning

      removed the optional property // from the response with the status

    • warning

      removed the optional property // from the response with the status

    • info

      response property ai_agent/allOf[subschema #1: AI Agent]/hints/items/ list-of-types was narrowed by removing types object from media type application/json of response 201

    • breaking

      removed from the / request property anyOf list

    • breaking

      the request property type changed from no type to object

    • breaking

      the request property type changed from no type to object

    • breaking

      the request property type changed from no type to object

    • breaking

      the request property type changed from no type to object

    • breaking

      the request property type changed from no type to object

    • breaking

      the request property type changed from no type to object

    • breaking

      added 'unevaluatedProperties' constraint to the request property

    • breaking

      added 'unevaluatedProperties' constraint to the request property

    • breaking

      added 'unevaluatedProperties' constraint to the request property

    • breaking

      added 'unevaluatedProperties' constraint to the request property

    • breaking

      added 'unevaluatedProperties' constraint to the request property

    • breaking

      added 'unevaluatedProperties' constraint to the request property

    • breaking

      the // response's property type changed from no type to object for status

    • breaking

      the // response's property type changed from no type to object for status

    • breaking

      the // response's property type changed from no type to object for status

    • breaking

      the // response's property type changed from no type to object for status

    • breaking

      the // response's property type changed from no type to object for status

    • breaking

      the // response's property type changed from no type to object for status

    • breaking

      removed the required property //// from the response with the status

    • breaking

      removed the required property //// from the response with the status

    • breaking

      removed the required property //// from the response with the status

    • breaking

      removed the required property //// from the response with the status

    • breaking

      removed the required property //// from the response with the status

    • warning

      removed from the request property allOf list

    • warning

      removed from the request property allOf list

    • warning

      removed from the request property allOf list

    • warning

      removed from the request property allOf list

    • warning

      removed from the request property allOf list

    • warning

      removed from the request property allOf list

    • warning

      removed the request property //

    • warning

      removed the request property //

    • warning

      removed the request property //

    • warning

      removed the request property //

    • warning

      removed the request property //

    • warning

      removed the request property //

    • warning

      removed the request property //

    • warning

      removed the request property //

    • warning

      removed the request property //

    • warning

      removed the request property //

    • warning

      removed the request property //

    • warning

      removed the request property //

    • warning

      removed the request property //

    • warning

      removed the request property //

    • warning

      removed the request property //

    • warning

      removed the request property //

    • warning

      removed the request property //

    • warning

      removed the optional property //// from the response with the status

    • warning

      removed the optional property //// from the response with the status

    • warning

      removed the optional property //// from the response with the status

    • warning

      removed the optional property //// from the response with the status

    • warning

      removed the optional property //// from the response with the status

    • warning

      removed the optional property //// from the response with the status

    • warning

      removed the optional property //// from the response with the status

    • warning

      removed the optional property //// from the response with the status

    • warning

      removed the optional property //// from the response with the status

    • warning

      removed the optional property //// from the response with the status

    • warning

      removed the optional property //// from the response with the status

    • warning

      removed the optional property //// from the response with the status

    • info

      added subschema #2 to the / request property anyOf list

    • info

      removed from the // response property allOf list for the response status

    • info

      removed from the // response property allOf list for the response status

    • info

      removed from the // response property allOf list for the response status

    • info

      removed from the // response property allOf list for the response status

    • info

      removed from the // response property allOf list for the response status

    • info

      removed from the // response property allOf list for the response status

    • info

      added subschema #2 to the /// response property anyOf list for the response status

    • info

      removed from the /// response property anyOf list for the response status

    • info

      added 'unevaluatedProperties' constraint to the // response property for the status

    • info

      added 'unevaluatedProperties' constraint to the // response property for the status

    • info

      added 'unevaluatedProperties' constraint to the // response property for the status

    • info

      added 'unevaluatedProperties' constraint to the // response property for the status

    • info

      added 'unevaluatedProperties' constraint to the // response property for the status

    • info

      added 'unevaluatedProperties' constraint to the // response property for the status

Some revisions have not been checked yet.