Fill Text
Fill text inserts text pulled from value points or the data token. It is useful for dynamically creating AI service instructions.
How it Works
Fill text is accessed via preconfigured code points available to all organizations. The following are the steps to use fill text.
Import Point
Import fill_text
:
{
"imports": [
"fill_text"
]
}
Use in Code Point
Fill text evaluates criteria within sets of double brackets, such as [[<criteria>]]
. The following criteria are supported:
Data Token
[[path_in_data_token]]
: Replaces with the value from the path within the data token.
Example
[[_this.type]]
would be item
, if the path _this.type
has a value of item
.
Data Token or Other Value
[[path_in_data_token?Or this instead]]
: Replaces with the value from the path within the data token if it exists; if not, it replaces with the alternative text.
Example
[[_this.type?hello]]
would be item
, if the path _this.type
has a value of item
. Alternatively, if _this.type
is undefined, it would replace with hello
.
Value Point
[[@name_of_value_point]]
: Replaces with the value from a value point.
Example
[[@organization_name]]
would be melodyarc
, if a value point named organization_name
had a value of melodyarc
.
List from Value Points in Partition
[[*partition_name.key_in_value_key]]
: Retrieves a defined key from within the value
key from all value points within a partition and formats it into a markdown-compliant bulleted list. Can optionally sort by adding.
Sorting
If value points have a key of
value.sort
, that value will be used to sort the bullets in an ascending order.
Example
[[*label-message.option]]
would be - item 1 - item 2 - item 3
, if there were three value points with a partition of label-message
and each had a value of value.option
equal to either item 1
, item 2
, or item 3
.
Updated 5 months ago