For the complete documentation index, see llms.txt. This page is also available as Markdown.

Generate Text/Html

These actions provide ability to produce text outputs using templates and input payload.

Generate Text/Html Actions

ApplyTemplate

Produces text (e.g. plain, html) from given input data and template id. Event metadata fields applicable for this action are as follows:

Field
Definition
Example
Default

Input Element

Json path for the input in request event payload

customer

-

Output Element

Json path for the output in response event payload

html

-

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "eventMeta": {
      "type": "object",
      "properties": {
        "inputElement": {
          "type": "string",
          "description": "Json path for the input in request event payload",
          "example": "customer"
        },
        "outputElement": {
          "type": "string",
          "description": "Json path for the output in response event payload",
          "example": "html"
        }
      }
    }
  }
}

With event metadata parameters as:

Parameter
Definition
Example
Default

Template ID

Id of the template to use from code.state

landing_page

-

Template ID Path

Json path of the template in event payload

parameters.template

-

Result Path

Json path to add produced text on output element

output

result

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "eventMeta": {
      "type": "object",
      "properties": {
        "parameters": {
          "type": "object",
          "properties": {
            "templateId": {
              "type": "string",
              "description": "Id of the template to use from code.state",
              "example": "landing_page"
            },
            "templateIdPath": {
              "type": "string",
              "description": "Json path of the template in event payload",
              "example": "parameters.template"
            },
            "resultPath": {
              "type": "string",
              "description": "Json path to add produced text on output element",
              "default": "result",
              "example": "output"
            }
          }
        }
      }
    }
  }
}
Example

Input

{
    "parameters": {
        "course": "Rierino 101",
        "chapters": [
            {"name": "Introduction"}
        ] 
    }
}

Event Metadata

ApplyTemplateList

Produces text from a given array of input data and template ids. Event metadata fields applicable for this action are as follows:

Field
Definition
Example
Default

Input Element

Json path for the input in request event payload

list

-

Output Element

Json path for the output in response event payload

html

-

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "eventMeta": {
      "type": "object",
      "properties": {
        "inputElement": {
          "type": "string",
          "description": "Json path for the input in request event payload",
          "example": "list"
        },
        "outputElement": {
          "type": "string",
          "description": "Json path for the output in response event payload",
          "example": "html"
        }
      }
    }
  }
}

With event metadata parameters as:

Parameter
Definition
Example
Default

Output Structure

Structure of output to produce (map, array, text)

map

-

Output Delimiter

Delimiter for concatenating results if structure is "text"

\n

-

Input Path

Json path to get list of requests from

list

input

Result Path

Json path to add produced text on output element

output

result

Last updated