Functions and Actions
AI Functions
Use AI Functions for executing AI Commands with arguments. AI Functions are reusable pieces of AI Commands that change depending on what arguments you use. AI Functions and Arguments are represented as nodes in the tree. Create a new AI Function by adding a Function node, or via the Knowledge Session Panel.
Create functions with arguments and call them via Action Panel, or create an Action node with fixed arguments.
AI Function features
- Adding Arguments: Arguments can be added to a function node and can be defined as either text or node type.
- Custom Commands: Write custom commands that execute when the function is called, enabling dynamic content creation.
- Dynamic Data Context: Use arguments for specifying the Data Context, or set them statically.
AI Function Runtime
When executing a function, the Function panel switches to a Runtime mode, and you can see what the command and data contexts have been populated with by the argument values used.
As seen in the image above, AI gave each philosopher a Famous Quote and added a twist about a cat, since the argument "Change" contained "I think jokes about cats are funny", and argument "Source" pointed to the root node in the philopher tree.
Function Execution
- Call Functions Panel: Functions can be accessed from the Call Functions Panel (Alt + T), where we can view available functions from current document(s) and system.
- Populating Arguments: Drag nodes into function arguments in the panel and execute the function with specified parameters.
- Start Function: Press the Start button, and the Function panel will swith to Runtime mode and execute the function.
- Create an Action Node: Create an Action node in the tree, connect to a Function and populate arguments
- Populating Arguments: Drag nodes into action nodes arguments nodes in the tree
- Start Function: Press the Start button below the Action nodes in the tree
Action Node
An Action node is a node that is pointing to a Function, and has a set of fixed arguments. When running an Action node, you execute that Function with these arguments.
Create an Action node, and then write "=" in the label, and a dialog will open where you select what function the action shall call.
Connect a node to the Action node's argument by drag and drop. If argument is text, write the text as the arguments content.