Skill Implementation API (1.0.0)
Download OpenAPI specification:Download
The Skills REST API provides a way for developers to create their own skills programmatically and subsequently expose them in Digital DNA Studio so that they can be used by users building interactions with Digital People. These endpoints are hooks that will be triggered at different stages once the Skill has been registered and added to a project.
Note: The
/execute
endpoint is required while the other endpoints are optional. For Stateful Skills, it is recommended to implement the /session endpoint.
Runs when a DDNA Studio project is deployed with this Skill configured.
(optional) Use this endpoint to implement any Skill-specific initialization (such as configuration, data storage, or pre-training) that needs to be run in advance of the Skill being executed at runtime.
This endpoint will be called each time a DDNA Studio Project using the Skill is deployed. The endpoint
should expect to be called multiple times with the same projectId
but varying config
as the
project may be redeployed with changes to the Skill's configuration.
header Parameters
Authorization | string Authorization header (future functionality) |
Request Body schema: application/json
projectId required | string Unique identifier for the project using the skill and its deployment environment. For example, each project will give a unique ID for either of its preview and public deployments. |
deploymentEnvironment required | string (DeploymentEnvironment) Enum: "preview" "public" Environment that the related Project is deployed in - preview (within DDNA Studio) or public (typical deployment for end users). When running in a preview environment, the Skill should minimize execution time, particularly for the Init endpoint. |
ownerId | string |
organizationId | string |
config required | object Skill configuration data will be included in this object. |
Responses
Request samples
- Payload
{- "projectId": "ABC123",
- "deploymentEnvironment": "preview",
- "ownerId": "string",
- "organizationId": "string",
- "config": {
- "config1": "string",
- "config2": 20,
- "config3": {
- "name": "value"
}
}
}
Establishes a session
(optional for Stateless Skills) Establishes a session with a particular projectID/sessionID/config combination. Required for stateful skills. This is an optional endpoint which is called at the start of every interaction between a user and a Digital Person prior to the first conversation turn. It can be used to initialize session-specific resources.
header Parameters
Authorization | string Authorization header (future functionality) |
Request Body schema: application/json
projectId required | string Unique identifier for the project using the skill and its deployment environment. For example, each project will give a unique ID for either of its preview and public deployments. |
deploymentEnvironment required | string (DeploymentEnvironment) Enum: "preview" "public" Environment that the related Project is deployed in - preview (within DDNA Studio) or public (typical deployment for end users). When running in a preview environment, the Skill should minimize execution time, particularly for the Init endpoint. |
sessionId required | string A UUIDv4 identifier for this particular session |
config | object Includes Skill configuration data in this object. |
Array of objects (Memory) Information stored from the most recent response received from the endpoint |
Responses
Request samples
- Payload
{- "projectId": "ABC123",
- "deploymentEnvironment": "preview",
- "sessionId": "7600aff2-6ebd-44de-bcd2-1facd8ab4f29",
- "config": {
- "config1": "string",
- "config2": 20,
- "config3": {
- "name": "value"
}
}, - "memory": [
- {
- "name": "memory1",
- "scope": "PRIVATE",
- "value": "value1",
- "session_id": "456ABC456"
}, - {
- "name": "memory2",
- "scope": "PUBLIC",
- "value": {
- "name": "string"
}
}, - {
- "name": "memory3",
- "scope": "PUBLIC",
- "value": 1,
- "session_id": "123ABC123"
}
]
}
Response samples
- 200
{- "memory": [
- {
- "name": "memory1",
- "scope": "PRIVATE",
- "value": "value1",
- "session_id": "456ABC456"
}, - {
- "name": "memory2",
- "scope": "PUBLIC",
- "value": {
- "name": "string"
}
}, - {
- "name": "memory3",
- "scope": "PUBLIC",
- "value": 1,
- "session_id": "123ABC123"
}
]
}
Executes this Skill on each user conversation turn
(required) This is the primary endpoint to which user requests are sent every turn. This endpoint should return a response which is to be spoken by the Digital Person.
header Parameters
Authorization | string Authorization header (future functionality) |
Request Body schema: application/json
projectId required | string Unique identifier for the project using the skill and its deployment environment. For example, each project will give a unique ID for either of its preview and public deployments. |
deploymentEnvironment required | string (DeploymentEnvironment) Enum: "preview" "public" Environment that the related Project is deployed in - preview (within DDNA Studio) or public (typical deployment for end users). When running in a preview environment, the Skill should minimize execution time, particularly for the Init endpoint. |
sessionId required | string A UUIDv4 identifier for this particular session |
object (Intent) Intent object containing the matched intent name and the confidence of the match | |
text required | string User input |
required | Array of objects (Memory) Information stored from the most recent response received from the endpoint |
config | object Skill configuration data will be included in this object. This property will only be included if the Skill is Stateless (i.e. no endpointSession is provided). |
object Contains the context of the request, is also used to send DP specific data e.g. EQ data. Might contain Processing_Stage stating if a request is for a pre or post stage. Might contain Conversation_History of up to 5 conversation turns. |
Responses
Request samples
- Payload
{- "projectId": "ABC123",
- "deploymentEnvironment": "preview",
- "sessionId": "7600aff2-6ebd-44de-bcd2-1facd8ab4f29",
- "intent": {
- "name": "MY_INTENT",
- "confidence": 0
}, - "text": "Show me a cat",
- "memory": [
- {
- "name": "memory1",
- "scope": "PRIVATE",
- "value": "value1",
- "session_id": "456ABC456"
}, - {
- "name": "memory2",
- "scope": "PUBLIC",
- "value": {
- "name": "string"
}
}, - {
- "name": "memory3",
- "scope": "PUBLIC",
- "value": 1,
- "session_id": "123ABC123"
}
], - "config": {
- "config1": "string",
- "config2": 20,
- "config3": {
- "name": "value"
}
}, - "context": {
- "Current_Time": "11 05 pm",
- "FacePresent": 1,
- "Turn_Id": "2050c232-f49c-4cfe-a440-13bde4af120f",
- "stt_final_result_string": "Show me a cat",
- "UserTurn_IsAttentive": 0.3602287173271179,
- "UserTurn_IsTalking": null,
- "UserTurn_TextAnger": 0,
- "UserTurn_TextCare": 0,
- "UserTurn_TextConcern": 0,
- "UserTurn_TextDisgust": 0,
- "UserTurn_TextDistress": 0,
- "UserTurn_TextExcitement": 0,
- "UserTurn_TextFear": 0,
- "UserTurn_TextInterest": 0,
- "UserTurn_TextJoy": 0,
- "UserTurn_TextShame": 0,
- "UserTurn_TextSurprise": 0,
- "UserTurn_TextValence": 0,
- "User_Turn_Confusion": null,
- "User_Turn_Negativity": null,
- "User_Turn_Positivity": 0.5356926918029785,
- "is_speaking": false,
- "PersonaTurn_IsAttentive": null,
- "PersonaTurn_IsTalking": null,
- "Persona_Turn_Confusion": null,
- "Persona_Turn_Negativity": null,
- "Persona_Turn_Positivity": null
}
}
Response samples
- 200
{- "output": {
- "text": "Here is a cat",
- "variables": {
- "public": {
- "exitVariable": true,
- "card": {
- "type": "image",
}
}
}
}, - "intent": {
- "name": "MY_INTENT",
- "confidence": 0
}, - "memory": [
- {
- "name": "memory1",
- "scope": "PRIVATE",
- "value": "value1",
- "session_id": "456ABC456"
}, - {
- "name": "memory2",
- "scope": "PUBLIC",
- "value": {
- "name": "string"
}
}, - {
- "name": "memory3",
- "scope": "PUBLIC",
- "value": 1,
- "session_id": "123ABC123"
}
], - "endConversation": true,
- "endRouting": false
}
Runs when a DDNA Studio project stops using this Skill
(optional) Use this endpoint to implement any clean-up for a Skill when it is no longer used by a project.
Skills which make use of the init
endpoint may also find the delete
endpoint particularly useful
for cleaning up any long-running tasks or stored data associated with the provided projectId
.
The delete
endpoint will be called every time a DDNA Studio project using this Skill is deleted.
It will also be called when a project using the Skill removes it and is then redeployed.
path Parameters
id required | string Project ID that triggered this hook |
header Parameters
Authorization | string Authorization header (future functionality) |
Request Body schema: application/json
deploymentEnvironment required | string (DeploymentEnvironment) Enum: "preview" "public" Environment that the related Project is deployed in - preview (within DDNA Studio) or public (typical deployment for end users). When running in a preview environment, the Skill should minimize execution time, particularly for the Init endpoint. |
Responses
Request samples
- Payload
{- "deploymentEnvironment": "preview"
}