The Skills Async API provides a way for developers to create more advanced conversation interactions with your Digital People, by allowing you to send and receive messages asynchronously. This provides more flexibility than the REST-based skill API when you want to go beyond simple request-response interactions.
Example applications can be streaming multiple messages in the same turn, or allowing the skill to send messages to the user proactively.
Messages consist of a name and a payload, as per AsyncAPI standards. Messages are sent over a websocket connection that persists through the session.
You can still implement the skill REST API
Init
andDelete
project operations as part of your async skill if you need to do any project related processing.
Local WebSocket server for development and testing
Accepts one of the following messages:
Payload schema for conversation
messages.
Conversation message from the user sent to the skill.
{
"projectId": "string",
"sessionId": "string",
"config": {},
"text": "string",
"variables": {},
"memory": [
{
"name": "string",
"value": null,
"session_id": "string",
"scope": "PRIVATE"
}
],
"deploymentEnvironment": "preview"
}
Payload schema for sessionStart
messages.
Message sent to the skill at the start of the session, can be useful to do processing or caching on a per-session basis.
{
"projectId": "string",
"sessionId": "string",
"config": {},
"deploymentEnvironment": "preview"
}
Payload schema for sessionEnd
messages.
Message sent to the skill at the end of the session, can be useful to clean up session resources or do end-of-session processing
{
"projectId": "string",
"sessionId": "string",
"deploymentEnvironment": "preview"
}
Accepts the following message:
Payload schema for skillConversation
messages.
Conversation message emitted by the skill to be sent to the user.
{
"text": "string",
"variables": {},
"intent": {
"name": "MY_INTENT",
"confidence": 0
},
"memory": [
{
"name": "string",
"value": null,
"session_id": "string",
"scope": "PRIVATE"
}
]
}
Payload schema for sessionStart
messages.
Message sent to the skill at the start of the session, can be useful to do processing or caching on a per-session basis.
Payload schema for sessionEnd
messages.
Message sent to the skill at the end of the session, can be useful to clean up session resources or do end-of-session processing
Payload schema for conversation
messages.
Conversation message from the user sent to the skill.
Payload schema for skillConversation
messages.
Conversation message emitted by the skill to be sent to the user.