functions.data_map
ai.SWAIG.functions.data_map
defines how a SWAIG function
should process and respond to the user's input data.
Name | Type | Default | Description |
---|---|---|---|
data_map Optional | object | - | An object that contains the data_map Parameters . |
data_map Parameters
Processing Order
The components are processed in the following sequence:
expressions
- Processes data using pattern matching (includes its ownoutput
)webhooks
- Makes external API calls (includes its ownoutput
andexpressions
)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
response
object: Contains static text for the AI agent's context - An optional
action
object: 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
Name | Type | Default | Description |
---|---|---|---|
expressions Required | object[] | - | 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. |
webhooks Required | object[] | - | An array of objects that define external API webhooks that can be used to make external API calls. |
output Required | object | - | An object that defines the output of the SWAIG function. Behaves like a return statement in traditional programming. |