functions.data_map
functions[].data_map defines how a SWAIG function should process and respond to the user's input data.
An object that contains the data_map Parameters.
data_map Parameters
The components are processed in the following sequence:
expressions- Processes data using pattern matching (includes its ownoutput)webhooks- Makes external API calls (includes its ownoutputandexpressions)output- Returns a direct response and actions to perform
Similar to a return statement in conventional programming languages,
when a valid output is encountered within any component,
it immediately terminates function execution.
The output provides:
- A
responseobject: Contains static text for the AI agent's context - An optional
actionobject: Defines executable actions to be triggered
If no component produces a valid output, the system continues processing in sequence:
- First attempts
expressions - If unsuccessful, tries
webhooks - If still unsuccessful, attempts top-level
output - If all fail, returns a generic fallback error message
An array of objects that have pattern matching logic to process the user's input data. A user can define multiple expressions to match against the user's input data.
See expressions for additional details.
An array of objects that define external API webhooks that can be used to make external API calls.
See webhooks for additional details.
An object that defines the output of the SWAIG function. Behaves like a return statement in traditional programming.
See output for additional details.